Mercurial > hg > truffle
comparison src/share/vm/memory/barrierSet.hpp @ 1091:6aa7255741f3
6906727: UseCompressedOops: some card-marking fixes related to object arrays
Summary: Introduced a new write_ref_array(HeapWords* start, size_t count) method that does the requisite MemRegion range calculation so (some of the) clients of the erstwhile write_ref_array(MemRegion mr) do not need to worry. This removed all external uses of array_size(), which was also simplified and made private. Asserts were added to catch other possible issues. Further, less essential, fixes stemming from this investigation are deferred to CR 6904516 (to follow shortly in hs17).
Reviewed-by: kvn, coleenp, jmasa
author | ysr |
---|---|
date | Thu, 03 Dec 2009 15:01:57 -0800 |
parents | df6caf649ff7 |
children | 6484c4ee11cb |
comparison
equal
deleted
inserted
replaced
1090:fa357420e7d2 | 1091:6aa7255741f3 |
---|---|
119 // above returns true. Otherwise, they should perform an appropriate | 119 // above returns true. Otherwise, they should perform an appropriate |
120 // 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. |
121 virtual void read_ref_array(MemRegion mr) = 0; | 121 virtual void read_ref_array(MemRegion mr) = 0; |
122 virtual void read_prim_array(MemRegion mr) = 0; | 122 virtual void read_prim_array(MemRegion mr) = 0; |
123 | 123 |
124 // Below length is the # array elements being written | |
124 virtual void write_ref_array_pre( oop* dst, int length) {} | 125 virtual void write_ref_array_pre( oop* dst, int length) {} |
125 virtual void write_ref_array_pre(narrowOop* dst, int length) {} | 126 virtual void write_ref_array_pre(narrowOop* dst, int length) {} |
127 // Below MemRegion mr is expected to be HeapWord-aligned | |
126 inline void write_ref_array(MemRegion mr); | 128 inline void write_ref_array(MemRegion mr); |
129 // Below count is the # array elements being written, starting | |
130 // at the address "start", which may not necessarily be HeapWord-aligned | |
131 inline void write_ref_array(HeapWord* start, size_t count); | |
127 | 132 |
128 // Static versions, suitable for calling from generated code. | 133 // Static versions, suitable for calling from generated code; |
134 // count is # array elements being written, starting with "start", | |
135 // which may not necessarily be HeapWord-aligned. | |
129 static void static_write_ref_array_pre(HeapWord* start, size_t count); | 136 static void static_write_ref_array_pre(HeapWord* start, size_t count); |
130 static void static_write_ref_array_post(HeapWord* start, size_t count); | 137 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); | |
135 | 138 |
136 protected: | 139 protected: |
137 virtual void write_ref_array_work(MemRegion mr) = 0; | 140 virtual void write_ref_array_work(MemRegion mr) = 0; |
138 public: | 141 public: |
139 virtual void write_prim_array(MemRegion mr) = 0; | 142 virtual void write_prim_array(MemRegion mr) = 0; |