Author: Maciej Fijalkowski <[email protected]>
Branch: kill-gen-store-back-in
Changeset: r62810:35b3b5b239b5
Date: 2013-03-26 10:24 -0700
http://bitbucket.org/pypy/pypy/changeset/35b3b5b239b5/
Log: some fixes for tests, not done yet
diff --git a/rpython/jit/backend/llgraph/runner.py
b/rpython/jit/backend/llgraph/runner.py
--- a/rpython/jit/backend/llgraph/runner.py
+++ b/rpython/jit/backend/llgraph/runner.py
@@ -101,6 +101,9 @@
self.fieldname = fieldname
self.FIELD = getattr(S, fieldname)
+ def get_vinfo(self):
+ return self.vinfo
+
def __repr__(self):
return 'FieldDescr(%r, %r)' % (self.S, self.fieldname)
@@ -170,7 +173,7 @@
translate_support_code = False
is_llgraph = True
- def __init__(self, rtyper, stats=None, *ignored_args, **ignored_kwds):
+ def __init__(self, rtyper, stats=None, *ignored_args, **kwds):
model.AbstractCPU.__init__(self)
self.rtyper = rtyper
self.llinterp = LLInterpreter(rtyper)
@@ -178,6 +181,7 @@
class MiniStats:
pass
self.stats = stats or MiniStats()
+ self.vinfo_for_tests = kwds.get('vinfo_for_tests', None)
def compile_loop(self, inputargs, operations, looptoken, log=True,
name=''):
clt = model.CompiledLoopToken(self, looptoken.number)
@@ -267,6 +271,15 @@
assert isinstance(frame, LLFrame)
assert frame.forced_deadframe is None
values = []
+ if frame.force_guard_op is None:
+ if frame.current_op.opnum == rop.FINISH:
+ values = [frame.env[arg] for arg in
+ frame.current_op.getarglist()]
+ else:
+ xxx
+ frame.forced_deadframe = LLDeadFrame(
+ _getdescr(frame.current_op), values)
+ return frame.forced_deadframe
for box in frame.force_guard_op.getfailargs():
if box is not None:
if box is not frame.current_op.result:
@@ -316,6 +329,8 @@
except KeyError:
descr = FieldDescr(S, fieldname)
self.descrs[key] = descr
+ if self.vinfo_for_tests is not None:
+ descr.vinfo = self.vinfo_for_tests
return descr
def arraydescrof(self, A):
@@ -587,6 +602,7 @@
forced_deadframe = None
overflow_flag = False
last_exception = None
+ force_guard_op = None
def __init__(self, cpu, argboxes, args):
self.env = {}
diff --git a/rpython/jit/metainterp/pyjitpl.py
b/rpython/jit/metainterp/pyjitpl.py
--- a/rpython/jit/metainterp/pyjitpl.py
+++ b/rpython/jit/metainterp/pyjitpl.py
@@ -2214,7 +2214,7 @@
# contents of the virtualizable should be generally correct
self.history.record(rop.FORCE_TOKEN, [], force_token_box)
self.history.record(rop.SETFIELD_GC, [vbox, force_token_box],
- None, descr=vinfo.vable_token_descr)
+ None, descr=vinfo.vable_token_descr)
def compile_exit_frame_with_exception(self, valuebox):
self.store_token_in_vable()
diff --git a/rpython/jit/metainterp/test/test_virtualizable.py
b/rpython/jit/metainterp/test/test_virtualizable.py
--- a/rpython/jit/metainterp/test/test_virtualizable.py
+++ b/rpython/jit/metainterp/test/test_virtualizable.py
@@ -1431,7 +1431,15 @@
pass
-class TestLLtype(ExplicitVirtualizableTests,
- ImplicitVirtualizableTests,
+class TestLLtype1(ExplicitVirtualizableTests,
LLJitMixin):
pass
+
+class TestLLtype2(ImplicitVirtualizableTests,
+ LLJitMixin):
+ def meta_interp(self, *args, **kwds):
+ class VInfo(object):
+ pass
+
+ kwds['vinfo_for_tests'] = VInfo()
+ return LLJitMixin.meta_interp(*args, **kwds)
diff --git a/rpython/jit/metainterp/warmstate.py
b/rpython/jit/metainterp/warmstate.py
--- a/rpython/jit/metainterp/warmstate.py
+++ b/rpython/jit/metainterp/warmstate.py
@@ -304,14 +304,15 @@
def execute_assembler(loop_token, *args):
# Call the backend to run the 'looptoken' with the given
# input args.
- deadframe = func_execute_token(loop_token, *args)
+
+ # If we have a virtualizable, we have to clear its
+ # state, to make sure we enter with vable_token being NONE
#
- # If we have a virtualizable, we have to reset its
- # 'vable_token' field afterwards
if vinfo is not None:
virtualizable = args[index_of_virtualizable]
- virtualizable = vinfo.cast_gcref_to_vtype(virtualizable)
- vinfo.reset_vable_token(virtualizable)
+ vinfo.clear_vable_token(virtualizable)
+
+ deadframe = func_execute_token(loop_token, *args)
#
# Record in the memmgr that we just ran this loop,
# so that it will keep it alive for a longer time
@@ -602,7 +603,7 @@
fn = support.maybe_on_top_of_llinterp(rtyper, inline_ptr)
return fn(*greenargs)
self.should_unroll_one_iteration = should_unroll_one_iteration
-
+
redargtypes = ''.join([kind[0] for kind in jd.red_args_types])
def get_assembler_token(greenkey):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit