changeset 2568:95a9b8906b09

Add QuietBailout option to be able to mute the bailouts generated by JSRs in dacapo
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Mon, 02 May 2011 10:56:35 +0200
parents b96f9fcc53b1
children 7aa67f5f3884 28a8b3c8b9b4
files graal/GraalCompiler/src/com/sun/c1x/C1XOptions.java graal/GraalRuntime/src/com/oracle/graal/runtime/VMExitsNative.java rundacapo.sh
diffstat 3 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/C1XOptions.java	Mon May 02 10:24:43 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/C1XOptions.java	Mon May 02 10:56:35 2011 +0200
@@ -83,6 +83,7 @@
     public static boolean TraceAssembler                     = ____;
     public static int     TraceBytecodeParserLevel           = 0;
     public static boolean PrintAssumptions                   = ____;
+    public static boolean QuietBailout                       = ____;
 
     // all optimization settings
     public static boolean OptLocalValueNumbering;
--- a/graal/GraalRuntime/src/com/oracle/graal/runtime/VMExitsNative.java	Mon May 02 10:24:43 2011 +0200
+++ b/graal/GraalRuntime/src/com/oracle/graal/runtime/VMExitsNative.java	Mon May 02 10:56:35 2011 +0200
@@ -28,6 +28,7 @@
 
 import com.oracle.graal.runtime.logging.*;
 import com.oracle.graal.runtime.server.*;
+import com.sun.c1x.*;
 import com.sun.c1x.debug.*;
 import com.sun.cri.ci.*;
 import com.sun.cri.ri.*;
@@ -83,19 +84,21 @@
             }
 
             if (result.bailout() != null) {
-                StringWriter out = new StringWriter();
-                result.bailout().printStackTrace(new PrintWriter(out));
                 Throwable cause = result.bailout().getCause();
-                TTY.println("Bailout:\n" + out.toString());
-                if (cause != null) {
-                    Logger.info("Trace for cause: ");
-                    for (StackTraceElement e : cause.getStackTrace()) {
-                        String current = e.getClassName() + "::" + e.getMethodName();
-                        String type = "";
-                        if (compiledMethods.contains(current)) {
-                            type = "compiled";
+                if(!C1XOptions.QuietBailout) {
+                    StringWriter out = new StringWriter();
+                    result.bailout().printStackTrace(new PrintWriter(out));
+                    TTY.println("Bailout:\n" + out.toString());
+                    if (cause != null) {
+                        Logger.info("Trace for cause: ");
+                        for (StackTraceElement e : cause.getStackTrace()) {
+                            String current = e.getClassName() + "::" + e.getMethodName();
+                            String type = "";
+                            if (compiledMethods.contains(current)) {
+                                type = "compiled";
+                            }
+                            Logger.info(String.format("%-10s %3d %s", type, e.getLineNumber(), current));
                         }
-                        Logger.info(String.format("%-10s %3d %s", type, e.getLineNumber(), current));
                     }
                 }
                 String s = result.bailout().getMessage();
--- a/rundacapo.sh	Mon May 02 10:24:43 2011 +0200
+++ b/rundacapo.sh	Mon May 02 10:56:35 2011 +0200
@@ -15,4 +15,4 @@
   echo "DACAPO is not defined. It must point to a SciMark benchmark directory."
   exit 1;
 fi
-${JDK7}/bin/java -client -graal -XX:-C1XBailoutIsFatal -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar Harness $*
+${JDK7}/bin/java -client -graal -XX:-C1XBailoutIsFatal -C1X:+QuietBailout -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar Harness $*