changeset 14545:4877b0cb446f

removed ResolvedJavaMethod.getCompiledCodeSize()
author Doug Simon <doug.simon@oracle.com>
date Fri, 14 Mar 2014 22:56:59 +0100
parents 8c306609eb68
children 942c4daa9db9
files graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaMethod.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java src/share/vm/graal/graalCompilerToVM.cpp
diffstat 8 files changed, 3 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaMethod.java	Fri Mar 14 22:09:46 2014 +0100
+++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaMethod.java	Fri Mar 14 22:56:59 2014 +0100
@@ -77,22 +77,6 @@
         }
     }
 
-    /**
-     * @see ResolvedJavaMethod#getCompiledCodeSize()
-     */
-    @Test
-    public void getCompiledCodeSizeTest() {
-        for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) {
-            ResolvedJavaMethod m = e.getValue();
-            int size = m.getCompiledCodeSize();
-            if (isAbstract(m.getModifiers())) {
-                assertTrue(size == 0);
-            } else {
-                assertTrue(size >= 0);
-            }
-        }
-    }
-
     @Test
     public void getModifiersTest() {
         for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) {
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java	Fri Mar 14 22:09:46 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java	Fri Mar 14 22:56:59 2014 +0100
@@ -53,13 +53,6 @@
     int getCodeSize();
 
     /**
-     * Returns the size of the compiled machine code of this method.
-     * 
-     * @return the size of the compiled machine code in bytes, or 0 if no compiled code exists.
-     */
-    int getCompiledCodeSize();
-
-    /**
      * Returns the {@link ResolvedJavaType} object representing the class or interface that declares
      * this method.
      */
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java	Fri Mar 14 22:09:46 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java	Fri Mar 14 22:56:59 2014 +0100
@@ -102,10 +102,10 @@
         }
     }
 
-    public void finish(HotSpotResolvedJavaMethod method) {
+    public void finish(HotSpotResolvedJavaMethod method, HotSpotInstalledCode code) {
         if (ENABLED) {
             duration = System.nanoTime() - startTime;
-            codeSize = method.getCompiledCodeSize();
+            codeSize = (int) code.getCodeSize();
             memoryUsed = getThreadAllocatedBytes() - threadAllocatedBytesStart;
             if (current.get().getLast() != this) {
                 throw new RuntimeException("mismatch in finish()");
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Fri Mar 14 22:09:46 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Fri Mar 14 22:56:59 2014 +0100
@@ -284,7 +284,7 @@
                     profile.setCompilerIRSize(StructuredGraph.class, graph.getNodeCount());
                 }
             }
-            stats.finish(method);
+            stats.finish(method, installedCode);
         } catch (BailoutException bailout) {
             BAILOUTS.increment();
             if (ExitVMOnBailout.getValue()) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Fri Mar 14 22:09:46 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Fri Mar 14 22:56:59 2014 +0100
@@ -252,14 +252,6 @@
     boolean hasFinalizableSubclass(long metaspaceKlass);
 
     /**
-     * Gets the most recent {@link HotSpotInstalledCode} object associated with a given metaspace
-     * Method object as a result of
-     * {@linkplain #installCode(HotSpotCompiledCode, HotSpotInstalledCode, SpeculationLog)
-     * installing} code for the Method.
-     */
-    HotSpotInstalledCode getInstalledCode(long metaspaceMethod);
-
-    /**
      * Gets the metaspace Method object corresponding to a given {@link Class} object and slot
      * number.
      * 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Fri Mar 14 22:09:46 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Fri Mar 14 22:56:59 2014 +0100
@@ -111,9 +111,6 @@
     public native long getClassInitializer(long metaspaceKlass);
 
     @Override
-    public native HotSpotInstalledCode getInstalledCode(long metaspaceMethod);
-
-    @Override
     public native long getMaxCallTargetOffset(long address);
 
     // The HotSpot disassembler seems not to be thread safe so it's better to synchronize its usage
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Fri Mar 14 22:09:46 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Fri Mar 14 22:56:59 2014 +0100
@@ -353,14 +353,6 @@
         return signature;
     }
 
-    public int getCompiledCodeSize() {
-        HotSpotInstalledCode installedCode = runtime().getCompilerToVM().getInstalledCode(metaspaceMethod);
-        if (installedCode != null) {
-            return (int) installedCode.getCodeSize();
-        }
-        return 0;
-    }
-
     /**
      * Gets the value of {@code Method::_code}.
      * 
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Fri Mar 14 22:09:46 2014 +0100
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Fri Mar 14 22:56:59 2014 +0100
@@ -348,11 +348,6 @@
   return CompilerOracle::should_inline(method) || method->force_inline();
 C2V_END
 
-C2V_VMENTRY(jobject, getInstalledCode, (JNIEnv *env, jobject, jlong metaspace_method))
-  nmethod* nm = (asMethod(metaspace_method))->code();
-  return nm == NULL ? NULL : JNIHandles::make_local(THREAD, nm->graal_installed_code());
-C2V_END
-
 C2V_VMENTRY(jlong, lookupType, (JNIEnv *env, jobject, jstring jname, jclass accessing_class, jboolean resolve))
   ResourceMark rm;
   Handle name = JNIHandles::resolve(jname);
@@ -814,7 +809,6 @@
   {CC"doNotInlineOrCompile",                         CC"("METASPACE_METHOD")V",                                        FN_PTR(doNotInlineOrCompile)},
   {CC"canInlineMethod",                              CC"("METASPACE_METHOD")Z",                                        FN_PTR(canInlineMethod)},
   {CC"shouldInlineMethod",                           CC"("METASPACE_METHOD")Z",                                        FN_PTR(shouldInlineMethod)},
-  {CC"getInstalledCode",                             CC"("METASPACE_METHOD")"HS_INSTALLED_CODE,                        FN_PTR(getInstalledCode)},
   {CC"lookupType",                                   CC"("STRING CLASS"Z)"METASPACE_KLASS,                             FN_PTR(lookupType)},
   {CC"resolveConstantInPool",                        CC"("METASPACE_CONSTANT_POOL"I)"OBJECT,                           FN_PTR(resolveConstantInPool)},
   {CC"resolvePossiblyCachedConstantInPool",          CC"("METASPACE_CONSTANT_POOL"I)"OBJECT,                           FN_PTR(resolvePossiblyCachedConstantInPool)},