< prev index next >

src/hotspot/share/prims/whitebox.cpp

Print this page
rev 54936 : [mq]: 8221734-v3


 805             if (_make_not_entrant) {
 806                 CompiledMethod* cm = CodeCache::find_compiled(f->pc());
 807                 assert(cm != NULL, "sanity check");
 808                 cm->make_not_entrant();
 809             }
 810             ++_result;
 811           }
 812         }
 813       }
 814     }
 815   }
 816 };
 817 
 818 WB_ENTRY(jint, WB_DeoptimizeFrames(JNIEnv* env, jobject o, jboolean make_not_entrant))
 819   VM_WhiteBoxDeoptimizeFrames op(make_not_entrant == JNI_TRUE);
 820   VMThread::execute(&op);
 821   return op.result();
 822 WB_END
 823 
 824 WB_ENTRY(void, WB_DeoptimizeAll(JNIEnv* env, jobject o))
 825   MutexLocker mu(Compile_lock);
 826   CodeCache::mark_all_nmethods_for_deoptimization();
 827   VM_Deoptimize op;
 828   VMThread::execute(&op);
 829 WB_END
 830 
 831 WB_ENTRY(jint, WB_DeoptimizeMethod(JNIEnv* env, jobject o, jobject method, jboolean is_osr))
 832   jmethodID jmid = reflected_method_to_jmid(thread, env, method);
 833   int result = 0;
 834   CHECK_JNI_EXCEPTION_(env, result);
 835   MutexLocker mu(Compile_lock);
 836   methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid));
 837   if (is_osr) {
 838     result += mh->mark_osr_nmethods();
 839   } else if (mh->code() != NULL) {
 840     mh->code()->mark_for_deoptimization();
 841     ++result;
 842   }
 843   result += CodeCache::mark_for_deoptimization(mh());
 844   if (result > 0) {
 845     VM_Deoptimize op;
 846     VMThread::execute(&op);
 847   }
 848   return result;
 849 WB_END
 850 
 851 WB_ENTRY(jboolean, WB_IsMethodCompiled(JNIEnv* env, jobject o, jobject method, jboolean is_osr))
 852   jmethodID jmid = reflected_method_to_jmid(thread, env, method);
 853   CHECK_JNI_EXCEPTION_(env, JNI_FALSE);
 854   MutexLocker mu(Compile_lock);
 855   methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid));
 856   CompiledMethod* code = is_osr ? mh->lookup_osr_nmethod_for(InvocationEntryBci, CompLevel_none, false) : mh->code();
 857   if (code == NULL) {
 858     return JNI_FALSE;
 859   }
 860   return (code->is_alive() && !code->is_marked_for_deoptimization());
 861 WB_END
 862 
 863 WB_ENTRY(jboolean, WB_IsMethodCompilable(JNIEnv* env, jobject o, jobject method, jint comp_level, jboolean is_osr))
 864   if (method == NULL || comp_level > MIN2((CompLevel) TieredStopAtLevel, CompLevel_highest_tier)) {
 865     return false;
 866   }




 805             if (_make_not_entrant) {
 806                 CompiledMethod* cm = CodeCache::find_compiled(f->pc());
 807                 assert(cm != NULL, "sanity check");
 808                 cm->make_not_entrant();
 809             }
 810             ++_result;
 811           }
 812         }
 813       }
 814     }
 815   }
 816 };
 817 
 818 WB_ENTRY(jint, WB_DeoptimizeFrames(JNIEnv* env, jobject o, jboolean make_not_entrant))
 819   VM_WhiteBoxDeoptimizeFrames op(make_not_entrant == JNI_TRUE);
 820   VMThread::execute(&op);
 821   return op.result();
 822 WB_END
 823 
 824 WB_ENTRY(void, WB_DeoptimizeAll(JNIEnv* env, jobject o))

 825   CodeCache::mark_all_nmethods_for_deoptimization();
 826   Deoptimization::deoptimize_all_marked();

 827 WB_END
 828 
 829 WB_ENTRY(jint, WB_DeoptimizeMethod(JNIEnv* env, jobject o, jobject method, jboolean is_osr))
 830   jmethodID jmid = reflected_method_to_jmid(thread, env, method);
 831   int result = 0;
 832   CHECK_JNI_EXCEPTION_(env, result);
 833   MutexLocker mu(Compile_lock);
 834   methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid));
 835   if (is_osr) {
 836     result += mh->mark_osr_nmethods();
 837   } else if (mh->code() != NULL) {
 838     mh->code()->mark_for_deoptimization();
 839     ++result;
 840   }
 841   result += CodeCache::mark_for_deoptimization(mh());
 842   if (result > 0) {
 843     Deoptimization::deoptimize_all_marked();

 844   }
 845   return result;
 846 WB_END
 847 
 848 WB_ENTRY(jboolean, WB_IsMethodCompiled(JNIEnv* env, jobject o, jobject method, jboolean is_osr))
 849   jmethodID jmid = reflected_method_to_jmid(thread, env, method);
 850   CHECK_JNI_EXCEPTION_(env, JNI_FALSE);
 851   MutexLocker mu(Compile_lock);
 852   methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid));
 853   CompiledMethod* code = is_osr ? mh->lookup_osr_nmethod_for(InvocationEntryBci, CompLevel_none, false) : mh->code();
 854   if (code == NULL) {
 855     return JNI_FALSE;
 856   }
 857   return (code->is_alive() && !code->is_marked_for_deoptimization());
 858 WB_END
 859 
 860 WB_ENTRY(jboolean, WB_IsMethodCompilable(JNIEnv* env, jobject o, jobject method, jint comp_level, jboolean is_osr))
 861   if (method == NULL || comp_level > MIN2((CompLevel) TieredStopAtLevel, CompLevel_highest_tier)) {
 862     return false;
 863   }


< prev index next >