changeset 16401:347915b8cea8

Move name from HotSpotNmethod to InstalledCode to have a name again for truffle nmethods.
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 02 Jul 2014 18:23:56 +0200
parents fca7699bacd8
children 639716622dc8
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInstalledCode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntimeStub.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java src/share/vm/graal/graalJavaAccess.hpp src/share/vm/runtime/deoptimization.cpp
diffstat 9 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java	Wed Jul 02 16:54:45 2014 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java	Wed Jul 02 18:23:56 2014 +0200
@@ -38,6 +38,12 @@
      */
     private long version;
 
+    protected final String name;
+
+    public InstalledCode(String name) {
+        this.name = name;
+    }
+
     /**
      * @return the address of this code blob
      */
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInstalledCode.java	Wed Jul 02 16:54:45 2014 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInstalledCode.java	Wed Jul 02 18:23:56 2014 +0200
@@ -49,6 +49,10 @@
      */
     @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "field is set by the native part") private int codeSize;
 
+    public HotSpotInstalledCode(String name) {
+        super(name);
+    }
+
     /**
      * @return the total size of this code blob
      */
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java	Wed Jul 02 16:54:45 2014 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java	Wed Jul 02 18:23:56 2014 +0200
@@ -46,17 +46,16 @@
 
     private final boolean isDefault;
     private final boolean isExternal;
-    private final String name;
 
     public HotSpotNmethod(HotSpotResolvedJavaMethod method, String name, boolean isDefault) {
         this(method, name, isDefault, false);
     }
 
     public HotSpotNmethod(HotSpotResolvedJavaMethod method, String name, boolean isDefault, boolean isExternal) {
+        super(name);
         this.method = method;
         this.isDefault = isDefault;
         this.isExternal = isExternal;
-        this.name = name;
     }
 
     public boolean isDefault() {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntimeStub.java	Wed Jul 02 16:54:45 2014 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntimeStub.java	Wed Jul 02 18:23:56 2014 +0200
@@ -35,6 +35,7 @@
     private final Stub stub;
 
     public HotSpotRuntimeStub(Stub stub) {
+        super(stub.toString());
         this.stub = stub;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java	Wed Jul 02 16:54:45 2014 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java	Wed Jul 02 18:23:56 2014 +0200
@@ -157,7 +157,7 @@
                 CallingConvention incomingCc = linkage.getIncomingCallingConvention();
                 TargetDescription target = codeCache.getTarget();
 
-                compResult = new CompilationResult();
+                compResult = new CompilationResult(toString());
                 try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) {
                     Assumptions assumptions = new Assumptions(OptAssumptions.getValue());
                     SchedulePhase schedule = emitFrontEnd(providers, target, graph, assumptions, null, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL,
--- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java	Wed Jul 02 16:54:45 2014 +0200
+++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java	Wed Jul 02 18:23:56 2014 +0200
@@ -65,7 +65,7 @@
     protected InstalledCode assertPartialEvalEquals(String methodName, RootNode root, Object[] arguments) {
         Assumptions assumptions = new Assumptions(true);
         StructuredGraph actual = partialEval(root, arguments, assumptions, true);
-        InstalledCode result = new InstalledCode();
+        InstalledCode result = new InstalledCode("Test:" + methodName);
         truffleCompiler.compileMethodHelper(actual, assumptions, root.toString(), getSpeculationLog(), result);
         StructuredGraph expected = parseForComparison(methodName);
         removeFrameStates(actual);
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java	Wed Jul 02 16:54:45 2014 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java	Wed Jul 02 18:23:56 2014 +0200
@@ -63,6 +63,7 @@
     }
 
     public OptimizedCallTarget(RootNode rootNode, GraalTruffleRuntime runtime, int invokeCounter, int compilationThreshold, CompilationPolicy compilationPolicy, SpeculationLog speculationLog) {
+        super(rootNode.toString());
         this.runtime = runtime;
         this.speculationLog = speculationLog;
         this.rootNode = rootNode;
--- a/src/share/vm/graal/graalJavaAccess.hpp	Wed Jul 02 16:54:45 2014 +0200
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Wed Jul 02 18:23:56 2014 +0200
@@ -57,6 +57,7 @@
   start_class(InstalledCode)                                                                                                                                   \
     long_field(InstalledCode, address)                                                                                                                         \
     long_field(InstalledCode, version)                                                                                                                         \
+    oop_field(InstalledCode, name, "Ljava/lang/String;")                                                                                                       \
   end_class                                                                                                                                                    \
   start_class(HotSpotInstalledCode)                                                                                                                            \
     int_field(HotSpotInstalledCode, size)                                                                                                                      \
@@ -66,7 +67,6 @@
   start_class(HotSpotNmethod)                                                                                                                                  \
     boolean_field(HotSpotNmethod, isDefault)                                                                                                                   \
     boolean_field(HotSpotNmethod, isExternal)                                                                                                                  \
-    oop_field(HotSpotNmethod, name, "Ljava/lang/String;")                                                                                                      \
   end_class                                                                                                                                                    \
   start_class(HotSpotCompiledCode)                                                                                                                             \
     oop_field(HotSpotCompiledCode, comp, "Lcom/oracle/graal/api/code/CompilationResult;")                                                                      \
--- a/src/share/vm/runtime/deoptimization.cpp	Wed Jul 02 16:54:45 2014 +0200
+++ b/src/share/vm/runtime/deoptimization.cpp	Wed Jul 02 18:23:56 2014 +0200
@@ -1487,8 +1487,8 @@
         oop installedCode = nm->graal_installed_code();
         if (installedCode != NULL) {
           oop installedCodeName = NULL;
-          if (installedCode->is_a(HotSpotNmethod::klass())) {
-            installedCodeName = HotSpotNmethod::name(installedCode);
+          if (installedCode->is_a(InstalledCode::klass())) {
+            installedCodeName = InstalledCode::name(installedCode);
           }
           if (installedCodeName != NULL) {
             tty->print(" (Graal: installedCodeName=%s) ", java_lang_String::as_utf8_string(installedCodeName));