changeset 19900:b1a15754f63e

Assign result maps in schedule phase earlier to have better context in case of exceptions.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 17 Mar 2015 17:12:47 +0100
parents bce741b26b84
children c5c1c2de3cb8
files graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Tue Mar 17 16:17:30 2015 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Tue Mar 17 17:12:47 2015 +0100
@@ -94,6 +94,7 @@
         cfg = ControlFlowGraph.compute(graph, true, true, true, false);
 
         if (selectedStrategy == SchedulingStrategy.EARLIEST) {
+            // Assign early so we are getting a context in case of an exception.
             this.nodeToBlockMap = graph.createNodeMap();
             this.blockToNodesMap = new BlockMap<>(cfg);
             NodeBitMap visited = graph.createNodeBitMap();
@@ -105,6 +106,11 @@
                 NodeMap<Block> currentNodeMap = graph.createNodeMap();
                 BlockMap<List<Node>> earliestBlockToNodesMap = new BlockMap<>(cfg);
                 NodeBitMap visited = graph.createNodeBitMap();
+
+                // Assign early so we are getting a context in case of an exception.
+                this.blockToNodesMap = earliestBlockToNodesMap;
+                this.nodeToBlockMap = currentNodeMap;
+
                 scheduleEarliestIterative(cfg, earliestBlockToNodesMap, currentNodeMap, visited, graph);
                 BlockMap<List<Node>> latestBlockToNodesMap = new BlockMap<>(cfg);