Author: Ronan Lamy <[email protected]>
Branch: kill-flowobjspace
Changeset: r60855:1edcfb140754
Date: 2013-02-04 00:00 +0000
http://bitbucket.org/pypy/pypy/changeset/1edcfb140754/
Log: kill FSFrame.pushrevvalues() and .peekvalues()
diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py
--- a/rpython/flowspace/flowcontext.py
+++ b/rpython/flowspace/flowcontext.py
@@ -360,11 +360,6 @@
"peek past the bottom of the stack")
return self.locals_stack_w[index]
- def pushrevvalues(self, n, values_w): # n should be len(values_w)
- assert len(values_w) == n
- for i in range(n - 1, -1, -1):
- self.pushvalue(values_w[i])
-
def settopvalue(self, w_object, index_from_top=0):
index = self.valuestackdepth + ~index_from_top
assert index >= self.pycode.co_nlocals, (
@@ -376,16 +371,6 @@
values_w.reverse()
return values_w
- def peekvalues(self, n):
- values_w = [None] * n
- base = self.valuestackdepth - n
- while True:
- n -= 1
- if n < 0:
- break
- values_w[n] = self.locals_stack_w[base+n]
- return values_w
-
def dropvalues(self, n):
finaldepth = self.valuestackdepth - n
for n in range(finaldepth, self.valuestackdepth):
@@ -1020,7 +1005,8 @@
def UNPACK_SEQUENCE(self, itemcount, next_instr):
w_iterable = self.popvalue()
items = self.space.unpack_sequence(w_iterable, itemcount)
- self.pushrevvalues(itemcount, items)
+ for w_item in reversed(items):
+ self.pushvalue(w_item)
def slice(self, w_start, w_end):
w_obj = self.popvalue()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit