8180487: HotSpotResolvedJavaMethod.setNotInlineable() should be renamed to represent actual behavior
authorysuenaga
Thu, 18 May 2017 16:31:16 -0700
changeset 46481 a8e8bb9d1603
parent 46480 77e911558d21
child 46483 94ffd2984ec9
8180487: HotSpotResolvedJavaMethod.setNotInlineable() should be renamed to represent actual behavior Summary: rename setNotInlineable() to setNotInlineableOrCompileable() Reviewed-by: dnsimon, kvn
hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java
hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java
hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java
hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Thu May 18 14:33:09 2017 -0700
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Thu May 18 16:31:16 2017 -0700
@@ -459,9 +459,9 @@
     native long getLocalVariableTableStart(HotSpotResolvedJavaMethodImpl method);
 
     /**
-     * Determines if {@code method} should not be inlined or compiled.
+     * Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
      */
-    native void doNotInlineOrCompile(HotSpotResolvedJavaMethodImpl method);
+    native void setNotInlineableOrCompileable(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Invalidates the profiling information for {@code method} and (re)initializes it such that
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java	Thu May 18 14:33:09 2017 -0700
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java	Thu May 18 16:31:16 2017 -0700
@@ -57,9 +57,9 @@
     boolean hasReservedStackAccess();
 
     /**
-     * Manually adds a DontInline annotation to this method.
+     * Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
      */
-    void setNotInlineable();
+    void setNotInlineableOrCompileable();
 
     /**
      * Returns true if this method is one of the special methods that is ignored by security stack
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java	Thu May 18 14:33:09 2017 -0700
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java	Thu May 18 16:31:16 2017 -0700
@@ -318,10 +318,10 @@
     }
 
     /**
-     * Manually adds a DontInline annotation to this method.
+     * Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM.
      */
-    public void setNotInlineable() {
-        compilerToVM().doNotInlineOrCompile(this);
+    public void setNotInlineableOrCompileable() {
+        compilerToVM().setNotInlineableOrCompileable(this);
     }
 
     /**
--- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Thu May 18 14:33:09 2017 -0700
+++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Thu May 18 16:31:16 2017 -0700
@@ -1003,7 +1003,7 @@
   return -1;
 C2V_END
 
-C2V_VMENTRY(void, doNotInlineOrCompile,(JNIEnv *, jobject,  jobject jvmci_method))
+C2V_VMENTRY(void, setNotInlineableOrCompileable,(JNIEnv *, jobject,  jobject jvmci_method))
   methodHandle method = CompilerToVM::asMethod(jvmci_method);
   method->set_not_c1_compilable();
   method->set_not_c2_compilable();
@@ -1770,7 +1770,7 @@
   {CC "getImplementor",                               CC "(" HS_RESOLVED_KLASS ")" HS_RESOLVED_KLASS,                                       FN_PTR(getImplementor)},
   {CC "getStackTraceElement",                         CC "(" HS_RESOLVED_METHOD "I)" STACK_TRACE_ELEMENT,                                   FN_PTR(getStackTraceElement)},
   {CC "methodIsIgnoredBySecurityStackWalk",           CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(methodIsIgnoredBySecurityStackWalk)},
-  {CC "doNotInlineOrCompile",                         CC "(" HS_RESOLVED_METHOD ")V",                                                       FN_PTR(doNotInlineOrCompile)},
+  {CC "setNotInlineableOrCompileable",                CC "(" HS_RESOLVED_METHOD ")V",                                                       FN_PTR(setNotInlineableOrCompileable)},
   {CC "isCompilable",                                 CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(isCompilable)},
   {CC "hasNeverInlineDirective",                      CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(hasNeverInlineDirective)},
   {CC "shouldInlineMethod",                           CC "(" HS_RESOLVED_METHOD ")Z",                                                       FN_PTR(shouldInlineMethod)},
--- a/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java	Thu May 18 14:33:09 2017 -0700
+++ b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java	Thu May 18 16:31:16 2017 -0700
@@ -215,8 +215,8 @@
         return CTVM.getLocalVariableTableStart((HotSpotResolvedJavaMethodImpl)method);
     }
 
-    public static void doNotInlineOrCompile(HotSpotResolvedJavaMethod method) {
-        CTVM.doNotInlineOrCompile((HotSpotResolvedJavaMethodImpl)method);
+    public static void setNotInlineableOrCompileable(HotSpotResolvedJavaMethod method) {
+        CTVM.setNotInlineableOrCompileable((HotSpotResolvedJavaMethodImpl)method);
     }
 
     public static void reprofile(HotSpotResolvedJavaMethod method) {
--- a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java	Thu May 18 14:33:09 2017 -0700
+++ b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java	Thu May 18 16:31:16 2017 -0700
@@ -71,10 +71,10 @@
         boolean hasNeverInlineDirective = CompilerToVMHelper.hasNeverInlineDirective(method);
         Asserts.assertFalse(hasNeverInlineDirective, "Unexpected initial " +
                 "value of property 'hasNeverInlineDirective'");
-        CompilerToVMHelper.doNotInlineOrCompile(method);
+        CompilerToVMHelper.setNotInlineableOrCompileable(method);
         hasNeverInlineDirective = CompilerToVMHelper.hasNeverInlineDirective(method);
         Asserts.assertTrue(hasNeverInlineDirective, aMethod
-                + " : hasNeverInlineDirective is false even after doNotInlineOrCompile'");
+                + " : hasNeverInlineDirective is false even after setNotInlineableOrCompileable'");
     }
 
     private static List<Executable> createTestCases() {