src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
changeset 52033 d6aa9ea2405d
parent 51436 091c0d22e735
child 52578 7dd81e82d083
equal deleted inserted replaced
52032:2f7a2e7c3221 52033:d6aa9ea2405d
   646     public final long checkcastArraycopy = getFieldValue("StubRoutines::_checkcast_arraycopy", Long.class, "address");
   646     public final long checkcastArraycopy = getFieldValue("StubRoutines::_checkcast_arraycopy", Long.class, "address");
   647     public final long checkcastArraycopyUninit = getFieldValue("StubRoutines::_checkcast_arraycopy_uninit", Long.class, "address");
   647     public final long checkcastArraycopyUninit = getFieldValue("StubRoutines::_checkcast_arraycopy_uninit", Long.class, "address");
   648     public final long unsafeArraycopy = getFieldValue("StubRoutines::_unsafe_arraycopy", Long.class, "address");
   648     public final long unsafeArraycopy = getFieldValue("StubRoutines::_unsafe_arraycopy", Long.class, "address");
   649     public final long genericArraycopy = getFieldValue("StubRoutines::_generic_arraycopy", Long.class, "address");
   649     public final long genericArraycopy = getFieldValue("StubRoutines::_generic_arraycopy", Long.class, "address");
   650 
   650 
       
   651     // Allocation stubs that throw an exception when allocation fails
   651     public final long newInstanceAddress = getAddress("JVMCIRuntime::new_instance");
   652     public final long newInstanceAddress = getAddress("JVMCIRuntime::new_instance");
   652     public final long newArrayAddress = getAddress("JVMCIRuntime::new_array");
   653     public final long newArrayAddress = getAddress("JVMCIRuntime::new_array");
   653     public final long newMultiArrayAddress = getAddress("JVMCIRuntime::new_multi_array");
   654     public final long newMultiArrayAddress = getAddress("JVMCIRuntime::new_multi_array");
   654     public final long dynamicNewArrayAddress = getAddress("JVMCIRuntime::dynamic_new_array");
   655 
   655     public final long dynamicNewInstanceAddress = getAddress("JVMCIRuntime::dynamic_new_instance");
   656     // Allocation stubs that return null when allocation fails
       
   657     public final long newInstanceOrNullAddress = getAddress("JVMCIRuntime::new_instance_or_null", 0L);
       
   658     public final long newArrayOrNullAddress = getAddress("JVMCIRuntime::new_array_or_null", 0L);
       
   659     public final long newMultiArrayOrNullAddress = getAddress("JVMCIRuntime::new_multi_array_or_null", 0L);
       
   660 
       
   661     public boolean areNullAllocationStubsAvailable() {
       
   662         return newInstanceOrNullAddress != 0L;
       
   663     }
       
   664 
       
   665     /**
       
   666      * Checks that HotSpot implements all or none of the allocate-or-null stubs.
       
   667      */
       
   668     private boolean checkNullAllocationStubs() {
       
   669         if (newInstanceOrNullAddress == 0L) {
       
   670             assert newArrayOrNullAddress == 0L;
       
   671             assert newMultiArrayOrNullAddress == 0L;
       
   672         } else {
       
   673             assert newArrayOrNullAddress != 0L;
       
   674             assert newMultiArrayOrNullAddress != 0L;
       
   675         }
       
   676         return true;
       
   677     }
   656 
   678 
   657     public final long threadIsInterruptedAddress = getAddress("JVMCIRuntime::thread_is_interrupted");
   679     public final long threadIsInterruptedAddress = getAddress("JVMCIRuntime::thread_is_interrupted");
   658     public final long vmMessageAddress = getAddress("JVMCIRuntime::vm_message");
   680     public final long vmMessageAddress = getAddress("JVMCIRuntime::vm_message");
   659     public final long identityHashCodeAddress = getAddress("JVMCIRuntime::identity_hash_code");
   681     public final long identityHashCodeAddress = getAddress("JVMCIRuntime::identity_hash_code");
   660     public final long exceptionHandlerForPcAddress = getAddress("JVMCIRuntime::exception_handler_for_pc");
   682     public final long exceptionHandlerForPcAddress = getAddress("JVMCIRuntime::exception_handler_for_pc");
   755                 assert Modifier.isFinal(modifiers) : "field should be final: " + f;
   777                 assert Modifier.isFinal(modifiers) : "field should be final: " + f;
   756             }
   778             }
   757         }
   779         }
   758 
   780 
   759         assert codeEntryAlignment > 0 : codeEntryAlignment;
   781         assert codeEntryAlignment > 0 : codeEntryAlignment;
       
   782         assert checkNullAllocationStubs();
   760         return true;
   783         return true;
   761     }
   784     }
   762 }
   785 }