< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java

Print this page




 549     @Fold
 550     public static int arrayLengthOffset(@InjectedParameter GraalHotSpotVMConfig config) {
 551         return config.arrayOopDescLengthOffset();
 552     }
 553 
 554     @Fold
 555     public static int arrayBaseOffset(JavaKind elementKind) {
 556         return getArrayBaseOffset(elementKind);
 557     }
 558 
 559     @Fold
 560     public static int arrayIndexScale(JavaKind elementKind) {
 561         return getArrayIndexScale(elementKind);
 562     }
 563 
 564     public static Word arrayStart(int[] a) {
 565         return WordFactory.unsigned(ComputeObjectAddressNode.get(a, getArrayBaseOffset(JavaKind.Int)));
 566     }
 567 
 568     @Fold






















 569     public static int instanceHeaderSize(@InjectedParameter GraalHotSpotVMConfig config) {
 570         return config.useCompressedClassPointers ? (2 * wordSize()) - 4 : 2 * wordSize();
 571     }
 572 
 573     @Fold
 574     public static byte dirtyCardValue(@InjectedParameter GraalHotSpotVMConfig config) {
 575         return config.dirtyCardValue;
 576     }
 577 
 578     @Fold
 579     public static byte g1YoungCardValue(@InjectedParameter GraalHotSpotVMConfig config) {
 580         return config.g1YoungCardValue;
 581     }
 582 
 583     @Fold
 584     public static int cardTableShift(@InjectedParameter GraalHotSpotVMConfig config) {
 585         return config.cardtableShift;
 586     }
 587 
 588     @Fold




 549     @Fold
 550     public static int arrayLengthOffset(@InjectedParameter GraalHotSpotVMConfig config) {
 551         return config.arrayOopDescLengthOffset();
 552     }
 553 
 554     @Fold
 555     public static int arrayBaseOffset(JavaKind elementKind) {
 556         return getArrayBaseOffset(elementKind);
 557     }
 558 
 559     @Fold
 560     public static int arrayIndexScale(JavaKind elementKind) {
 561         return getArrayIndexScale(elementKind);
 562     }
 563 
 564     public static Word arrayStart(int[] a) {
 565         return WordFactory.unsigned(ComputeObjectAddressNode.get(a, getArrayBaseOffset(JavaKind.Int)));
 566     }
 567 
 568     @Fold
 569     public static int objectAlignment(@InjectedParameter GraalHotSpotVMConfig config) {
 570         return config.objectAlignment;
 571     }
 572 
 573     /**
 574      * Computes the size of the memory chunk allocated for an array. This size accounts for the
 575      * array header size, body size and any padding after the last element to satisfy object
 576      * alignment requirements.
 577      *
 578      * @param length the number of elements in the array
 579      * @param headerSize the size of the array header
 580      * @param log2ElementSize log2 of the size of an element in the array
 581      * @return the size of the memory chunk
 582      */
 583     public static int arrayAllocationSize(int length, int headerSize, int log2ElementSize) {
 584         int alignment = objectAlignment(INJECTED_VMCONFIG);
 585         int size = (length << log2ElementSize) + headerSize + (alignment - 1);
 586         int mask = ~(alignment - 1);
 587         return size & mask;
 588     }
 589 
 590     @Fold
 591     public static int instanceHeaderSize(@InjectedParameter GraalHotSpotVMConfig config) {
 592         return config.useCompressedClassPointers ? (2 * wordSize()) - 4 : 2 * wordSize();
 593     }
 594 
 595     @Fold
 596     public static byte dirtyCardValue(@InjectedParameter GraalHotSpotVMConfig config) {
 597         return config.dirtyCardValue;
 598     }
 599 
 600     @Fold
 601     public static byte g1YoungCardValue(@InjectedParameter GraalHotSpotVMConfig config) {
 602         return config.g1YoungCardValue;
 603     }
 604 
 605     @Fold
 606     public static int cardTableShift(@InjectedParameter GraalHotSpotVMConfig config) {
 607         return config.cardtableShift;
 608     }
 609 
 610     @Fold


< prev index next >