[pypy-svn] r65849 - pypy/branch/pyjitpl5/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Sun Jun 21 17:45:30 CEST 2009


Author: arigo
Date: Sun Jun 21 17:45:28 2009
New Revision: 65849

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
Log:
Reuse the raise_analyzer instead of making a new one for each graph.


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	Sun Jun 21 17:45:28 2009
@@ -93,6 +93,7 @@
         self.policy = policy
         self.ts = ts
         self.counter = 0
+        self.raise_analyzer = RaiseAnalyzer(self.rtyper.annotator.translator)
 
     def make_portal_bytecode(self, graph):
         log.info("making JitCodes...")
@@ -270,8 +271,6 @@
             assert not portal, "portal has been hidden!"
             graph = make_calling_stub(codewriter.rtyper, graph)
         self.graph = graph
-        self.translator = self.cpu.rtyper.annotator.translator
-        self.raise_analyzer = RaiseAnalyzer(self.translator)
 
     def assemble(self):
         """Assemble the opcodes for self.bytecode."""
@@ -976,7 +975,7 @@
             func = getattr(get_funcobj(op.args[0].value), '_callable', None)
             pure = getattr(func, "_pure_function_", False)
         try:
-            canraise = self.raise_analyzer.can_raise(op)
+            canraise = self.codewriter.raise_analyzer.can_raise(op)
         except lltype.DelayedPointer:
             canraise = True  # if we need to look into the delayed ptr that is
                              # the portal, then it's certainly going to raise



More information about the Pypy-commit mailing list