[pypy-svn] r65441 - pypy/branch/pyjitpl5-experiments/pypy/interpreter
fijal at codespeak.net
fijal at codespeak.net
Tue May 26 23:51:10 CEST 2009
Author: fijal
Date: Tue May 26 23:51:09 2009
New Revision: 65441
Modified:
pypy/branch/pyjitpl5-experiments/pypy/interpreter/pyframe.py
Log:
Move hints around.
Modified: pypy/branch/pyjitpl5-experiments/pypy/interpreter/pyframe.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/interpreter/pyframe.py (original)
+++ pypy/branch/pyjitpl5-experiments/pypy/interpreter/pyframe.py Tue May 26 23:51:09 2009
@@ -181,6 +181,7 @@
return values_w
def dropvalues(self, n):
+ n = hint(n, promote=True)
finaldepth = self.valuestackdepth - n
assert finaldepth >= 0, "stack underflow in dropvalues()"
while True:
@@ -188,7 +189,7 @@
if n < 0:
break
self.valuestack_w[finaldepth+n] = None
- self.valuestackdepth = hint(finaldepth, promote=True)
+ self.valuestackdepth = finaldepth
def pushrevvalues(self, n, values_w): # n should be len(values_w)
while True:
@@ -207,21 +208,24 @@
self.pushvalue(w_value)
def peekvalue(self, index_from_top=0):
+ index_from_top = hint(index_from_top, promote=True)
index = self.valuestackdepth + ~index_from_top
assert index >= 0, "peek past the bottom of the stack"
return self.valuestack_w[index]
def settopvalue(self, w_object, index_from_top=0):
+ index_from_top = hint(index_from_top, promote=True)
index = self.valuestackdepth + ~index_from_top
assert index >= 0, "settop past the bottom of the stack"
self.valuestack_w[index] = w_object
def dropvaluesuntil(self, finaldepth):
depth = self.valuestackdepth - 1
+ finaldepth = hint(finaldepth, promote=True)
while depth >= finaldepth:
self.valuestack_w[depth] = None
depth -= 1
- self.valuestackdepth = hint(finaldepth, promote=True)
+ self.valuestackdepth = finaldepth
def savevaluestack(self):
return self.valuestack_w[:self.valuestackdepth]
More information about the Pypy-commit
mailing list