52 virtual bool has_write_ref_barrier() = 0; |
52 virtual bool has_write_ref_barrier() = 0; |
53 virtual bool has_write_prim_barrier() = 0; |
53 virtual bool has_write_prim_barrier() = 0; |
54 |
54 |
55 // These functions indicate whether a particular access of the given |
55 // These functions indicate whether a particular access of the given |
56 // kinds requires a barrier. |
56 // kinds requires a barrier. |
57 virtual bool read_ref_needs_barrier(oop* field) = 0; |
57 virtual bool read_ref_needs_barrier(void* field) = 0; |
58 virtual bool read_prim_needs_barrier(HeapWord* field, size_t bytes) = 0; |
58 virtual bool read_prim_needs_barrier(HeapWord* field, size_t bytes) = 0; |
59 virtual bool write_ref_needs_barrier(oop* field, oop new_val) = 0; |
59 virtual bool write_ref_needs_barrier(void* field, oop new_val) = 0; |
60 virtual bool write_prim_needs_barrier(HeapWord* field, size_t bytes, juint val1, juint val2) = 0; |
60 virtual bool write_prim_needs_barrier(HeapWord* field, size_t bytes, juint val1, juint val2) = 0; |
61 |
61 |
62 // The first four operations provide a direct implementation of the |
62 // The first four operations provide a direct implementation of the |
63 // barrier set. An interpreter loop, for example, could call these |
63 // barrier set. An interpreter loop, for example, could call these |
64 // directly, as appropriate. |
64 // directly, as appropriate. |
65 |
65 |
66 // Invoke the barrier, if any, necessary when reading the given ref field. |
66 // Invoke the barrier, if any, necessary when reading the given ref field. |
67 virtual void read_ref_field(oop* field) = 0; |
67 virtual void read_ref_field(void* field) = 0; |
68 |
68 |
69 // Invoke the barrier, if any, necessary when reading the given primitive |
69 // Invoke the barrier, if any, necessary when reading the given primitive |
70 // "field" of "bytes" bytes in "obj". |
70 // "field" of "bytes" bytes in "obj". |
71 virtual void read_prim_field(HeapWord* field, size_t bytes) = 0; |
71 virtual void read_prim_field(HeapWord* field, size_t bytes) = 0; |
72 |
72 |
73 // Invoke the barrier, if any, necessary when writing "new_val" into the |
73 // Invoke the barrier, if any, necessary when writing "new_val" into the |
74 // ref field at "offset" in "obj". |
74 // ref field at "offset" in "obj". |
75 // (For efficiency reasons, this operation is specialized for certain |
75 // (For efficiency reasons, this operation is specialized for certain |
76 // barrier types. Semantically, it should be thought of as a call to the |
76 // barrier types. Semantically, it should be thought of as a call to the |
77 // virtual "_work" function below, which must implement the barrier.) |
77 // virtual "_work" function below, which must implement the barrier.) |
78 inline void write_ref_field(oop* field, oop new_val); |
78 inline void write_ref_field(void* field, oop new_val); |
79 protected: |
79 protected: |
80 virtual void write_ref_field_work(oop* field, oop new_val) = 0; |
80 virtual void write_ref_field_work(void* field, oop new_val) = 0; |
81 public: |
81 public: |
82 |
82 |
83 // Invoke the barrier, if any, necessary when writing the "bytes"-byte |
83 // Invoke the barrier, if any, necessary when writing the "bytes"-byte |
84 // value(s) "val1" (and "val2") into the primitive "field". |
84 // value(s) "val1" (and "val2") into the primitive "field". |
85 virtual void write_prim_field(HeapWord* field, size_t bytes, |
85 virtual void write_prim_field(HeapWord* field, size_t bytes, |