83 // Invoke the barrier, if any, necessary when reading the given primitive
84 // "field" of "bytes" bytes in "obj".
85 virtual void read_prim_field(HeapWord* field, size_t bytes) = 0;
86
87 // Invoke the barrier, if any, necessary when writing "new_val" into the
88 // ref field at "offset" in "obj".
89 // (For efficiency reasons, this operation is specialized for certain
90 // barrier types. Semantically, it should be thought of as a call to the
91 // virtual "_work" function below, which must implement the barrier.)
92 // First the pre-write versions...
93 template <class T> inline void write_ref_field_pre(T* field, oop new_val);
94 private:
95 // Keep this private so as to catch violations at build time.
96 virtual void write_ref_field_pre_work( void* field, oop new_val) { guarantee(false, "Not needed"); };
97 protected:
98 virtual void write_ref_field_pre_work( oop* field, oop new_val) {};
99 virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) {};
100 public:
101
102 // ...then the post-write version.
103 inline void write_ref_field(void* field, oop new_val);
104 protected:
105 virtual void write_ref_field_work(void* field, oop new_val) = 0;
106 public:
107
108 // Invoke the barrier, if any, necessary when writing the "bytes"-byte
109 // value(s) "val1" (and "val2") into the primitive "field".
110 virtual void write_prim_field(HeapWord* field, size_t bytes,
111 juint val1, juint val2) = 0;
112
113 // Operations on arrays, or general regions (e.g., for "clone") may be
114 // optimized by some barriers.
115
116 // The first six operations tell whether such an optimization exists for
117 // the particular barrier.
118 virtual bool has_read_ref_array_opt() = 0;
119 virtual bool has_read_prim_array_opt() = 0;
120 virtual bool has_write_ref_array_pre_opt() { return true; }
121 virtual bool has_write_ref_array_opt() = 0;
122 virtual bool has_write_prim_array_opt() = 0;
123
124 virtual bool has_read_region_opt() = 0;
125 virtual bool has_write_region_opt() = 0;
|
83 // Invoke the barrier, if any, necessary when reading the given primitive
84 // "field" of "bytes" bytes in "obj".
85 virtual void read_prim_field(HeapWord* field, size_t bytes) = 0;
86
87 // Invoke the barrier, if any, necessary when writing "new_val" into the
88 // ref field at "offset" in "obj".
89 // (For efficiency reasons, this operation is specialized for certain
90 // barrier types. Semantically, it should be thought of as a call to the
91 // virtual "_work" function below, which must implement the barrier.)
92 // First the pre-write versions...
93 template <class T> inline void write_ref_field_pre(T* field, oop new_val);
94 private:
95 // Keep this private so as to catch violations at build time.
96 virtual void write_ref_field_pre_work( void* field, oop new_val) { guarantee(false, "Not needed"); };
97 protected:
98 virtual void write_ref_field_pre_work( oop* field, oop new_val) {};
99 virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) {};
100 public:
101
102 // ...then the post-write version.
103 inline void write_ref_field(void* field, oop new_val, bool release = false);
104 protected:
105 virtual void write_ref_field_work(void* field, oop new_val, bool release = false) = 0;
106 public:
107
108 // Invoke the barrier, if any, necessary when writing the "bytes"-byte
109 // value(s) "val1" (and "val2") into the primitive "field".
110 virtual void write_prim_field(HeapWord* field, size_t bytes,
111 juint val1, juint val2) = 0;
112
113 // Operations on arrays, or general regions (e.g., for "clone") may be
114 // optimized by some barriers.
115
116 // The first six operations tell whether such an optimization exists for
117 // the particular barrier.
118 virtual bool has_read_ref_array_opt() = 0;
119 virtual bool has_read_prim_array_opt() = 0;
120 virtual bool has_write_ref_array_pre_opt() { return true; }
121 virtual bool has_write_ref_array_opt() = 0;
122 virtual bool has_write_prim_array_opt() = 0;
123
124 virtual bool has_read_region_opt() = 0;
125 virtual bool has_write_region_opt() = 0;
|