< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java

Print this page

        

*** 21,30 **** --- 21,31 ---- * questions. */ package org.graalvm.compiler.hotspot.stubs; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; + import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayAllocationSize; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayPrototypeMarkWord; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getAndClearObjectResult; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperElementTypeMask; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperElementTypeShift; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperHeaderSizeMask;
*** 32,50 **** import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperLog2ElementSizeMask; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperLog2ElementSizeShift; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readLayoutHelper; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.registerAsWord; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useCMSIncrementalMode; - import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.wordSize; import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH; import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.formatArray; import static org.graalvm.compiler.hotspot.stubs.NewInstanceStub.refillAllocate; import static org.graalvm.compiler.hotspot.stubs.StubUtil.handlePendingException; import static org.graalvm.compiler.hotspot.stubs.StubUtil.newDescriptor; import static org.graalvm.compiler.hotspot.stubs.StubUtil.printf; import static org.graalvm.compiler.hotspot.stubs.StubUtil.verifyObject; - import static jdk.vm.ci.hotspot.HotSpotMetaAccessProvider.computeArrayAllocationSize; import org.graalvm.compiler.api.replacements.Fold; import org.graalvm.compiler.api.replacements.Snippet; import org.graalvm.compiler.api.replacements.Snippet.ConstantParameter; import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; --- 33,49 ----
*** 110,120 **** @ConstantParameter OptionValues options) { int layoutHelper = readLayoutHelper(hub); int log2ElementSize = (layoutHelper >> layoutHelperLog2ElementSizeShift(INJECTED_VMCONFIG)) & layoutHelperLog2ElementSizeMask(INJECTED_VMCONFIG); int headerSize = (layoutHelper >> layoutHelperHeaderSizeShift(INJECTED_VMCONFIG)) & layoutHelperHeaderSizeMask(INJECTED_VMCONFIG); int elementKind = (layoutHelper >> layoutHelperElementTypeShift(INJECTED_VMCONFIG)) & layoutHelperElementTypeMask(INJECTED_VMCONFIG); ! int sizeInBytes = computeArrayAllocationSize(length, wordSize(), headerSize, log2ElementSize); if (logging(options)) { printf("newArray: element kind %d\n", elementKind); printf("newArray: array length %d\n", length); printf("newArray: array size %d\n", sizeInBytes); printf("newArray: hub=%p\n", hub.asWord().rawValue()); --- 109,119 ---- @ConstantParameter OptionValues options) { int layoutHelper = readLayoutHelper(hub); int log2ElementSize = (layoutHelper >> layoutHelperLog2ElementSizeShift(INJECTED_VMCONFIG)) & layoutHelperLog2ElementSizeMask(INJECTED_VMCONFIG); int headerSize = (layoutHelper >> layoutHelperHeaderSizeShift(INJECTED_VMCONFIG)) & layoutHelperHeaderSizeMask(INJECTED_VMCONFIG); int elementKind = (layoutHelper >> layoutHelperElementTypeShift(INJECTED_VMCONFIG)) & layoutHelperElementTypeMask(INJECTED_VMCONFIG); ! int sizeInBytes = arrayAllocationSize(length, headerSize, log2ElementSize); if (logging(options)) { printf("newArray: element kind %d\n", elementKind); printf("newArray: array length %d\n", length); printf("newArray: array size %d\n", sizeInBytes); printf("newArray: hub=%p\n", hub.asWord().rawValue());
< prev index next >