# HG changeset patch # User dnsimon # Date 1487102783 -3600 # Tue Feb 14 21:06:23 2017 +0100 # Node ID 0ede29fc488678a528419ec7f5bb98e058b01b9a # Parent 3f26c53ddda80567bfd33e4b3b4d2e9ac56b83b6 8174961: [JVMCI] incorrect implementation of isCompilable diff --git a/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/src/share/vm/jvmci/jvmciCompilerToVM.cpp --- a/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -735,9 +735,7 @@ C2V_VMENTRY(jboolean, isCompilable,(JNIEnv *, jobject, jobject jvmci_method)) methodHandle method = CompilerToVM::asMethod(jvmci_method); - // Ignore the not_compilable flags in hosted mode since they are never set by - // the JVMCI compiler. - return UseJVMCICompiler || !method->is_not_compilable(CompLevel_full_optimization); + return !method->is_not_compilable(CompLevel_full_optimization); C2V_END C2V_VMENTRY(jboolean, hasNeverInlineDirective,(JNIEnv *, jobject, jobject jvmci_method)) diff --git a/test/compiler/jvmci/compilerToVM/IsCompilableTest.java b/test/compiler/jvmci/compilerToVM/IsCompilableTest.java --- a/test/compiler/jvmci/compilerToVM/IsCompilableTest.java +++ b/test/compiler/jvmci/compilerToVM/IsCompilableTest.java @@ -42,7 +42,7 @@ * compiler.jvmci.compilerToVM.IsCompilableTest * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler * compiler.jvmci.compilerToVM.IsCompilableTest */ @@ -69,20 +69,17 @@ } private static void runSanityTest(Executable aMethod) { - boolean UseJVMCICompiler = (Boolean) WB.getVMFlag("UseJVMCICompiler"); HotSpotResolvedJavaMethod method = CTVMUtilities .getResolvedMethod(aMethod); boolean isCompilable = CompilerToVMHelper.isCompilable(method); - boolean expected = UseJVMCICompiler || WB.isMethodCompilable(aMethod); + boolean expected = WB.isMethodCompilable(aMethod); Asserts.assertEQ(isCompilable, expected, "Unexpected initial " + "value of property 'compilable'"); - if (!UseJVMCICompiler) { - WB.makeMethodNotCompilable(aMethod); - isCompilable = CompilerToVMHelper.isCompilable(method); - Asserts.assertFalse(isCompilable, aMethod + "Unexpected value of " + - "property 'isCompilable' after setting 'compilable' to false"); - } + WB.makeMethodNotCompilable(aMethod); + isCompilable = CompilerToVMHelper.isCompilable(method); + Asserts.assertFalse(isCompilable, aMethod + "Unexpected value of " + + "property 'isCompilable' after setting 'compilable' to false"); } private static List createTestCases() {