[pypy-commit] pypy annotator: kill more FlowObjSpace methods

rlamy noreply at buildbot.pypy.org
Fri Jan 17 18:36:41 CET 2014


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: annotator
Changeset: r68735:e03a640bd053
Date: 2014-01-04 15:24 +0100
http://bitbucket.org/pypy/pypy/changeset/e03a640bd053/

Log:	kill more FlowObjSpace methods

diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py
--- a/rpython/flowspace/flowcontext.py
+++ b/rpython/flowspace/flowcontext.py
@@ -590,28 +590,28 @@
         self.pushvalue(self.not_(w_obj))
 
     def cmp_lt(self, w_1, w_2):
-        return self.space.lt(w_1, w_2)
+        return op.lt(w_1, w_2).eval(self)
 
     def cmp_le(self, w_1, w_2):
-        return self.space.le(w_1, w_2)
+        return op.le(w_1, w_2).eval(self)
 
     def cmp_eq(self, w_1, w_2):
-        return self.space.eq(w_1, w_2)
+        return op.eq(w_1, w_2).eval(self)
 
     def cmp_ne(self, w_1, w_2):
-        return self.space.ne(w_1, w_2)
+        return op.ne(w_1, w_2).eval(self)
 
     def cmp_gt(self, w_1, w_2):
-        return self.space.gt(w_1, w_2)
+        return op.gt(w_1, w_2).eval(self)
 
     def cmp_ge(self, w_1, w_2):
-        return self.space.ge(w_1, w_2)
+        return op.ge(w_1, w_2).eval(self)
 
     def cmp_in(self, w_1, w_2):
-        return self.space.contains(w_2, w_1)
+        return op.contains(w_2, w_1).eval(self)
 
     def cmp_not_in(self, w_1, w_2):
-        return self.not_(self.space.contains(w_2, w_1))
+        return self.not_(self.cmp_in(w_1, w_2))
 
     def cmp_is(self, w_1, w_2):
         return op.is_(w_1, w_2).eval(self)
@@ -714,7 +714,7 @@
 
     def PRINT_ITEM(self, oparg):
         w_item = self.popvalue()
-        w_s = self.space.str(w_item)
+        w_s = op.str(w_item).eval(self)
         self.space.appcall(rpython_print_item, w_s)
 
     def PRINT_NEWLINE(self, oparg):
diff --git a/rpython/flowspace/objspace.py b/rpython/flowspace/objspace.py
--- a/rpython/flowspace/objspace.py
+++ b/rpython/flowspace/objspace.py
@@ -126,7 +126,7 @@
                                 "separate value")
                 raise Raise(const(exc))
             w_value = w_arg1
-        w_type = self.type(w_value)
+        w_type = op.type(w_value).eval(frame)
         return FSException(w_type, w_value)
 
     def unpack_sequence(self, w_iterable, expected_length):
@@ -136,8 +136,8 @@
                 raise ValueError
             return [const(x) for x in l]
         else:
-            w_len = self.len(w_iterable)
-            w_correct = self.eq(w_len, const(expected_length))
+            w_len = op.len(w_iterable).eval(self.frame)
+            w_correct = op.eq(w_len, const(expected_length)).eval(self.frame)
             if not self.frame.guessbool(op.bool(w_correct).eval(self.frame)):
                 w_exc = self.exc_from_raise(self.w_ValueError, self.w_None)
                 raise Raise(w_exc)
@@ -209,9 +209,8 @@
         return const(value)
 
 
-for cls in [op.len, op.type, op.eq, op.ne, op.contains, op.getitem, op.getattr,
+for cls in [op.getitem, op.getattr,
             op.getslice, op.setslice, op.delslice, op.yield_, op.iter, op.next,
-            op.lt, op.gt, op.le, op.ge, op.str,
             op.newlist, op.newtuple, op.newdict, op.setitem, op.delitem]:
     if getattr(FlowObjSpace, cls.opname, None) is None:
         setattr(FlowObjSpace, cls.opname, cls.make_sc())


More information about the pypy-commit mailing list