changeset 6992:e35077f6d2a2

removed cached LogStream in GraphBuilderPhase
author Doug Simon <doug.simon@oracle.com>
date Mon, 19 Nov 2012 13:33:27 +0100
parents dd0dd0321e2a
children e76a714932a0
files graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java
diffstat 1 files changed, 10 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Sun Nov 18 22:45:43 2012 +0100
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Mon Nov 19 13:33:27 2012 +0100
@@ -79,7 +79,6 @@
     private ProfilingInfo profilingInfo;
 
     private BytecodeStream stream;           // the bytecode stream
-    private final LogStream log;
 
     private FrameStateBuilder frameState;          // the current execution state
     private Block currentBlock;
@@ -113,7 +112,6 @@
         this.graphBuilderConfig = graphBuilderConfig;
         this.optimisticOpts = optimisticOpts;
         this.runtime = runtime;
-        this.log = GraalOptions.TraceBytecodeParserLevel > 0 ? new LogStream(TTY.out()) : null;
         assert runtime != null;
     }
 
@@ -131,7 +129,12 @@
         methodSynchronizedObject = null;
         this.currentGraph = graph;
         this.frameState = new FrameStateBuilder(method, graph, graphBuilderConfig.eagerResolving());
-        build();
+        TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, method);
+        try {
+            build();
+        } finally {
+            filter.remove();
+        }
     }
 
     @Override
@@ -148,11 +151,6 @@
     }
 
     private void build() {
-        if (log != null) {
-            log.println();
-            log.println("Compiling " + method);
-        }
-
         if (GraalOptions.PrintProfilingInformation) {
             TTY.println("Profiling info for " + method);
             TTY.println(MetaUtil.indent(MetaUtil.profileToString(profilingInfo, method, CodeUtil.NEW_LINE), "  "));
@@ -1533,14 +1531,14 @@
 
     private void traceState() {
         if (GraalOptions.TraceBytecodeParserLevel >= TRACELEVEL_STATE && !TTY.isSuppressed()) {
-            log.println(String.format("|   state [nr locals = %d, stack depth = %d, method = %s]", frameState.localsSize(), frameState.stackSize(), method));
+            TTY.println(String.format("|   state [nr locals = %d, stack depth = %d, method = %s]", frameState.localsSize(), frameState.stackSize(), method));
             for (int i = 0; i < frameState.localsSize(); ++i) {
                 ValueNode value = frameState.localAt(i);
-                log.println(String.format("|   local[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().getJavaName(), value));
+                TTY.println(String.format("|   local[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().getJavaName(), value));
             }
             for (int i = 0; i < frameState.stackSize(); ++i) {
                 ValueNode value = frameState.stackAt(i);
-                log.println(String.format("|   stack[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().getJavaName(), value));
+                TTY.println(String.format("|   stack[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().getJavaName(), value));
             }
         }
     }
@@ -1774,7 +1772,7 @@
             if (!currentBlock.jsrScope.isEmpty()) {
                 sb.append(' ').append(currentBlock.jsrScope);
             }
-            log.println(sb.toString());
+            TTY.println(sb.toString());
         }
     }