[pypy-commit] pypy unify-call-ops: fix r_os_stat.py

rlamy noreply at buildbot.pypy.org
Sun May 25 04:16:36 CEST 2014


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: unify-call-ops
Changeset: r71723:8ca76f81be34
Date: 2014-05-25 03:14 +0100
http://bitbucket.org/pypy/pypy/changeset/8ca76f81be34/

Log:	fix r_os_stat.py

diff --git a/rpython/rtyper/module/r_os_stat.py b/rpython/rtyper/module/r_os_stat.py
--- a/rpython/rtyper/module/r_os_stat.py
+++ b/rpython/rtyper/module/r_os_stat.py
@@ -12,7 +12,6 @@
 from rpython.flowspace.model import Constant
 from rpython.flowspace.operation import op
 from rpython.tool.pairtype import pairtype
-from rpython.rtyper.rtyper import HighLevelOp
 from rpython.rtyper.rmodel import Repr
 from rpython.rtyper.rint import IntegerRepr
 from rpython.rtyper.error import TyperError
@@ -36,10 +35,14 @@
 
     def redispatch_getfield(self, hop, index):
         rtyper = self.rtyper
+        s_index = rtyper.annotator.bookkeeper.immutablevalue(index)
+        hop2 = hop.copy()
         spaceop = op.getitem(hop.args_v[0], Constant(index))
         spaceop.result = hop.spaceop.result
-        hop2 = HighLevelOp(rtyper, spaceop, hop.exceptionlinks[:], hop.llops[:])
-        hop2.setup()
+        hop2.spaceop = spaceop
+        hop2.args_v = spaceop.args
+        hop2.args_s = [self.s_tuple, s_index]
+        hop2.args_r = [self.r_tuple, rtyper.getrepr(s_index)]
         return hop2.dispatch()
 
     def rtype_getattr(self, hop):
@@ -86,10 +89,13 @@
     def redispatch_getfield(self, hop, index):
         rtyper = self.rtyper
         s_index = rtyper.annotator.bookkeeper.immutablevalue(index)
+        hop2 = hop.copy()
         spaceop = op.getitem(hop.args_v[0], Constant(index))
-        spaceop.result = hop.spaceop.result
-        hop2 = HighLevelOp(rtyper, spaceop, hop.exceptionlinks[:], hop.llops[:])
-        hop2.setup()
+        spaceop.result = hop.result
+        hop2.spaceop = spaceop
+        hop2.args_v = spaceop.args
+        hop2.args_s = [self.s_tuple, s_index]
+        hop2.args_r = [self.r_tuple, rtyper.getrepr(s_index)]
         return hop2.dispatch()
 
     def rtype_getattr(self, hop):


More information about the pypy-commit mailing list