src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
changeset 50689 070b5313b2fe
parent 49873 26ebfe8ce852
child 50858 2d3e99a72541
equal deleted inserted replaced
50688:992a1304517b 50689:070b5313b2fe
    33 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperLog2ElementSizeMask;
    33 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperLog2ElementSizeMask;
    34 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperLog2ElementSizeShift;
    34 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperLog2ElementSizeShift;
    35 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readLayoutHelper;
    35 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readLayoutHelper;
    36 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.registerAsWord;
    36 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.registerAsWord;
    37 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useCMSIncrementalMode;
    37 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useCMSIncrementalMode;
       
    38 import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useFastTLABRefill;
    38 import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH;
    39 import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH;
    39 import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.formatArray;
    40 import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.formatArray;
    40 import static org.graalvm.compiler.hotspot.stubs.NewInstanceStub.refillAllocate;
    41 import static org.graalvm.compiler.hotspot.stubs.NewInstanceStub.refillAllocate;
    41 import static org.graalvm.compiler.hotspot.stubs.StubUtil.handlePendingException;
    42 import static org.graalvm.compiler.hotspot.stubs.StubUtil.handlePendingException;
    42 import static org.graalvm.compiler.hotspot.stubs.StubUtil.newDescriptor;
    43 import static org.graalvm.compiler.hotspot.stubs.StubUtil.newDescriptor;
   120         }
   121         }
   121 
   122 
   122         // check that array length is small enough for fast path.
   123         // check that array length is small enough for fast path.
   123         Word thread = registerAsWord(threadRegister);
   124         Word thread = registerAsWord(threadRegister);
   124         boolean inlineContiguousAllocationSupported = GraalHotSpotVMConfigNode.inlineContiguousAllocationSupported();
   125         boolean inlineContiguousAllocationSupported = GraalHotSpotVMConfigNode.inlineContiguousAllocationSupported();
   125         if (inlineContiguousAllocationSupported && !useCMSIncrementalMode(INJECTED_VMCONFIG) && length >= 0 && length <= MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH) {
   126         if (useFastTLABRefill(INJECTED_VMCONFIG) && inlineContiguousAllocationSupported && !useCMSIncrementalMode(INJECTED_VMCONFIG) && length >= 0 &&
       
   127                         length <= MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH) {
   126             Word memory = refillAllocate(thread, intArrayHub, sizeInBytes, logging(options));
   128             Word memory = refillAllocate(thread, intArrayHub, sizeInBytes, logging(options));
   127             if (memory.notEqual(0)) {
   129             if (memory.notEqual(0)) {
   128                 if (logging(options)) {
   130                 if (logging(options)) {
   129                     printf("newArray: allocated new array at %p\n", memory.rawValue());
   131                     printf("newArray: allocated new array at %p\n", memory.rawValue());
   130                 }
   132                 }