[pypy-commit] pypy dynamic-specialized-tuple: promote the shape of a tuple on a read when the index is constant
alex_gaynor
noreply at buildbot.pypy.org
Wed Apr 25 15:19:39 CEST 2012
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: dynamic-specialized-tuple
Changeset: r54747:e0f2cfe66872
Date: 2012-04-25 09:19 -0400
http://bitbucket.org/pypy/pypy/changeset/e0f2cfe66872/
Log: promote the shape of a tuple on a read when the index is constant
diff --git a/pypy/jit/codewriter/jtransform.py b/pypy/jit/codewriter/jtransform.py
--- a/pypy/jit/codewriter/jtransform.py
+++ b/pypy/jit/codewriter/jtransform.py
@@ -496,7 +496,6 @@
def rewrite_op_hint(self, op):
hints = op.args[1].value
if hints.get('promote') and op.args[0].concretetype is not lltype.Void:
- assert op.args[0].concretetype != lltype.Ptr(rstr.STR)
kind = getkind(op.args[0].concretetype)
op0 = SpaceOperation('-live-', [], None)
op1 = SpaceOperation('%s_guard_value' % kind, [op.args[0]], None)
diff --git a/pypy/objspace/std/tupleobject.py b/pypy/objspace/std/tupleobject.py
--- a/pypy/objspace/std/tupleobject.py
+++ b/pypy/objspace/std/tupleobject.py
@@ -49,6 +49,8 @@
def getitem(self, space, i):
from pypy.objspace.std.tupletype import read_obj
+ if jit.isconstant(i):
+ jit.promote(self.tuplestorage.getshape())
return read_obj(space, self.tuplestorage, i)
registerimplementation(W_TupleObject)
More information about the pypy-commit
mailing list