Author: Armin Rigo <[email protected]>
Branch:
Changeset: r48626:6b10f883bb6a
Date: 2011-10-31 17:48 +0100
http://bitbucket.org/pypy/pypy/changeset/6b10f883bb6a/
Log: Fix and refactor passing translation options. Fixes test_rerased.
diff --git a/pypy/jit/metainterp/test/test_ajit.py
b/pypy/jit/metainterp/test/test_ajit.py
--- a/pypy/jit/metainterp/test/test_ajit.py
+++ b/pypy/jit/metainterp/test/test_ajit.py
@@ -3641,7 +3641,9 @@
o = o.dec()
pc += 1
return pc
- res = self.meta_interp(main, [False, 100, True], taggedpointers=True)
+ topt = {'taggedpointers': True}
+ res = self.meta_interp(main, [False, 100, True],
+ translationoptions=topt)
def test_rerased(self):
eraseX, uneraseX = rerased.new_erasing_pair("X")
@@ -3666,10 +3668,11 @@
else:
return rerased.unerase_int(e)
#
- x = self.interp_operations(f, [-128, 0], taggedpointers=True)
+ topt = {'taggedpointers': True}
+ x = self.interp_operations(f, [-128, 0], translationoptions=topt)
assert x == -128
bigint = sys.maxint//2 + 1
- x = self.interp_operations(f, [bigint, 0], taggedpointers=True)
+ x = self.interp_operations(f, [bigint, 0], translationoptions=topt)
assert x == -42
- x = self.interp_operations(f, [1000, 1], taggedpointers=True)
+ x = self.interp_operations(f, [1000, 1], translationoptions=topt)
assert x == 999
diff --git a/pypy/jit/metainterp/warmspot.py b/pypy/jit/metainterp/warmspot.py
--- a/pypy/jit/metainterp/warmspot.py
+++ b/pypy/jit/metainterp/warmspot.py
@@ -48,13 +48,13 @@
translator.warmrunnerdesc = warmrunnerdesc # for later debugging
def ll_meta_interp(function, args, backendopt=False, type_system='lltype',
- listcomp=False, **kwds):
+ listcomp=False, translationoptions={}, **kwds):
if listcomp:
extraconfigopts = {'translation.list_comprehension_operations': True}
else:
extraconfigopts = {}
- if kwds.pop("taggedpointers", False):
- extraconfigopts["translation.taggedpointers"] = True
+ for key, value in translationoptions.items():
+ extraconfigopts['translation.' + key] = value
interp, graph = get_interpreter(function, args,
backendopt=False, # will be done below
type_system=type_system,
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit