[pypy-svn] r25534 - in pypy/branch/stacklesscfg/pypy/translator/stackless: . test

hpk at codespeak.net hpk at codespeak.net
Sat Apr 8 10:33:15 CEST 2006


Author: hpk
Date: Sat Apr  8 10:33:14 2006
New Revision: 25534

Modified:
   pypy/branch/stacklesscfg/pypy/translator/stackless/test/test_transform.py
   pypy/branch/stacklesscfg/pypy/translator/stackless/transform.py
Log:
checkgraph() on the transformed graphs works 
(but something is still not quite right) 


Modified: pypy/branch/stacklesscfg/pypy/translator/stackless/test/test_transform.py
==============================================================================
--- pypy/branch/stacklesscfg/pypy/translator/stackless/test/test_transform.py	(original)
+++ pypy/branch/stacklesscfg/pypy/translator/stackless/test/test_transform.py	Sat Apr  8 10:33:14 2006
@@ -41,10 +41,8 @@
     st = StacklessTransfomer(t)
     st.transform_graph(graphof(t, example))
     st.transform_graph(graphof(t, g))
-    st.transform_graph(graphof(t, check))
-    #for graph in t.graphs: 
-        #checkgraph(graph) # XXX
-        #st.transform_graph(graph)
+    for graph in t.graphs: 
+        checkgraph(graph) # XXX
     example_graph = graphof(t, example)
     if conftest.option.view:
         t.view()

Modified: pypy/branch/stacklesscfg/pypy/translator/stackless/transform.py
==============================================================================
--- pypy/branch/stacklesscfg/pypy/translator/stackless/transform.py	(original)
+++ pypy/branch/stacklesscfg/pypy/translator/stackless/transform.py	Sat Apr  8 10:33:14 2006
@@ -7,6 +7,7 @@
 from pypy.annotation import model as annmodel
 from pypy.rpython.annlowlevel import MixLevelHelperAnnotator
 from pypy.translator.stackless import code 
+from pypy.rpython.rclass import getinstancerepr
 
 STORAGE_TYPES = [llmemory.Address,
                  lltype.Signed,
@@ -141,14 +142,16 @@
 
                 var_unwind_exception = varoftype(evalue)
                 
-                save_block = self.generate_save_block(link.args, var_unwind_exception)
+                save_block = self.generate_save_block(
+                                link.args, var_unwind_exception)
 
                 newlink = model.Link(link.args + [var_unwind_exception], 
                                      save_block, code.UnwindException)
-                r_case = rclass.get_type_repr(self.translator.rtyper)
-                newlink.llexitcase = r_case.convert_const(newlink.exitcase)
                 block.exitswitch = model.c_last_exception
+                newlink.last_exception = model.Constant(code.UnwindException) 
+                newlink.last_exc_value = var_unwind_exception 
                 block.recloseblock(link, newlink) # exits.append(newlink)
+                self.translator.rtyper._convert_link(block, newlink)
     # ARGH ... 
 
                 block = after_block
@@ -161,8 +164,6 @@
         etype = edata.lltype_of_exception_type
         evalue = edata.lltype_of_exception_value
         inputargs = [copyvar(self.translator, v) for v in varstosave]
-        var_unwind_exception0 = copyvar(self.translator, var_unwind_exception)
-        from pypy.rpython.rclass import getinstancerepr
         var_unwind_exception = varoftype(getinstancerepr(self.translator.rtyper,
             self.translator.annotator.bookkeeper.getuniqueclassdef(
                 code.UnwindException)).lowleveltype)
@@ -202,7 +203,8 @@
                                             [var_unwind_exception, model.Constant("frame", lltype.Void)],
                                             varoftype(lltype.Void)))
 
-        save_state_block.closeblock(model.Link([varoftype(etype), varoftype(evalue)],
+        save_state_block.closeblock(model.Link([model.Constant(code.UnwindException), 
+                                                var_unwind_exception], 
                                                self.curr_graph.exceptblock))
 
         return save_state_block



More information about the Pypy-commit mailing list