155 } |
155 } |
156 if (ZeroTLAB) { |
156 if (ZeroTLAB) { |
157 // ..and clear it. |
157 // ..and clear it. |
158 Copy::zero_to_words(obj, new_tlab_size); |
158 Copy::zero_to_words(obj, new_tlab_size); |
159 } else { |
159 } else { |
160 // ...and clear just the allocated object. |
160 // ...and zap just allocated object. |
161 Copy::zero_to_words(obj, size); |
161 #ifdef ASSERT |
|
162 // Skip mangling the space corresponding to the object header to |
|
163 // ensure that the returned space is not considered parsable by |
|
164 // any concurrent GC thread. |
|
165 size_t hdr_size = oopDesc::header_size(); |
|
166 Copy::fill_to_words(obj + hdr_size, new_tlab_size - hdr_size, badHeapWordVal); |
|
167 #endif // ASSERT |
162 } |
168 } |
163 thread->tlab().fill(obj, obj + size, new_tlab_size); |
169 thread->tlab().fill(obj, obj + size, new_tlab_size); |
164 return obj; |
170 return obj; |
165 } |
171 } |
166 |
172 |