Mercurial > hg > graal-jvmci-8
comparison src/share/vm/jvmci/jvmciCompilerToVM.cpp @ 22636:1ec4129907b3
made CompilerToVM package-private
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 29 Sep 2015 22:13:22 +0200 |
parents | c86a5e4c8725 |
children | 6b444ec119b8 |
comparison
equal
deleted
inserted
replaced
22635:353eb2b44df8 | 22636:1ec4129907b3 |
---|---|
560 InstanceKlass* klass = (InstanceKlass*) CompilerToVM::asKlass(jvmci_type); | 560 InstanceKlass* klass = (InstanceKlass*) CompilerToVM::asKlass(jvmci_type); |
561 oop result = CompilerToVM::get_jvmci_method(klass->class_initializer(), CHECK_NULL); | 561 oop result = CompilerToVM::get_jvmci_method(klass->class_initializer(), CHECK_NULL); |
562 return JNIHandles::make_local(THREAD, result); | 562 return JNIHandles::make_local(THREAD, result); |
563 C2V_END | 563 C2V_END |
564 | 564 |
565 C2V_VMENTRY(jlong, getMaxCallTargetOffsetImpl, (JNIEnv*, jobject, jlong addr)) | 565 C2V_VMENTRY(jlong, getMaxCallTargetOffset, (JNIEnv*, jobject, jlong addr)) |
566 address target_addr = (address) addr; | 566 address target_addr = (address) addr; |
567 if (target_addr != 0x0) { | 567 if (target_addr != 0x0) { |
568 int64_t off_low = (int64_t)target_addr - ((int64_t)CodeCache::low_bound() + sizeof(int)); | 568 int64_t off_low = (int64_t)target_addr - ((int64_t)CodeCache::low_bound() + sizeof(int)); |
569 int64_t off_high = (int64_t)target_addr - ((int64_t)CodeCache::high_bound() + sizeof(int)); | 569 int64_t off_high = (int64_t)target_addr - ((int64_t)CodeCache::high_bound() + sizeof(int)); |
570 return MAX2(ABS(off_low), ABS(off_high)); | 570 return MAX2(ABS(off_low), ABS(off_high)); |
577 method->set_not_c1_compilable(); | 577 method->set_not_c1_compilable(); |
578 method->set_not_c2_compilable(); | 578 method->set_not_c2_compilable(); |
579 method->set_dont_inline(true); | 579 method->set_dont_inline(true); |
580 C2V_END | 580 C2V_END |
581 | 581 |
582 C2V_VMENTRY(jint, installCodeImpl, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject installed_code, jobject speculation_log)) | 582 C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject installed_code, jobject speculation_log)) |
583 ResourceMark rm; | 583 ResourceMark rm; |
584 HandleMark hm; | 584 HandleMark hm; |
585 Handle target_handle = JNIHandles::resolve(target); | 585 Handle target_handle = JNIHandles::resolve(target); |
586 Handle compiled_code_handle = JNIHandles::resolve(compiled_code); | 586 Handle compiled_code_handle = JNIHandles::resolve(compiled_code); |
587 CodeBlob* cb = NULL; | 587 CodeBlob* cb = NULL; |
625 } | 625 } |
626 } | 626 } |
627 return result; | 627 return result; |
628 C2V_END | 628 C2V_END |
629 | 629 |
630 C2V_VMENTRY(void, notifyCompilationStatisticsImpl, (JNIEnv *jniEnv, jobject, jint id, jobject hotspot_method, jboolean osr, jint processedBytecodes, jlong time, jlong timeUnitsPerSecond, jobject installed_code)) | 630 C2V_VMENTRY(void, notifyCompilationStatistics, (JNIEnv *jniEnv, jobject, jint id, jobject hotspot_method, jboolean osr, jint processedBytecodes, jlong time, jlong timeUnitsPerSecond, jobject installed_code)) |
631 CompilerStatistics* stats = JVMCICompiler::instance()->stats(); | 631 CompilerStatistics* stats = JVMCICompiler::instance()->stats(); |
632 | 632 |
633 elapsedTimer timer = elapsedTimer(time, timeUnitsPerSecond); | 633 elapsedTimer timer = elapsedTimer(time, timeUnitsPerSecond); |
634 if (osr) { | 634 if (osr) { |
635 stats->_osr.update(timer, processedBytecodes); | 635 stats->_osr.update(timer, processedBytecodes); |
648 tty->print_cr("%3d seconds: %f bytes/sec: %f (bytes %d)", | 648 tty->print_cr("%3d seconds: %f bytes/sec: %f (bytes %d)", |
649 id, timer.seconds(), bytes_per_sec, processedBytecodes); | 649 id, timer.seconds(), bytes_per_sec, processedBytecodes); |
650 } | 650 } |
651 C2V_END | 651 C2V_END |
652 | 652 |
653 C2V_VMENTRY(void, resetCompilationStatisticsImpl, (JNIEnv *jniEnv, jobject)) | 653 C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv *jniEnv, jobject)) |
654 CompilerStatistics* stats = JVMCICompiler::instance()->stats(); | 654 CompilerStatistics* stats = JVMCICompiler::instance()->stats(); |
655 stats->_standard.reset(); | 655 stats->_standard.reset(); |
656 stats->_osr.reset(); | 656 stats->_osr.reset(); |
657 C2V_END | 657 C2V_END |
658 | 658 |
659 C2V_VMENTRY(jobject, disassembleCodeBlobImpl, (JNIEnv *jniEnv, jobject, jlong codeBlob)) | 659 C2V_VMENTRY(jobject, disassembleCodeBlob, (JNIEnv *jniEnv, jobject, jlong codeBlob)) |
660 ResourceMark rm; | 660 ResourceMark rm; |
661 HandleMark hm; | 661 HandleMark hm; |
662 | 662 |
663 CodeBlob* cb = (CodeBlob*) (address) codeBlob; | 663 CodeBlob* cb = (CodeBlob*) (address) codeBlob; |
664 if (cb == NULL) { | 664 if (cb == NULL) { |
808 method_data->initialize(); | 808 method_data->initialize(); |
809 } | 809 } |
810 C2V_END | 810 C2V_END |
811 | 811 |
812 | 812 |
813 C2V_VMENTRY(void, invalidateInstalledCodeImpl, (JNIEnv*, jobject, jobject hotspotInstalledCode)) | 813 C2V_VMENTRY(void, invalidateInstalledCode, (JNIEnv*, jobject, jobject hotspotInstalledCode)) |
814 jlong nativeMethod = InstalledCode::address(hotspotInstalledCode); | 814 jlong nativeMethod = InstalledCode::address(hotspotInstalledCode); |
815 nmethod* m = (nmethod*)nativeMethod; | 815 nmethod* m = (nmethod*)nativeMethod; |
816 if (m != NULL && !m->is_not_entrant()) { | 816 if (m != NULL && !m->is_not_entrant()) { |
817 m->mark_for_deoptimization(); | 817 m->mark_for_deoptimization(); |
818 VM_Deoptimize op; | 818 VM_Deoptimize op; |
824 C2V_VMENTRY(jobject, readUncompressedOop, (JNIEnv*, jobject, jlong addr)) | 824 C2V_VMENTRY(jobject, readUncompressedOop, (JNIEnv*, jobject, jlong addr)) |
825 oop ret = oopDesc::load_decode_heap_oop((oop*)(address)addr); | 825 oop ret = oopDesc::load_decode_heap_oop((oop*)(address)addr); |
826 return JNIHandles::make_local(THREAD, ret); | 826 return JNIHandles::make_local(THREAD, ret); |
827 C2V_END | 827 C2V_END |
828 | 828 |
829 C2V_VMENTRY(jlongArray, collectCountersImpl, (JNIEnv*, jobject)) | 829 C2V_VMENTRY(jlongArray, collectCounters, (JNIEnv*, jobject)) |
830 typeArrayOop arrayOop = oopFactory::new_longArray(JVMCICounterSize, CHECK_NULL); | 830 typeArrayOop arrayOop = oopFactory::new_longArray(JVMCICounterSize, CHECK_NULL); |
831 JavaThread::collect_counters(arrayOop); | 831 JavaThread::collect_counters(arrayOop); |
832 return (jlongArray) JNIHandles::make_local(THREAD, arrayOop); | 832 return (jlongArray) JNIHandles::make_local(THREAD, arrayOop); |
833 C2V_END | 833 C2V_END |
834 | 834 |
865 } | 865 } |
866 } | 866 } |
867 return false; | 867 return false; |
868 } | 868 } |
869 | 869 |
870 C2V_VMENTRY(jobject, getNextStackFrameImpl, (JNIEnv*, jobject compilerToVM, jobject hs_frame, jobjectArray methods, jint initialSkip)) | 870 C2V_VMENTRY(jobject, getNextStackFrame, (JNIEnv*, jobject compilerToVM, jobject hs_frame, jobjectArray methods, jint initialSkip)) |
871 ResourceMark rm; | 871 ResourceMark rm; |
872 | 872 |
873 if (!thread->has_last_Java_frame()) return NULL; | 873 if (!thread->has_last_Java_frame()) return NULL; |
874 Handle result = HotSpotStackFrameReference::klass()->allocate_instance(thread); | 874 Handle result = HotSpotStackFrameReference::klass()->allocate_instance(thread); |
875 HotSpotStackFrameReference::klass()->initialize(thread); | 875 HotSpotStackFrameReference::klass()->initialize(thread); |
1016 LinkResolver::resolve_invokehandle(callInfo, cp, index, CHECK); | 1016 LinkResolver::resolve_invokehandle(callInfo, cp, index, CHECK); |
1017 ConstantPoolCacheEntry* cp_cache_entry = cp_cache_entry = cp->cache()->entry_at(cp->decode_cpcache_index(index)); | 1017 ConstantPoolCacheEntry* cp_cache_entry = cp_cache_entry = cp->cache()->entry_at(cp->decode_cpcache_index(index)); |
1018 cp_cache_entry->set_method_handle(cp, callInfo); | 1018 cp_cache_entry->set_method_handle(cp, callInfo); |
1019 C2V_END | 1019 C2V_END |
1020 | 1020 |
1021 C2V_VMENTRY(jboolean, shouldDebugNonSafepointsImpl, (JNIEnv*, jobject)) | 1021 C2V_VMENTRY(jboolean, shouldDebugNonSafepoints, (JNIEnv*, jobject)) |
1022 //see compute_recording_non_safepoints in debugInfroRec.cpp | 1022 //see compute_recording_non_safepoints in debugInfroRec.cpp |
1023 if (JvmtiExport::should_post_compiled_method_load() && FLAG_IS_DEFAULT(DebugNonSafepoints)) { | 1023 if (JvmtiExport::should_post_compiled_method_load() && FLAG_IS_DEFAULT(DebugNonSafepoints)) { |
1024 return true; | 1024 return true; |
1025 } | 1025 } |
1026 return DebugNonSafepoints; | 1026 return DebugNonSafepoints; |
1125 array->obj_at_put(i, locals->at(i)->get_obj()()); | 1125 array->obj_at_put(i, locals->at(i)->get_obj()()); |
1126 } | 1126 } |
1127 } | 1127 } |
1128 C2V_END | 1128 C2V_END |
1129 | 1129 |
1130 C2V_VMENTRY(void, writeDebugOutputImpl, (JNIEnv*, jobject, jbyteArray bytes, jint offset, jint length)) | 1130 C2V_VMENTRY(void, writeDebugOutput, (JNIEnv*, jobject, jbyteArray bytes, jint offset, jint length)) |
1131 while (length > 0) { | 1131 while (length > 0) { |
1132 jbyte* start = ((typeArrayOop) JNIHandles::resolve(bytes))->byte_at_addr(offset); | 1132 jbyte* start = ((typeArrayOop) JNIHandles::resolve(bytes))->byte_at_addr(offset); |
1133 tty->write((char*) start, MIN2(length, O_BUFLEN)); | 1133 tty->write((char*) start, MIN2(length, O_BUFLEN)); |
1134 length -= O_BUFLEN; | 1134 length -= O_BUFLEN; |
1135 offset += O_BUFLEN; | 1135 offset += O_BUFLEN; |
1136 } | 1136 } |
1137 C2V_END | 1137 C2V_END |
1138 | 1138 |
1139 C2V_VMENTRY(void, flushDebugOutputImpl, (JNIEnv*, jobject)) | 1139 C2V_VMENTRY(void, flushDebugOutput, (JNIEnv*, jobject)) |
1140 tty->flush(); | 1140 tty->flush(); |
1141 C2V_END | 1141 C2V_END |
1142 | 1142 |
1143 C2V_VMENTRY(int, methodDataProfileDataSize, (JNIEnv*, jobject, jlong metaspace_method_data, jint position)) | 1143 C2V_VMENTRY(int, methodDataProfileDataSize, (JNIEnv*, jobject, jlong metaspace_method_data, jint position)) |
1144 ResourceMark rm; | 1144 ResourceMark rm; |
1208 {CC"resolveInvokeHandleInPool", CC"("HS_CONSTANT_POOL"I)V", FN_PTR(resolveInvokeHandleInPool)}, | 1208 {CC"resolveInvokeHandleInPool", CC"("HS_CONSTANT_POOL"I)V", FN_PTR(resolveInvokeHandleInPool)}, |
1209 {CC"resolveMethod", CC"("HS_RESOLVED_KLASS HS_RESOLVED_METHOD HS_RESOLVED_KLASS")"HS_RESOLVED_METHOD, FN_PTR(resolveMethod)}, | 1209 {CC"resolveMethod", CC"("HS_RESOLVED_KLASS HS_RESOLVED_METHOD HS_RESOLVED_KLASS")"HS_RESOLVED_METHOD, FN_PTR(resolveMethod)}, |
1210 {CC"getVtableIndexForInterfaceMethod", CC"("HS_RESOLVED_KLASS HS_RESOLVED_METHOD")I", FN_PTR(getVtableIndexForInterfaceMethod)}, | 1210 {CC"getVtableIndexForInterfaceMethod", CC"("HS_RESOLVED_KLASS HS_RESOLVED_METHOD")I", FN_PTR(getVtableIndexForInterfaceMethod)}, |
1211 {CC"getClassInitializer", CC"("HS_RESOLVED_KLASS")"HS_RESOLVED_METHOD, FN_PTR(getClassInitializer)}, | 1211 {CC"getClassInitializer", CC"("HS_RESOLVED_KLASS")"HS_RESOLVED_METHOD, FN_PTR(getClassInitializer)}, |
1212 {CC"hasFinalizableSubclass", CC"("HS_RESOLVED_KLASS")Z", FN_PTR(hasFinalizableSubclass)}, | 1212 {CC"hasFinalizableSubclass", CC"("HS_RESOLVED_KLASS")Z", FN_PTR(hasFinalizableSubclass)}, |
1213 {CC"getMaxCallTargetOffsetImpl", CC"(J)J", FN_PTR(getMaxCallTargetOffsetImpl)}, | 1213 {CC"getMaxCallTargetOffset", CC"(J)J", FN_PTR(getMaxCallTargetOffset)}, |
1214 {CC"getResolvedJavaMethodAtSlot", CC"("CLASS"I)"HS_RESOLVED_METHOD, FN_PTR(getResolvedJavaMethodAtSlot)}, | 1214 {CC"getResolvedJavaMethodAtSlot", CC"("CLASS"I)"HS_RESOLVED_METHOD, FN_PTR(getResolvedJavaMethodAtSlot)}, |
1215 {CC"getResolvedJavaMethod", CC"(Ljava/lang/Object;J)"HS_RESOLVED_METHOD, FN_PTR(getResolvedJavaMethod)}, | 1215 {CC"getResolvedJavaMethod", CC"(Ljava/lang/Object;J)"HS_RESOLVED_METHOD, FN_PTR(getResolvedJavaMethod)}, |
1216 {CC"getConstantPool", CC"(Ljava/lang/Object;J)"HS_CONSTANT_POOL, FN_PTR(getConstantPool)}, | 1216 {CC"getConstantPool", CC"(Ljava/lang/Object;J)"HS_CONSTANT_POOL, FN_PTR(getConstantPool)}, |
1217 {CC"getResolvedJavaType", CC"(Ljava/lang/Object;JZ)"HS_RESOLVED_KLASS, FN_PTR(getResolvedJavaType)}, | 1217 {CC"getResolvedJavaType", CC"(Ljava/lang/Object;JZ)"HS_RESOLVED_KLASS, FN_PTR(getResolvedJavaType)}, |
1218 {CC"initializeConfiguration", CC"("HS_CONFIG")V", FN_PTR(initializeConfiguration)}, | 1218 {CC"initializeConfiguration", CC"("HS_CONFIG")V", FN_PTR(initializeConfiguration)}, |
1219 {CC"installCodeImpl", CC"("TARGET_DESCRIPTION HS_COMPILED_CODE INSTALLED_CODE SPECULATION_LOG")I", FN_PTR(installCodeImpl)}, | 1219 {CC"installCode", CC"("TARGET_DESCRIPTION HS_COMPILED_CODE INSTALLED_CODE SPECULATION_LOG")I", FN_PTR(installCode)}, |
1220 {CC"notifyCompilationStatisticsImpl", CC"(I"HS_RESOLVED_METHOD"ZIJJ"INSTALLED_CODE")V", FN_PTR(notifyCompilationStatisticsImpl)}, | 1220 {CC"notifyCompilationStatistics", CC"(I"HS_RESOLVED_METHOD"ZIJJ"INSTALLED_CODE")V", FN_PTR(notifyCompilationStatistics)}, |
1221 {CC"resetCompilationStatisticsImpl", CC"()V", FN_PTR(resetCompilationStatisticsImpl)}, | 1221 {CC"resetCompilationStatistics", CC"()V", FN_PTR(resetCompilationStatistics)}, |
1222 {CC"disassembleCodeBlobImpl", CC"(J)"STRING, FN_PTR(disassembleCodeBlobImpl)}, | 1222 {CC"disassembleCodeBlob", CC"(J)"STRING, FN_PTR(disassembleCodeBlob)}, |
1223 {CC"executeInstalledCode", CC"(["OBJECT INSTALLED_CODE")"OBJECT, FN_PTR(executeInstalledCode)}, | 1223 {CC"executeInstalledCode", CC"(["OBJECT INSTALLED_CODE")"OBJECT, FN_PTR(executeInstalledCode)}, |
1224 {CC"getLineNumberTable", CC"("HS_RESOLVED_METHOD")[J", FN_PTR(getLineNumberTable)}, | 1224 {CC"getLineNumberTable", CC"("HS_RESOLVED_METHOD")[J", FN_PTR(getLineNumberTable)}, |
1225 {CC"getLocalVariableTableStart", CC"("HS_RESOLVED_METHOD")J", FN_PTR(getLocalVariableTableStart)}, | 1225 {CC"getLocalVariableTableStart", CC"("HS_RESOLVED_METHOD")J", FN_PTR(getLocalVariableTableStart)}, |
1226 {CC"getLocalVariableTableLength", CC"("HS_RESOLVED_METHOD")I", FN_PTR(getLocalVariableTableLength)}, | 1226 {CC"getLocalVariableTableLength", CC"("HS_RESOLVED_METHOD")I", FN_PTR(getLocalVariableTableLength)}, |
1227 {CC"reprofile", CC"("HS_RESOLVED_METHOD")V", FN_PTR(reprofile)}, | 1227 {CC"reprofile", CC"("HS_RESOLVED_METHOD")V", FN_PTR(reprofile)}, |
1228 {CC"invalidateInstalledCodeImpl", CC"("INSTALLED_CODE")V", FN_PTR(invalidateInstalledCodeImpl)}, | 1228 {CC"invalidateInstalledCode", CC"("INSTALLED_CODE")V", FN_PTR(invalidateInstalledCode)}, |
1229 {CC"readUncompressedOop", CC"(J)"OBJECT, FN_PTR(readUncompressedOop)}, | 1229 {CC"readUncompressedOop", CC"(J)"OBJECT, FN_PTR(readUncompressedOop)}, |
1230 {CC"collectCountersImpl", CC"()[J", FN_PTR(collectCountersImpl)}, | 1230 {CC"collectCounters", CC"()[J", FN_PTR(collectCounters)}, |
1231 {CC"allocateCompileId", CC"("HS_RESOLVED_METHOD"I)I", FN_PTR(allocateCompileId)}, | 1231 {CC"allocateCompileId", CC"("HS_RESOLVED_METHOD"I)I", FN_PTR(allocateCompileId)}, |
1232 {CC"isMature", CC"("METASPACE_METHOD_DATA")Z", FN_PTR(isMature)}, | 1232 {CC"isMature", CC"("METASPACE_METHOD_DATA")Z", FN_PTR(isMature)}, |
1233 {CC"hasCompiledCodeForOSR", CC"("HS_RESOLVED_METHOD"II)Z", FN_PTR(hasCompiledCodeForOSR)}, | 1233 {CC"hasCompiledCodeForOSR", CC"("HS_RESOLVED_METHOD"II)Z", FN_PTR(hasCompiledCodeForOSR)}, |
1234 {CC"getSymbol", CC"(J)"STRING, FN_PTR(getSymbol)}, | 1234 {CC"getSymbol", CC"(J)"STRING, FN_PTR(getSymbol)}, |
1235 {CC"getNextStackFrameImpl", CC"("HS_STACK_FRAME_REF "["RESOLVED_METHOD"I)"HS_STACK_FRAME_REF, FN_PTR(getNextStackFrameImpl)}, | 1235 {CC"getNextStackFrame", CC"("HS_STACK_FRAME_REF "["RESOLVED_METHOD"I)"HS_STACK_FRAME_REF, FN_PTR(getNextStackFrame)}, |
1236 {CC"materializeVirtualObjects", CC"("HS_STACK_FRAME_REF"Z)V", FN_PTR(materializeVirtualObjects)}, | 1236 {CC"materializeVirtualObjects", CC"("HS_STACK_FRAME_REF"Z)V", FN_PTR(materializeVirtualObjects)}, |
1237 {CC"shouldDebugNonSafepointsImpl", CC"()Z", FN_PTR(shouldDebugNonSafepointsImpl)}, | 1237 {CC"shouldDebugNonSafepoints", CC"()Z", FN_PTR(shouldDebugNonSafepoints)}, |
1238 {CC"writeDebugOutputImpl", CC"([BII)V", FN_PTR(writeDebugOutputImpl)}, | 1238 {CC"writeDebugOutput", CC"([BII)V", FN_PTR(writeDebugOutput)}, |
1239 {CC"flushDebugOutputImpl", CC"()V", FN_PTR(flushDebugOutputImpl)}, | 1239 {CC"flushDebugOutput", CC"()V", FN_PTR(flushDebugOutput)}, |
1240 {CC"methodDataProfileDataSize", CC"(JI)I", FN_PTR(methodDataProfileDataSize)}, | 1240 {CC"methodDataProfileDataSize", CC"(JI)I", FN_PTR(methodDataProfileDataSize)}, |
1241 }; | 1241 }; |
1242 | 1242 |
1243 int CompilerToVM::methods_count() { | 1243 int CompilerToVM::methods_count() { |
1244 return sizeof(methods) / sizeof(JNINativeMethod); | 1244 return sizeof(methods) / sizeof(JNINativeMethod); |