Author: Ronan Lamy <[email protected]>
Branch: less-stringly-ops
Changeset: r67071:b5e9fabfc2a4
Date: 2013-09-23 04:45 +0100
http://bitbucket.org/pypy/pypy/changeset/b5e9fabfc2a4/
Log: remove some uses of FSFrame.do_operation()
diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py
--- a/rpython/flowspace/flowcontext.py
+++ b/rpython/flowspace/flowcontext.py
@@ -715,7 +715,7 @@
def PRINT_ITEM(self, oparg):
w_item = self.popvalue()
- w_s = self.do_operation('str', w_item)
+ w_s = self.space.str(w_item)
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
@@ -160,7 +160,7 @@
if not self.frame.guessbool(self.bool(w_correct)):
w_exc = self.exc_from_raise(self.w_ValueError, self.w_None)
raise Raise(w_exc)
- return [self.frame.do_operation('getitem', w_iterable, const(i))
+ return [self.getitem(w_iterable, const(i))
for i in range(expected_length)]
# ____________________________________________________________
@@ -199,7 +199,7 @@
def appcall(self, func, *args_w):
"""Call an app-level RPython function directly"""
w_func = const(func)
- return self.frame.do_operation('simple_call', w_func, *args_w)
+ return op.simple_call(w_func, *args_w).eval(self.frame)
def call(self, w_callable, args):
if isinstance(w_callable, Constant):
diff --git a/rpython/flowspace/specialcase.py b/rpython/flowspace/specialcase.py
--- a/rpython/flowspace/specialcase.py
+++ b/rpython/flowspace/specialcase.py
@@ -34,14 +34,12 @@
def sc_isinstance(space, w_instance, w_type):
if w_instance.foldable() and w_type.foldable():
return const(isinstance(w_instance.value, w_type.value))
- return space.frame.do_operation('simple_call', const(isinstance),
- w_instance, w_type)
+ return space.appcall(isinstance, w_instance, w_type)
@register_flow_sc(getattr)
def sc_getattr(space, w_obj, w_index, w_default=None):
if w_default is not None:
- return space.frame.do_operation('simple_call', const(getattr), w_obj,
- w_index, w_default)
+ return space.appcall(getattr, w_obj, w_index, w_default)
else:
return space.getattr(w_obj, w_index)
diff --git a/rpython/rlib/rarithmetic.py b/rpython/rlib/rarithmetic.py
--- a/rpython/rlib/rarithmetic.py
+++ b/rpython/rlib/rarithmetic.py
@@ -521,7 +521,7 @@
# show up in the flow graphs at all)
if isinstance(w_value, Constant):
return Constant(r_uint(w_value.value))
- return space.frame.do_operation('simple_call', const(r_uint), w_value)
+ return space.appcall(r_uint, w_value)
r_longlong = build_int('r_longlong', True, 64)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit