src/share/vm/memory/barrierSet.hpp

changeset 1280
df6caf649ff7
parent 791
1ee8caae33af
child 1526
6aa7255741f3
equal deleted inserted replaced
1274:bb18957ad21e 1280:df6caf649ff7
79 // ref field at "offset" in "obj". 79 // ref field at "offset" in "obj".
80 // (For efficiency reasons, this operation is specialized for certain 80 // (For efficiency reasons, this operation is specialized for certain
81 // barrier types. Semantically, it should be thought of as a call to the 81 // barrier types. Semantically, it should be thought of as a call to the
82 // virtual "_work" function below, which must implement the barrier.) 82 // virtual "_work" function below, which must implement the barrier.)
83 // First the pre-write versions... 83 // First the pre-write versions...
84 inline void write_ref_field_pre(void* field, oop new_val); 84 template <class T> inline void write_ref_field_pre(T* field, oop new_val);
85 private:
86 // Keep this private so as to catch violations at build time.
87 virtual void write_ref_field_pre_work( void* field, oop new_val) { guarantee(false, "Not needed"); };
85 protected: 88 protected:
86 virtual void write_ref_field_pre_work(void* field, oop new_val) {}; 89 virtual void write_ref_field_pre_work( oop* field, oop new_val) {};
90 virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) {};
87 public: 91 public:
88 92
89 // ...then the post-write version. 93 // ...then the post-write version.
90 inline void write_ref_field(void* field, oop new_val); 94 inline void write_ref_field(void* field, oop new_val);
91 protected: 95 protected:
115 // above returns true. Otherwise, they should perform an appropriate 119 // above returns true. Otherwise, they should perform an appropriate
116 // barrier for an array whose elements are all in the given memory region. 120 // barrier for an array whose elements are all in the given memory region.
117 virtual void read_ref_array(MemRegion mr) = 0; 121 virtual void read_ref_array(MemRegion mr) = 0;
118 virtual void read_prim_array(MemRegion mr) = 0; 122 virtual void read_prim_array(MemRegion mr) = 0;
119 123
120 virtual void write_ref_array_pre(MemRegion mr) {} 124 virtual void write_ref_array_pre( oop* dst, int length) {}
125 virtual void write_ref_array_pre(narrowOop* dst, int length) {}
121 inline void write_ref_array(MemRegion mr); 126 inline void write_ref_array(MemRegion mr);
122 127
123 // Static versions, suitable for calling from generated code. 128 // Static versions, suitable for calling from generated code.
124 static void static_write_ref_array_pre(HeapWord* start, size_t count); 129 static void static_write_ref_array_pre(HeapWord* start, size_t count);
125 static void static_write_ref_array_post(HeapWord* start, size_t count); 130 static void static_write_ref_array_post(HeapWord* start, size_t count);
131 // Narrow oop versions of the above; count is # of array elements being written,
132 // starting with "start", which is HeapWord-aligned.
133 static void static_write_ref_array_pre_narrow(HeapWord* start, size_t count);
134 static void static_write_ref_array_post_narrow(HeapWord* start, size_t count);
126 135
127 protected: 136 protected:
128 virtual void write_ref_array_work(MemRegion mr) = 0; 137 virtual void write_ref_array_work(MemRegion mr) = 0;
129 public: 138 public:
130 virtual void write_prim_array(MemRegion mr) = 0; 139 virtual void write_prim_array(MemRegion mr) = 0;

mercurial