Skip to content
Permalink
Browse files

8239423: jdk/jfr/jvm/TestJFRIntrinsic.java failed with -XX:-TieredCom…

…pilation

Reviewed-by: iignatyev, dholmes
  • Loading branch information
theaoqi committed Feb 26, 2020
1 parent f6e5c5a commit 2298819af84e96ddeed17c7ee3b7ca044266b7cc
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/hotspot/share/prims/whitebox.cpp
@@ -821,6 +821,10 @@ static jmethodID reflected_method_to_jmid(JavaThread* thread, JNIEnv* env, jobje
return env->FromReflectedMethod(method);
}

static CompLevel highestCompLevel() {
return TieredCompilation ? MIN2((CompLevel) TieredStopAtLevel, CompLevel_highest_tier) : CompLevel_highest_tier;
}

// Deoptimizes all compiled frames and makes nmethods not entrant if it's requested
class VM_WhiteBoxDeoptimizeFrames : public VM_WhiteBoxOperation {
private:
@@ -894,7 +898,7 @@ WB_ENTRY(jboolean, WB_IsMethodCompiled(JNIEnv* env, jobject o, jobject method, j
WB_END

WB_ENTRY(jboolean, WB_IsMethodCompilable(JNIEnv* env, jobject o, jobject method, jint comp_level, jboolean is_osr))
if (method == NULL || comp_level > MIN2((CompLevel) TieredStopAtLevel, CompLevel_highest_tier)) {
if (method == NULL || comp_level > highestCompLevel()) {
return false;
}
jmethodID jmid = reflected_method_to_jmid(thread, env, method);
@@ -917,7 +921,7 @@ WB_ENTRY(jboolean, WB_IsMethodQueuedForCompilation(JNIEnv* env, jobject o, jobje
WB_END

WB_ENTRY(jboolean, WB_IsIntrinsicAvailable(JNIEnv* env, jobject o, jobject method, jobject compilation_context, jint compLevel))
if (compLevel < CompLevel_none || compLevel > MIN2((CompLevel) TieredStopAtLevel, CompLevel_highest_tier)) {
if (compLevel < CompLevel_none || compLevel > highestCompLevel()) {
return false; // Intrinsic is not available on a non-existent compilation level.
}
jmethodID method_id, compilation_context_id;
@@ -1003,7 +1007,7 @@ bool WhiteBox::compile_method(Method* method, int comp_level, int bci, Thread* T
tty->print_cr("WB error: request to compile NULL method");
return false;
}
if (comp_level > MIN2((CompLevel) TieredStopAtLevel, CompLevel_highest_tier)) {
if (comp_level > highestCompLevel()) {
tty->print_cr("WB error: invalid compilation level %d", comp_level);
return false;
}

0 comments on commit 2298819

Please sign in to comment.