[pypy-svn] r20959 - in pypy/dist/pypy/jit: . test
mwh at codespeak.net
mwh at codespeak.net
Fri Dec 9 18:24:23 CET 2005
Author: mwh
Date: Fri Dec 9 18:24:22 2005
New Revision: 20959
Modified:
pypy/dist/pypy/jit/llabstractinterp.py
pypy/dist/pypy/jit/test/test_jit_tl.py
Log:
delete code and the test passes!
extend the test and it still passes!
Modified: pypy/dist/pypy/jit/llabstractinterp.py
==============================================================================
--- pypy/dist/pypy/jit/llabstractinterp.py (original)
+++ pypy/dist/pypy/jit/llabstractinterp.py Fri Dec 9 18:24:22 2005
@@ -136,19 +136,12 @@
def applyhint(self, args_a, origblock):
result_a = []
- if origblock.operations == ():
- # make sure args_s does *not* contain LLConcreteValues
- for a in args_a:
- if isinstance(a, LLConcreteValue):
- a = LLRuntimeValue(orig_v=a.getvarorconst())
- result_a.append(a)
- else:
- # apply the hints to make more LLConcreteValues
- for a, origv in zip(args_a, origblock.inputargs):
- if origv in self.hints:
- # use the hint, ignore the source binding
- a = LLConcreteValue(self.hints[origv])
- result_a.append(a)
+ # apply the hints to make more LLConcreteValues
+ for a, origv in zip(args_a, origblock.inputargs):
+ if origv in self.hints:
+ # use the hint, ignore the source binding
+ a = LLConcreteValue(self.hints[origv])
+ result_a.append(a)
return result_a
def schedule_graph(self, args_a, origgraph):
Modified: pypy/dist/pypy/jit/test/test_jit_tl.py
==============================================================================
--- pypy/dist/pypy/jit/test/test_jit_tl.py (original)
+++ pypy/dist/pypy/jit/test/test_jit_tl.py Fri Dec 9 18:24:22 2005
@@ -4,7 +4,7 @@
from pypy.jit import tl
from pypy.jit.llabstractinterp import LLAbstractInterp
from pypy.rpython.rstr import string_repr
-
+from pypy.rpython.llinterp import LLInterpreter
def jit_tl(code):
t = TranslationContext()
@@ -16,12 +16,17 @@
interp = LLAbstractInterp()
hints = {graph1.getargs()[0]: string_repr.convert_const(code),
graph1.getargs()[1]: 0}
-
graph2 = interp.eval(graph1, hints)
- graph2.show()
+
+ llinterp = LLInterpreter(rtyper)
+ result1 = llinterp.eval_graph(graph1, [string_repr.convert_const(code), 0])
+ result2 = llinterp.eval_graph(graph2, [])
+
+ assert result1 == result2
+ #graph2.show()
-def INPROGRESS_test_jit_tl_1():
+def test_jit_tl_1():
code = tl.compile("""
PUSH 42
""")
More information about the Pypy-commit
mailing list