changeset 22648:9f24bf92ee94

Remove hasBalancedMonitors
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 01 Oct 2015 17:13:13 -0700
parents a2af5a344c65
children 5cd42bb63fad
files jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompilerToVM.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/ResolvedJavaMethod.java jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestResolvedJavaMethod.java src/share/vm/jvmci/jvmciCompilerToVM.cpp
diffstat 6 files changed, 0 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompilerToVM.java	Thu Oct 01 10:23:26 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompilerToVM.java	Thu Oct 01 17:13:13 2015 -0700
@@ -102,11 +102,6 @@
     native long getExceptionTableStart(HotSpotResolvedJavaMethodImpl method);
 
     /**
-     * Determines if {@code method} has balanced monitors.
-     */
-    native boolean hasBalancedMonitors(HotSpotResolvedJavaMethodImpl method);
-
-    /**
      * Determines if {@code method} can be inlined. A method may not be inlinable for a number of
      * reasons such as:
      * <ul>
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod.java	Thu Oct 01 10:23:26 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod.java	Thu Oct 01 17:13:13 2015 -0700
@@ -79,8 +79,6 @@
      */
     boolean ignoredBySecurityStackWalk();
 
-    boolean hasBalancedMonitors();
-
     ResolvedJavaMethod uniqueConcreteMethod(HotSpotResolvedObjectType receiver);
 
     /**
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java	Thu Oct 01 10:23:26 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java	Thu Oct 01 17:13:13 2015 -0700
@@ -327,25 +327,6 @@
     }
 
     @Override
-    public boolean hasBalancedMonitors() {
-        HotSpotVMConfig config = config();
-        final int modifiers = getAllModifiers();
-
-        // Method has no monitorenter/exit bytecodes.
-        if ((modifiers & config.jvmAccHasMonitorBytecodes) == 0) {
-            return true;
-        }
-
-        // Check to see if a previous compilation computed the monitor-matching analysis.
-        if ((modifiers & config.jvmAccMonitorMatch) != 0) {
-            return true;
-        }
-
-        // This either happens only once if monitors are balanced or very rarely multiple-times.
-        return compilerToVM().hasBalancedMonitors(this);
-    }
-
-    @Override
     public boolean isClassInitializer() {
         return "<clinit>".equals(name) && isStatic();
     }
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/ResolvedJavaMethod.java	Thu Oct 01 10:23:26 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/ResolvedJavaMethod.java	Thu Oct 01 17:13:13 2015 -0700
@@ -244,14 +244,6 @@
     LocalVariableTable getLocalVariableTable();
 
     /**
-     * Check if the monitor operations are properly block structured with monitorexits for every
-     * monitorenter and the exits performed in the same order as the enters.
-     *
-     * @return true if monitor operations are balanced.
-     */
-    boolean hasBalancedMonitors();
-
-    /**
      * Invokes the underlying method represented by this object, on the specified object with the
      * specified parameters. This method is similar to a reflective method invocation by
      * {@link Method#invoke}.
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestResolvedJavaMethod.java	Thu Oct 01 10:23:26 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestResolvedJavaMethod.java	Thu Oct 01 17:13:13 2015 -0700
@@ -370,18 +370,6 @@
     }
 
     @Test
-    public void hasBalancedMonitorsTest() {
-        // Everything normally seen should have balanced monitors.
-        for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) {
-            ResolvedJavaMethod m = e.getValue();
-            if (!m.hasBalancedMonitors()) {
-                System.err.println(m.hasBalancedMonitors());
-            }
-            assertTrue(m.toString(), m.hasBalancedMonitors());
-        }
-    }
-
-    @Test
     public void isJavaLangObjectInitTest() throws NoSuchMethodException {
         ResolvedJavaMethod method = metaAccess.lookupJavaMethod(Object.class.getConstructor());
         assertTrue(method.isJavaLangObjectInit());
--- a/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Thu Oct 01 10:23:26 2015 -0700
+++ b/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Thu Oct 01 17:13:13 2015 -0700
@@ -181,22 +181,6 @@
   return (jlong) (address) method->exception_table_start();
 C2V_END
 
-C2V_VMENTRY(jint, hasBalancedMonitors, (JNIEnv *, jobject, jobject jvmci_method))
-  // Analyze the method to see if monitors are used properly.
-  methodHandle method(THREAD, CompilerToVM::asMethod(jvmci_method));
-  {
-    EXCEPTION_MARK;
-    ResourceMark rm(THREAD);
-    GeneratePairingInfo gpi(method);
-    gpi.compute_map(CATCH);
-    if (!gpi.monitor_safe()) {
-      return false;
-    }
-    method->set_guaranteed_monitor_matching();
-  }
-  return true;
-C2V_END
-
 C2V_VMENTRY(jobject, getResolvedJavaMethodAtSlot, (JNIEnv *, jobject, jclass holder_handle, jint slot))
   oop java_class = JNIHandles::resolve(holder_handle);
   Klass* holder = java_lang_Class::as_Klass(java_class);
@@ -1211,7 +1195,6 @@
   {CC"getBytecode",                                  CC"("HS_RESOLVED_METHOD")[B",                                                     FN_PTR(getBytecode)},
   {CC"getExceptionTableStart",                       CC"("HS_RESOLVED_METHOD")J",                                                      FN_PTR(getExceptionTableStart)},
   {CC"getExceptionTableLength",                      CC"("HS_RESOLVED_METHOD")I",                                                      FN_PTR(getExceptionTableLength)},
-  {CC"hasBalancedMonitors",                          CC"("HS_RESOLVED_METHOD")Z",                                                      FN_PTR(hasBalancedMonitors)},
   {CC"findUniqueConcreteMethod",                     CC"("HS_RESOLVED_KLASS HS_RESOLVED_METHOD")"HS_RESOLVED_METHOD,                   FN_PTR(findUniqueConcreteMethod)},
   {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)},