[pypy-svn] r60281 - in pypy/branch/oo-jit/pypy/jit: rainbow/test tl
antocuni at codespeak.net
antocuni at codespeak.net
Tue Dec 2 16:24:27 CET 2008
Author: antocuni
Date: Tue Dec 2 16:24:27 2008
New Revision: 60281
Modified:
pypy/branch/oo-jit/pypy/jit/rainbow/test/test_0tlc.py
pypy/branch/oo-jit/pypy/jit/tl/tlc.py
Log:
simplify a bit the code, and make the test more robust (as there could be a
malloc/new hidden inside a direct_call to a helper)
Modified: pypy/branch/oo-jit/pypy/jit/rainbow/test/test_0tlc.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/rainbow/test/test_0tlc.py (original)
+++ pypy/branch/oo-jit/pypy/jit/rainbow/test/test_0tlc.py Tue Dec 2 16:24:27 2008
@@ -96,7 +96,7 @@
[bytecode, 0, 0, pool.strlists],
policy=P_OOPSPEC)
assert res == 42
- self.check_insns(malloc=1)
+ self.check_insns(malloc=1, direct_call=0)
Modified: pypy/branch/oo-jit/pypy/jit/tl/tlc.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/tl/tlc.py (original)
+++ pypy/branch/oo-jit/pypy/jit/tl/tlc.py Tue Dec 2 16:24:27 2008
@@ -59,15 +59,14 @@
attributes = {} # attrname -> index
for name in attrlist:
attributes[name] = len(attributes)
- self.attributes = hint(attributes, deepfreeze=True)
- self.length = len(attributes)
+ self.attributes = attributes
class InstanceObj(Obj):
def __init__(self, cls):
self.cls = cls
- cls2 = hint(cls, deepfreeze=True)
- self.values = [nil] * cls2.length
+ frozenclass = hint(cls, deepfreeze=True)
+ self.values = [nil] * len(frozenclass.attributes)
def getclass(self):
# promote and deepfreeze the class
@@ -188,8 +187,7 @@
def interp_eval(code, pc, inputarg, pool2=ConstantPool()):
code_len = len(code)
stack = []
- pool3 = hint(pool2, concrete=True)
- pool = hint(pool3, deepfreeze=True)
+ pool = hint(hint(pool2, concrete=True), deepfreeze=True)
while pc < code_len:
hint(None, global_merge_point=True)
More information about the Pypy-commit
mailing list