diff graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2866:7f14e6b48a9c

added dead code elimination added ValueAnchor (temp workaround) more inlining logic (now uses DCE) IdealGraphPrinter: print even if Scheduler fails added inlining and DCE tracing options to C1XOptions
author Lukas Stadler <lukas.stadler@jku.at>
date Tue, 07 Jun 2011 16:27:08 +0200
parents 7596ae867a7b
children 5c545fef2c81
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Wed Jun 01 16:56:54 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java	Tue Jun 07 16:27:08 2011 +0200
@@ -121,9 +121,11 @@
 
     /**
      * Builds the graph for a the specified {@code IRScope}.
-     * @param scope the top IRScope
+     *
+     * @param createUnwind setting this to true will always generate an unwind block, even if there is no exception
+     *            handler and the method is not synchronized
      */
-    public void build() {
+    public void build(boolean createUnwind) {
         if (log != null) {
             log.println();
             log.println("Compiling " + method);
@@ -161,6 +163,10 @@
         } else {
             // 4B.1 simply finish the start block
             finishStartBlock(startBlock);
+
+            if (createUnwind) {
+                syncHandler = new CiExceptionHandler(0, method.code().length, Instruction.SYNCHRONIZATION_ENTRY_BCI, 0, null);
+            }
         }
 
         // 5. SKIPPED: look for intrinsics
@@ -544,6 +550,7 @@
         Value yValue = frameState.pop(y);
         Value xValue = frameState.pop(x);
         Value result1 = append(new ArithmeticOp(opcode, result, xValue, yValue, isStrict(method.accessFlags()), canTrap, graph));
+        append(new ValueAnchor(result1, graph));
         frameState.push(result, result1);
     }