diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java @ 5275:290b3025b66f

added support for disassembling code after installation (so that the result of patching and relocation can be seen)
author Doug Simon <doug.simon@oracle.com>
date Mon, 23 Apr 2012 15:49:11 +0200
parents 51d2cac7db70
children 796917d3bfc9
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Mon Apr 23 15:42:30 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Mon Apr 23 15:49:11 2012 +0200
@@ -128,7 +128,8 @@
                     TTY.println(String.format("%-6d Graal %-70s %-45s %-50s | %4dnodes %5dB", id, "", "", "", 0, (result != null ? result.targetCodeSize() : -1)));
                 }
             }
-            compiler.getRuntime().installMethod(method, result);
+
+            installMethod(result);
         } catch (CiBailout bailout) {
             Debug.metric("Bailouts").increment();
             if (GraalOptions.ExitVMOnBailout) {
@@ -148,6 +149,20 @@
         stats.finish(method);
     }
 
+    private void installMethod(final CiTargetMethod tm) {
+        Debug.scope("CodeInstall", new Object[] {compiler.getCompiler(), method}, new Runnable() {
+            @Override
+            public void run() {
+                final HotSpotCodeInfo info = Debug.isDumpEnabled() ? new HotSpotCodeInfo(compiler, tm, method) : null;
+                compiler.getRuntime().installMethod(method, tm, info);
+                if (info != null) {
+                    Debug.dump(info, "After code installation");
+                }
+            }
+
+        });
+    }
+
     @Override
     public int compareTo(CompilationTask o) {
         if (priority < o.priority) {