< prev index next >

src/share/vm/gc/shared/barrierSet.hpp

Print this page
rev 12854 : [mq]: gcinterface.patch


 107   virtual bool has_write_prim_barrier() = 0;
 108 
 109   // These functions indicate whether a particular access of the given
 110   // kinds requires a barrier.
 111   virtual bool read_ref_needs_barrier(void* field) = 0;
 112   virtual bool read_prim_needs_barrier(HeapWord* field, size_t bytes) = 0;
 113   virtual bool write_prim_needs_barrier(HeapWord* field, size_t bytes,
 114                                         juint val1, juint val2) = 0;
 115 
 116   // The first four operations provide a direct implementation of the
 117   // barrier set.  An interpreter loop, for example, could call these
 118   // directly, as appropriate.
 119 
 120   // Invoke the barrier, if any, necessary when reading the given ref field.
 121   virtual void read_ref_field(void* field) = 0;
 122 
 123   // Invoke the barrier, if any, necessary when reading the given primitive
 124   // "field" of "bytes" bytes in "obj".
 125   virtual void read_prim_field(HeapWord* field, size_t bytes) = 0;
 126 








 127   // Invoke the barrier, if any, necessary when writing "new_val" into the
 128   // ref field at "offset" in "obj".
 129   // (For efficiency reasons, this operation is specialized for certain
 130   // barrier types.  Semantically, it should be thought of as a call to the
 131   // virtual "_work" function below, which must implement the barrier.)
 132   // First the pre-write versions...
 133   template <class T> inline void write_ref_field_pre(T* field, oop new_val);
 134 private:
 135   // Helper for write_ref_field_pre and friends, testing for specialized cases.
 136   bool devirtualize_reference_writes() const;
 137 
 138   // Keep this private so as to catch violations at build time.
 139   virtual void write_ref_field_pre_work(     void* field, oop new_val) { guarantee(false, "Not needed"); };
 140 protected:
 141   virtual void write_ref_field_pre_work(      oop* field, oop new_val) {};
 142   virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) {};
 143 public:
 144 
 145   // ...then the post-write version.
 146   inline void write_ref_field(void* field, oop new_val, bool release = false);




 107   virtual bool has_write_prim_barrier() = 0;
 108 
 109   // These functions indicate whether a particular access of the given
 110   // kinds requires a barrier.
 111   virtual bool read_ref_needs_barrier(void* field) = 0;
 112   virtual bool read_prim_needs_barrier(HeapWord* field, size_t bytes) = 0;
 113   virtual bool write_prim_needs_barrier(HeapWord* field, size_t bytes,
 114                                         juint val1, juint val2) = 0;
 115 
 116   // The first four operations provide a direct implementation of the
 117   // barrier set.  An interpreter loop, for example, could call these
 118   // directly, as appropriate.
 119 
 120   // Invoke the barrier, if any, necessary when reading the given ref field.
 121   virtual void read_ref_field(void* field) = 0;
 122 
 123   // Invoke the barrier, if any, necessary when reading the given primitive
 124   // "field" of "bytes" bytes in "obj".
 125   virtual void read_prim_field(HeapWord* field, size_t bytes) = 0;
 126 
 127   virtual void oop_store(oop* p, oop v);
 128   virtual void oop_store(narrowOop* p, oop v);
 129   virtual void oop_store(volatile oop* p, oop v);
 130   virtual void oop_store(volatile narrowOop* p, oop v);
 131 
 132   virtual void klass_oop_store(oop* p, oop v);
 133   virtual void klass_oop_store(volatile oop* p, oop v);
 134 
 135   // Invoke the barrier, if any, necessary when writing "new_val" into the
 136   // ref field at "offset" in "obj".
 137   // (For efficiency reasons, this operation is specialized for certain
 138   // barrier types.  Semantically, it should be thought of as a call to the
 139   // virtual "_work" function below, which must implement the barrier.)
 140   // First the pre-write versions...
 141   template <class T> inline void write_ref_field_pre(T* field, oop new_val);
 142 private:
 143   // Helper for write_ref_field_pre and friends, testing for specialized cases.
 144   bool devirtualize_reference_writes() const;
 145 
 146   // Keep this private so as to catch violations at build time.
 147   virtual void write_ref_field_pre_work(     void* field, oop new_val) { guarantee(false, "Not needed"); };
 148 protected:
 149   virtual void write_ref_field_pre_work(      oop* field, oop new_val) {};
 150   virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) {};
 151 public:
 152 
 153   // ...then the post-write version.
 154   inline void write_ref_field(void* field, oop new_val, bool release = false);


< prev index next >