< prev index next >

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

Print this page




1001 C2V_END
1002 
1003 C2V_VMENTRY(void, setNotInlineableOrCompileable,(JNIEnv *, jobject,  jobject jvmci_method))
1004   methodHandle method = CompilerToVM::asMethod(jvmci_method);
1005   method->set_not_c1_compilable();
1006   method->set_not_c2_compilable();
1007   method->set_dont_inline(true);
1008 C2V_END
1009 
1010 C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject installed_code, jobject speculation_log))
1011   ResourceMark rm;
1012   HandleMark hm;
1013   JNIHandleMark jni_hm;
1014 
1015   Handle target_handle(THREAD, JNIHandles::resolve(target));
1016   Handle compiled_code_handle(THREAD, JNIHandles::resolve(compiled_code));
1017   CodeBlob* cb = NULL;
1018   Handle installed_code_handle(THREAD, JNIHandles::resolve(installed_code));
1019   Handle speculation_log_handle(THREAD, JNIHandles::resolve(speculation_log));
1020 
1021   JVMCICompiler* compiler = JVMCICompiler::instance(CHECK_JNI_ERR);
1022 
1023   TraceTime install_time("installCode", JVMCICompiler::codeInstallTimer());
1024   bool is_immutable_PIC = HotSpotCompiledCode::isImmutablePIC(compiled_code_handle) > 0;
1025   CodeInstaller installer(is_immutable_PIC);
1026   JVMCIEnv::CodeInstallResult result = installer.install(compiler, target_handle, compiled_code_handle, cb, installed_code_handle, speculation_log_handle, CHECK_0);
1027 
1028   if (PrintCodeCacheOnCompilation) {
1029     stringStream s;
1030     // Dump code cache  into a buffer before locking the tty,
1031     {
1032       MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1033       CodeCache::print_summary(&s, false);
1034     }
1035     ttyLocker ttyl;
1036     tty->print_raw_cr(s.as_string());
1037   }
1038 
1039   if (result != JVMCIEnv::ok) {
1040     assert(cb == NULL, "should be");
1041   } else {


1126     if (element == NULL) {
1127       return JVMCIEnv::cache_full;
1128     }
1129     metadataArrayHandle->obj_at_put(i, JNIHandles::resolve(element));
1130   }
1131   HotSpotMetaData::set_metadata(metadata_handle, metadataArrayHandle());
1132 
1133   ExceptionHandlerTable* handler = code_metadata.get_exception_table();
1134   int table_size = handler->size_in_bytes();
1135   typeArrayHandle exceptionArrayOop = oopFactory::new_byteArray_handle(table_size, CHECK_(JVMCIEnv::cache_full));
1136 
1137   if (table_size > 0) {
1138     handler->copy_bytes_to((address) exceptionArrayOop->byte_at_addr(0));
1139   }
1140   HotSpotMetaData::set_exceptionBytes(metadata_handle, exceptionArrayOop());
1141 
1142   return result;
1143 C2V_END
1144 
1145 C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv *jniEnv, jobject))
1146   JVMCICompiler* compiler = JVMCICompiler::instance(CHECK);
1147   CompilerStatistics* stats = compiler->stats();
1148   stats->_standard.reset();
1149   stats->_osr.reset();
1150 C2V_END
1151 
1152 C2V_VMENTRY(jobject, disassembleCodeBlob, (JNIEnv *jniEnv, jobject, jobject installedCode))
1153   ResourceMark rm;
1154   HandleMark hm;
1155 
1156   if (installedCode == NULL) {
1157     THROW_MSG_NULL(vmSymbols::java_lang_NullPointerException(), "installedCode is null");
1158   }
1159 
1160   jlong codeBlob = InstalledCode::address(installedCode);
1161   if (codeBlob == 0L) {
1162     return NULL;
1163   }
1164 
1165   CodeBlob* cb = (CodeBlob*) (address) codeBlob;
1166   if (cb == NULL) {




1001 C2V_END
1002 
1003 C2V_VMENTRY(void, setNotInlineableOrCompileable,(JNIEnv *, jobject,  jobject jvmci_method))
1004   methodHandle method = CompilerToVM::asMethod(jvmci_method);
1005   method->set_not_c1_compilable();
1006   method->set_not_c2_compilable();
1007   method->set_dont_inline(true);
1008 C2V_END
1009 
1010 C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject installed_code, jobject speculation_log))
1011   ResourceMark rm;
1012   HandleMark hm;
1013   JNIHandleMark jni_hm;
1014 
1015   Handle target_handle(THREAD, JNIHandles::resolve(target));
1016   Handle compiled_code_handle(THREAD, JNIHandles::resolve(compiled_code));
1017   CodeBlob* cb = NULL;
1018   Handle installed_code_handle(THREAD, JNIHandles::resolve(installed_code));
1019   Handle speculation_log_handle(THREAD, JNIHandles::resolve(speculation_log));
1020 
1021   JVMCICompiler* compiler = JVMCICompiler::instance(true, CHECK_JNI_ERR);
1022 
1023   TraceTime install_time("installCode", JVMCICompiler::codeInstallTimer());
1024   bool is_immutable_PIC = HotSpotCompiledCode::isImmutablePIC(compiled_code_handle) > 0;
1025   CodeInstaller installer(is_immutable_PIC);
1026   JVMCIEnv::CodeInstallResult result = installer.install(compiler, target_handle, compiled_code_handle, cb, installed_code_handle, speculation_log_handle, CHECK_0);
1027 
1028   if (PrintCodeCacheOnCompilation) {
1029     stringStream s;
1030     // Dump code cache  into a buffer before locking the tty,
1031     {
1032       MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1033       CodeCache::print_summary(&s, false);
1034     }
1035     ttyLocker ttyl;
1036     tty->print_raw_cr(s.as_string());
1037   }
1038 
1039   if (result != JVMCIEnv::ok) {
1040     assert(cb == NULL, "should be");
1041   } else {


1126     if (element == NULL) {
1127       return JVMCIEnv::cache_full;
1128     }
1129     metadataArrayHandle->obj_at_put(i, JNIHandles::resolve(element));
1130   }
1131   HotSpotMetaData::set_metadata(metadata_handle, metadataArrayHandle());
1132 
1133   ExceptionHandlerTable* handler = code_metadata.get_exception_table();
1134   int table_size = handler->size_in_bytes();
1135   typeArrayHandle exceptionArrayOop = oopFactory::new_byteArray_handle(table_size, CHECK_(JVMCIEnv::cache_full));
1136 
1137   if (table_size > 0) {
1138     handler->copy_bytes_to((address) exceptionArrayOop->byte_at_addr(0));
1139   }
1140   HotSpotMetaData::set_exceptionBytes(metadata_handle, exceptionArrayOop());
1141 
1142   return result;
1143 C2V_END
1144 
1145 C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv *jniEnv, jobject))
1146   JVMCICompiler* compiler = JVMCICompiler::instance(true, CHECK);
1147   CompilerStatistics* stats = compiler->stats();
1148   stats->_standard.reset();
1149   stats->_osr.reset();
1150 C2V_END
1151 
1152 C2V_VMENTRY(jobject, disassembleCodeBlob, (JNIEnv *jniEnv, jobject, jobject installedCode))
1153   ResourceMark rm;
1154   HandleMark hm;
1155 
1156   if (installedCode == NULL) {
1157     THROW_MSG_NULL(vmSymbols::java_lang_NullPointerException(), "installedCode is null");
1158   }
1159 
1160   jlong codeBlob = InstalledCode::address(installedCode);
1161   if (codeBlob == 0L) {
1162     return NULL;
1163   }
1164 
1165   CodeBlob* cb = (CodeBlob*) (address) codeBlob;
1166   if (cb == NULL) {


< prev index next >