src/share/vm/code/nmethod.hpp

changeset 6941
63e0c47ca943
parent 6429
606acabe7b5c
child 6983
9717199cb8de
     1.1 --- a/src/share/vm/code/nmethod.hpp	Tue Jul 22 07:35:52 2014 -0700
     1.2 +++ b/src/share/vm/code/nmethod.hpp	Thu Jul 17 10:21:31 2014 +0200
     1.3 @@ -69,7 +69,12 @@
     1.4    friend class VMStructs;
     1.5   private:
     1.6    enum { cache_size = 4 };
     1.7 -  PcDesc* _pc_descs[cache_size]; // last cache_size pc_descs found
     1.8 +  // The array elements MUST be volatile! Several threads may modify
     1.9 +  // and read from the cache concurrently. find_pc_desc_internal has
    1.10 +  // returned wrong results. C++ compiler (namely xlC12) may duplicate
    1.11 +  // C++ field accesses if the elements are not volatile.
    1.12 +  typedef PcDesc* PcDescPtr;
    1.13 +  volatile PcDescPtr _pc_descs[cache_size]; // last cache_size pc_descs found
    1.14   public:
    1.15    PcDescCache() { debug_only(_pc_descs[0] = NULL); }
    1.16    void    reset_to(PcDesc* initial_pc_desc);

mercurial