2525#include " jvm.h"
2626#include " asm/codeBuffer.hpp"
2727#include " classfile/javaClasses.inline.hpp"
28+ #include " classfile/moduleEntry.hpp"
2829#include " code/codeCache.hpp"
2930#include " code/compiledMethod.inline.hpp"
3031#include " compiler/compileBroker.hpp"
6061#endif
6162
6263jobject JVMCIRuntime::_HotSpotJVMCIRuntime_instance = NULL ;
63- bool JVMCIRuntime::_HotSpotJVMCIRuntime_initialized = false ;
6464bool JVMCIRuntime::_well_known_classes_initialized = false ;
65- JVMCIRuntime::CompLevelAdjustment JVMCIRuntime::_comp_level_adjustment = JVMCIRuntime::none;
6665bool JVMCIRuntime::_shutdown_called = false ;
6766
6867BasicType JVMCIRuntime::kindToBasicType (Handle kind, TRAPS) {
@@ -740,7 +739,7 @@ Handle JVMCIRuntime::get_HotSpotJVMCIRuntime(TRAPS) {
740739}
741740
742741void JVMCIRuntime::initialize_HotSpotJVMCIRuntime (TRAPS) {
743- guarantee (!_HotSpotJVMCIRuntime_initialized , " cannot reinitialize HotSpotJVMCIRuntime" );
742+ guarantee (!is_HotSpotJVMCIRuntime_initialized () , " cannot reinitialize HotSpotJVMCIRuntime" );
744743 JVMCIRuntime::initialize_well_known_classes (CHECK);
745744 // This should only be called in the context of the JVMCI class being initialized
746745 InstanceKlass* klass = SystemDictionary::JVMCI_klass ();
@@ -750,12 +749,6 @@ void JVMCIRuntime::initialize_HotSpotJVMCIRuntime(TRAPS) {
750749 Handle result = callStatic (" jdk/vm/ci/hotspot/HotSpotJVMCIRuntime" ,
751750 " runtime" ,
752751 " ()Ljdk/vm/ci/hotspot/HotSpotJVMCIRuntime;" , NULL , CHECK);
753- int adjustment = HotSpotJVMCIRuntime::compilationLevelAdjustment (result);
754- assert (adjustment >= JVMCIRuntime::none &&
755- adjustment <= JVMCIRuntime::by_full_signature,
756- " compilation level adjustment out of bounds" );
757- _comp_level_adjustment = (CompLevelAdjustment) adjustment;
758- _HotSpotJVMCIRuntime_initialized = true ;
759752 _HotSpotJVMCIRuntime_instance = JNIHandles::make_global (result);
760753}
761754
@@ -765,7 +758,7 @@ void JVMCIRuntime::initialize_JVMCI(TRAPS) {
765758 " getRuntime" ,
766759 " ()Ljdk/vm/ci/runtime/JVMCIRuntime;" , NULL , CHECK);
767760 }
768- assert (_HotSpotJVMCIRuntime_initialized == true , " what?" );
761+ assert (is_HotSpotJVMCIRuntime_initialized () , " what?" );
769762}
770763
771764bool JVMCIRuntime::can_initialize_JVMCI () {
@@ -894,73 +887,6 @@ void JVMCIRuntime::shutdown(TRAPS) {
894887 }
895888}
896889
897- CompLevel JVMCIRuntime::adjust_comp_level_inner (const methodHandle& method, bool is_osr, CompLevel level, JavaThread* thread) {
898- JVMCICompiler* compiler = JVMCICompiler::instance (false , thread);
899- if (compiler != NULL && compiler->is_bootstrapping ()) {
900- return level;
901- }
902- if (!is_HotSpotJVMCIRuntime_initialized () || _comp_level_adjustment == JVMCIRuntime::none) {
903- // JVMCI cannot participate in compilation scheduling until
904- // JVMCI is initialized and indicates it wants to participate.
905- return level;
906- }
907-
908- #define CHECK_RETURN THREAD); \
909- if (HAS_PENDING_EXCEPTION) { \
910- Handle exception (THREAD, PENDING_EXCEPTION); \
911- CLEAR_PENDING_EXCEPTION; \
912- \
913- if (exception->is_a (SystemDictionary::ThreadDeath_klass ())) { \
914- /* In the special case of ThreadDeath, we need to reset the */ \
915- /* pending async exception so that it is propagated. */ \
916- thread->set_pending_async_exception (exception ()); \
917- return level; \
918- } \
919- tty->print (" Uncaught exception while adjusting compilation level: " ); \
920- java_lang_Throwable::print (exception (), tty); \
921- tty->cr (); \
922- java_lang_Throwable::print_stack_trace (exception, tty); \
923- if (HAS_PENDING_EXCEPTION) { \
924- CLEAR_PENDING_EXCEPTION; \
925- } \
926- return level; \
927- } \
928- (void )(0
929-
930-
931- Thread* THREAD = thread;
932- HandleMark hm;
933- Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime (CHECK_RETURN);
934- Handle name;
935- Handle sig;
936- if (_comp_level_adjustment == JVMCIRuntime::by_full_signature) {
937- name = java_lang_String::create_from_symbol (method->name (), CHECK_RETURN);
938- sig = java_lang_String::create_from_symbol (method->signature (), CHECK_RETURN);
939- } else {
940- name = Handle ();
941- sig = Handle ();
942- }
943-
944- JavaValue result (T_INT);
945- JavaCallArguments args;
946- args.push_oop (receiver);
947- args.push_oop (Handle (THREAD, method->method_holder ()->java_mirror ()));
948- args.push_oop (name);
949- args.push_oop (sig);
950- args.push_int (is_osr);
951- args.push_int (level);
952- JavaCalls::call_special (&result, receiver->klass (), vmSymbols::adjustCompilationLevel_name (),
953- vmSymbols::adjustCompilationLevel_signature (), &args, CHECK_RETURN);
954-
955- int comp_level = result.get_jint ();
956- if (comp_level < CompLevel_none || comp_level > CompLevel_full_optimization) {
957- assert (false , " compilation level out of bounds" );
958- return level;
959- }
960- return (CompLevel) comp_level;
961- #undef CHECK_RETURN
962- }
963-
964890void JVMCIRuntime::bootstrap_finished (TRAPS) {
965891 HandleMark hm (THREAD);
966892 Handle receiver = get_HotSpotJVMCIRuntime (CHECK);
0 commit comments