8174961: [JVMCI] incorrect implementation of isCompilable

Reviewed-by: kvn
This commit is contained in:
Doug Simon 2017-02-14 12:04:28 -08:00
parent 96846a4105
commit eb8d5435c2
2 changed files with 7 additions and 12 deletions

View file

@ -735,9 +735,7 @@ C2V_END
C2V_VMENTRY(jboolean, isCompilable,(JNIEnv *, jobject, jobject jvmci_method)) C2V_VMENTRY(jboolean, isCompilable,(JNIEnv *, jobject, jobject jvmci_method))
methodHandle method = CompilerToVM::asMethod(jvmci_method); methodHandle method = CompilerToVM::asMethod(jvmci_method);
// Ignore the not_compilable flags in hosted mode since they are never set by return !method->is_not_compilable(CompLevel_full_optimization);
// the JVMCI compiler.
return UseJVMCICompiler || !method->is_not_compilable(CompLevel_full_optimization);
C2V_END C2V_END
C2V_VMENTRY(jboolean, hasNeverInlineDirective,(JNIEnv *, jobject, jobject jvmci_method)) C2V_VMENTRY(jboolean, hasNeverInlineDirective,(JNIEnv *, jobject, jobject jvmci_method))

View file

@ -42,7 +42,7 @@
* compiler.jvmci.compilerToVM.IsCompilableTest * compiler.jvmci.compilerToVM.IsCompilableTest
* @run main/othervm -Xbootclasspath/a:. * @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler
* compiler.jvmci.compilerToVM.IsCompilableTest * compiler.jvmci.compilerToVM.IsCompilableTest
*/ */
@ -69,20 +69,17 @@ public class IsCompilableTest {
} }
private static void runSanityTest(Executable aMethod) { private static void runSanityTest(Executable aMethod) {
boolean UseJVMCICompiler = (Boolean) WB.getVMFlag("UseJVMCICompiler");
HotSpotResolvedJavaMethod method = CTVMUtilities HotSpotResolvedJavaMethod method = CTVMUtilities
.getResolvedMethod(aMethod); .getResolvedMethod(aMethod);
boolean isCompilable = CompilerToVMHelper.isCompilable(method); boolean isCompilable = CompilerToVMHelper.isCompilable(method);
boolean expected = UseJVMCICompiler || WB.isMethodCompilable(aMethod); boolean expected = WB.isMethodCompilable(aMethod);
Asserts.assertEQ(isCompilable, expected, "Unexpected initial " + Asserts.assertEQ(isCompilable, expected, "Unexpected initial " +
"value of property 'compilable'"); "value of property 'compilable'");
if (!UseJVMCICompiler) { WB.makeMethodNotCompilable(aMethod);
WB.makeMethodNotCompilable(aMethod); isCompilable = CompilerToVMHelper.isCompilable(method);
isCompilable = CompilerToVMHelper.isCompilable(method); Asserts.assertFalse(isCompilable, aMethod + "Unexpected value of " +
Asserts.assertFalse(isCompilable, aMethod + "Unexpected value of " + "property 'isCompilable' after setting 'compilable' to false");
"property 'isCompilable' after setting 'compilable' to false");
}
} }
private static List<Executable> createTestCases() { private static List<Executable> createTestCases() {