@@ -224,15 +224,15 @@ private static Object slowPathNewInstanceWithoutAllocating(DynamicHub hub) {
224224
225225 @ SubstrateForeignCallTarget (stubCallingConvention = false )
226226 private static Object slowPathNewArray (Word objectHeader , int length , int fillStartOffset ) {
227- return slowPathNewArrayImpl (objectHeader , length , fillStartOffset , null );
227+ return slowPathNewArrayOrPodImpl (objectHeader , length , fillStartOffset , null );
228228 }
229229
230230 @ SubstrateForeignCallTarget (stubCallingConvention = false )
231231 private static Object slowPathNewPodInstance (Word objectHeader , int arrayLength , int fillStartOffset , byte [] referenceMap ) {
232- return slowPathNewArrayImpl (objectHeader , arrayLength , fillStartOffset , referenceMap );
232+ return slowPathNewArrayOrPodImpl (objectHeader , arrayLength , fillStartOffset , referenceMap );
233233 }
234234
235- private static Object slowPathNewArrayImpl (Word objectHeader , int length , int fillStartOffset , byte [] podReferenceMap ) {
235+ private static Object slowPathNewArrayOrPodImpl (Word objectHeader , int length , int fillStartOffset , byte [] podReferenceMap ) {
236236 /*
237237 * Avoid stack overflow errors while producing memory chunks, because that could leave the
238238 * heap in an inconsistent state.
@@ -256,7 +256,7 @@ private static Object slowPathNewArrayImpl(Word objectHeader, int length, int fi
256256 throw OutOfMemoryUtil .reportOutOfMemoryError (outOfMemoryError );
257257 }
258258
259- Object result = slowPathNewArrayWithoutAllocating (hub , length , size , fillStartOffset , podReferenceMap );
259+ Object result = slowPathNewArrayOrPodWithoutAllocating (hub , length , size , fillStartOffset , podReferenceMap );
260260 runSlowPathHooks ();
261261 return result ;
262262 } finally {
@@ -265,26 +265,26 @@ private static Object slowPathNewArrayImpl(Word objectHeader, int length, int fi
265265 }
266266
267267 @ RestrictHeapAccess (access = RestrictHeapAccess .Access .NO_ALLOCATION , reason = "Must not allocate in the implementation of allocation." )
268- private static Object slowPathNewArrayWithoutAllocating (DynamicHub hub , int length , UnsignedWord size , int fillStartOffset , byte [] podReferenceMap ) {
268+ private static Object slowPathNewArrayOrPodWithoutAllocating (DynamicHub hub , int length , UnsignedWord size , int fillStartOffset , byte [] podReferenceMap ) {
269269 DeoptTester .disableDeoptTesting ();
270270 try {
271- HeapImpl .exitIfAllocationDisallowed ("ThreadLocalAllocation.slowPathNewArrayWithoutAllocating " , DynamicHub .toClass (hub ).getName ());
271+ HeapImpl .exitIfAllocationDisallowed ("ThreadLocalAllocation.slowPathNewArrayOrPodWithoutAllocating " , DynamicHub .toClass (hub ).getName ());
272272 GCImpl .getGCImpl ().maybeCollectOnAllocation ();
273273
274274 if (size .aboveOrEqual (HeapParameters .getLargeArrayThreshold ())) {
275275 /* Large arrays go into their own unaligned chunk. */
276276 boolean needsZeroing = !HeapChunkProvider .areUnalignedChunksZeroed ();
277277 UnalignedHeapChunk .UnalignedHeader newTlabChunk = HeapImpl .getChunkProvider ().produceUnalignedChunk (size );
278- return allocateLargeArrayInNewTlab (hub , length , size , fillStartOffset , newTlabChunk , needsZeroing , podReferenceMap );
278+ return allocateLargeArrayOrPodInNewTlab (hub , length , size , fillStartOffset , newTlabChunk , needsZeroing , podReferenceMap );
279279 }
280280 /* Small arrays go into the regular aligned chunk. */
281281
282282 // We might have allocated in the caller and acquired a TLAB with enough space already
283283 // (but we need to check in an uninterruptible method to be safe)
284- Object array = allocateSmallArrayInCurrentTlab (hub , length , size , fillStartOffset , podReferenceMap );
284+ Object array = allocateSmallArrayOrPodInCurrentTlab (hub , length , size , fillStartOffset , podReferenceMap );
285285 if (array == null ) { // We need a new chunk.
286286 AlignedHeader newTlabChunk = HeapImpl .getChunkProvider ().produceAlignedChunk ();
287- array = allocateSmallArrayInNewTlab (hub , length , size , fillStartOffset , newTlabChunk , podReferenceMap );
287+ array = allocateSmallArrayOrPodInNewTlab (hub , length , size , fillStartOffset , newTlabChunk , podReferenceMap );
288288 }
289289 return array ;
290290 } finally {
@@ -300,7 +300,7 @@ private static Object allocateInstanceInNewTlab(DynamicHub hub, AlignedHeader ne
300300 }
301301
302302 @ Uninterruptible (reason = "Holds uninitialized memory." )
303- private static Object allocateSmallArrayInCurrentTlab (DynamicHub hub , int length , UnsignedWord size , int fillStartOffset , byte [] podReferenceMap ) {
303+ private static Object allocateSmallArrayOrPodInCurrentTlab (DynamicHub hub , int length , UnsignedWord size , int fillStartOffset , byte [] podReferenceMap ) {
304304 if (size .aboveThan (availableTlabMemory (getTlab ()))) {
305305 return null ;
306306 }
@@ -309,13 +309,15 @@ private static Object allocateSmallArrayInCurrentTlab(DynamicHub hub, int length
309309 }
310310
311311 @ Uninterruptible (reason = "Holds uninitialized memory." )
312- private static Object allocateSmallArrayInNewTlab (DynamicHub hub , int length , UnsignedWord size , int fillStartOffset , AlignedHeader newTlabChunk , byte [] podReferenceMap ) {
312+ private static Object allocateSmallArrayOrPodInNewTlab (DynamicHub hub , int length , UnsignedWord size , int fillStartOffset , AlignedHeader newTlabChunk , byte [] podReferenceMap ) {
313313 Pointer memory = allocateRawMemoryInNewTlab (size , newTlabChunk );
314314 return formatArrayOrPod (memory , hub , length , false , FillContent .WITH_ZEROES , fillStartOffset , podReferenceMap );
315315 }
316316
317317 @ Uninterruptible (reason = "Holds uninitialized memory, modifies TLAB" )
318- private static Object allocateLargeArrayInNewTlab (DynamicHub hub , int length , UnsignedWord size , int fillStartOffset , UnalignedHeader newTlabChunk , boolean needsZeroing , byte [] podReferenceMap ) {
318+ private static Object allocateLargeArrayOrPodInNewTlab (DynamicHub hub , int length , UnsignedWord size , int fillStartOffset ,
319+ UnalignedHeader newTlabChunk , boolean needsZeroing , byte [] podReferenceMap ) {
320+
319321 ThreadLocalAllocation .Descriptor tlab = getTlab ();
320322
321323 HeapChunk .setNext (newTlabChunk , tlab .getUnalignedChunk ());
@@ -344,7 +346,7 @@ private static Object allocateLargeArrayInNewTlab(DynamicHub hub, int length, Un
344346 private static Object formatArrayOrPod (Pointer memory , DynamicHub hub , int length , boolean unaligned , FillContent fillContent , int fillStartOffset , byte [] podReferenceMap ) {
345347 Class <?> clazz = DynamicHub .toClass (hub );
346348 if (podReferenceMap != null ) {
347- return FormatPodNode .formatPod (memory , clazz , length , podReferenceMap , false , unaligned , fillStartOffset , true );
349+ return FormatPodNode .formatPod (memory , clazz , length , podReferenceMap , false , unaligned , fillContent , fillStartOffset , true );
348350 }
349351 return FormatArrayNode .formatArray (memory , clazz , length , false , unaligned , fillContent , fillStartOffset , true );
350352 }
0 commit comments