Author: Maciej Fijalkowski <[email protected]>
Branch: result-in-resops
Changeset: r58359:057749160f2e
Date: 2012-10-22 16:04 +0200
http://bitbucket.org/pypy/pypy/changeset/057749160f2e/

Log:    pass the first backend test

diff --git a/pypy/jit/backend/llgraph/runner.py 
b/pypy/jit/backend/llgraph/runner.py
--- a/pypy/jit/backend/llgraph/runner.py
+++ b/pypy/jit/backend/llgraph/runner.py
@@ -47,8 +47,8 @@
                                        map(mapping, op.getarglist()),
                                        mapping(op.result),
                                        newdescr)
-            if op.getfailargs() is not None:
-                newop.setfailargs(map(mapping, op.getfailargs()))
+            if op.get_failargs() is not None:
+                newop.setfailargs(map(mapping, op.get_failargs()))
             self.operations.append(newop)
 
 class WeakrefDescr(AbstractDescr):
@@ -674,7 +674,7 @@
                     i = 0
                     self.lltrace = gf.descr._llgraph_bridge
                     newargs = [self.env[arg] for arg in
-                               self.current_op.getfailargs() if arg is not 
None]
+                              self.current_op.get_failargs() if arg is not 
None]
                     self.do_renaming(self.lltrace.inputargs, newargs)
                     continue
                 raise
@@ -697,7 +697,7 @@
         if op is None:
             op = self.current_op
         r = []
-        for arg in op.getfailargs():
+        for arg in op.get_failargs():
             if arg is None:
                 r.append(None)
             elif arg is skip:
@@ -719,7 +719,7 @@
         raise GuardFailed(self._getfailargs(), descr)
 
     def execute_finish(self, descr, arg=None):
-        if self.current_op.getfailargs() is not None:
+        if self.current_op.get_failargs() is not None:
             failargs = self._getfailargs()
         else:
             failargs = None   # compatibility
diff --git a/pypy/jit/backend/test/runner_test.py 
b/pypy/jit/backend/test/runner_test.py
--- a/pypy/jit/backend/test/runner_test.py
+++ b/pypy/jit/backend/test/runner_test.py
@@ -9,7 +9,6 @@
 from pypy.jit.metainterp.typesystem import deref
 from pypy.jit.codewriter.effectinfo import EffectInfo
 from pypy.rpython.lltypesystem import lltype, llmemory, rstr, rffi, rclass
-from pypy.rpython.ootypesystem import ootype
 from pypy.rpython.annlowlevel import llhelper
 from pypy.rpython.llinterp import LLException
 from pypy.jit.codewriter import heaptracker, longlong
@@ -125,7 +124,7 @@
             namespace['faildescr3'] = BasicFailDescr(3)
         if 'faildescr4' not in namespace:
             namespace['faildescr4'] = BasicFailDescr(4)
-        loop = parse(s, namespace=namespace)
+        loop = parse(s, namespace=namespace, guards_with_failargs=True)
         return loop.inputargs, loop.operations, JitCellToken()
 
     def test_compile_linear_loop(self):
@@ -133,7 +132,7 @@
         inputargs, ops, token = self.parse("""
         [i0]
         i1 = int_add(i0, 1)
-        finish(i1, descr=faildescr)
+        finish(i1, descr=faildescr) []
         """, namespace=locals())
         self.cpu.compile_loop(inputargs, ops, token)
         frame = self.cpu.execute_token(token, 2)
diff --git a/pypy/jit/metainterp/optmodel.py b/pypy/jit/metainterp/optmodel.py
--- a/pypy/jit/metainterp/optmodel.py
+++ b/pypy/jit/metainterp/optmodel.py
@@ -3,7 +3,7 @@
 """
 
 from pypy.tool.sourcetools import func_with_new_name
-from pypy.jit.metainterp.resoperation import opclasses, opclasses_mutable
+from pypy.jit.metainterp.resoperation import opclasses, opclasses_mutable, rop
 
 def create_mutable_subclasses():
     def addattr(cls, attr, default_value=None):
@@ -21,7 +21,7 @@
         else:
             class Mutable(cls):
                 is_mutable = True
-            if cls.is_guard():
+            if cls.is_guard() or cls.getopnum() == rop.FINISH:
                 addattr(Mutable, 'failargs')
             Mutable.__name__ = cls.__name__ + '_mutable'
         assert len(opclasses_mutable) == i
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to