Author: Armin Rigo <[email protected]>
Branch: release-2.0.x
Changeset: r63916:eb5983d848f1
Date: 2013-05-08 17:38 +0200
http://bitbucket.org/pypy/pypy/changeset/eb5983d848f1/
Log: Fixes the test, but maybe makes things slower. (transplanted from
3fb0e6c27959e20cb2b71acebaea47846f24fa86)
diff --git a/rpython/translator/backendopt/graphanalyze.py
b/rpython/translator/backendopt/graphanalyze.py
--- a/rpython/translator/backendopt/graphanalyze.py
+++ b/rpython/translator/backendopt/graphanalyze.py
@@ -207,26 +207,29 @@
self.graph_results = analyzer._analyzed_calls
# the current stack of graphs being analyzed
self.current_stack = []
- self.current_stack_set = set()
+ #self.current_stack_set = set()
def enter(self, graph):
if graph not in self.graph_results:
self.current_stack.append(graph)
- self.current_stack_set.add(graph)
+ #self.current_stack_set.add(graph)
self.graph_results.find(graph)
return True
else:
- if graph in self.current_stack_set:
- # found a cycle; merge all graphs in that cycle
- i = len(self.current_stack) - 1
- while self.current_stack[i] is not graph:
- self.graph_results.union(self.current_stack[i], graph)
- i -= 1
+ graph = self.graph_results.find_rep(graph)
+ for j in range(len(self.current_stack)):
+ othergraph = self.graph_results.find_rep(self.current_stack[j])
+ if graph is othergraph:
+ # found a cycle; merge all graphs in that cycle
+ for i in range(j, len(self.current_stack)):
+ self.graph_results.union(self.current_stack[i], graph)
+ # done
+ break
return False
def leave_with(self, result):
graph = self.current_stack.pop()
- self.current_stack_set.remove(graph)
+ #self.current_stack_set.remove(graph)
dep = self.graph_results[graph]
dep.merge_with_result(result)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit