Author: Armin Rigo <[email protected]>
Branch: continulet-jit-3
Changeset: r58217:09931a069bf1
Date: 2012-10-18 16:26 +0200
http://bitbucket.org/pypy/pypy/changeset/09931a069bf1/
Log: Fix half of call_assembler. Fast path needs more thinking.
diff --git a/pypy/jit/backend/llgraph/runner.py
b/pypy/jit/backend/llgraph/runner.py
--- a/pypy/jit/backend/llgraph/runner.py
+++ b/pypy/jit/backend/llgraph/runner.py
@@ -766,31 +766,12 @@
return support.cast_result(descr.RESULT, result)
def execute_call_assembler(self, descr, *args):
- faildescr = self.cpu._execute_token(descr, *args)
+ frame = self.cpu._execute_token(descr, *args)
jd = descr.outermost_jitdriver_sd
- if jd.index_of_virtualizable != -1:
- vable = args[jd.index_of_virtualizable]
- else:
- vable = lltype.nullptr(llmemory.GCREF.TO)
- #
- # Emulate the fast path
- failindex = self.cpu.get_fail_descr_number(faildescr)
- if failindex == self.cpu.done_with_this_frame_int_v:
- self._reset_vable(jd, vable)
- return self.cpu.get_latest_value_int(0)
- if failindex == self.cpu.done_with_this_frame_ref_v:
- self._reset_vable(jd, vable)
- return self.cpu.get_latest_value_ref(0)
- if failindex == self.cpu.done_with_this_frame_float_v:
- self._reset_vable(jd, vable)
- return self.cpu.get_latest_value_float(0)
- if failindex == self.cpu.done_with_this_frame_void_v:
- self._reset_vable(jd, vable)
- return None
- #
+ # xxx fast path?????
assembler_helper_ptr = jd.assembler_helper_adr.ptr # fish
try:
- result = assembler_helper_ptr(failindex, vable)
+ result = assembler_helper_ptr(frame)
except LLException, lle:
assert self.last_exception is None, "exception left behind"
self.last_exception = lle
@@ -799,11 +780,6 @@
return None
return support.cast_result(lltype.typeOf(result), result)
- def _reset_vable(self, jd, vable):
- if jd.index_of_virtualizable != -1:
- fielddescr = jd.vable_token_descr
- self.cpu.bh_setfield_gc_i(vable, 0, fielddescr)
-
def execute_same_as(self, _, x):
return x
diff --git a/pypy/jit/backend/test/runner_test.py
b/pypy/jit/backend/test/runner_test.py
--- a/pypy/jit/backend/test/runner_test.py
+++ b/pypy/jit/backend/test/runner_test.py
@@ -2725,14 +2725,14 @@
def test_assembler_call(self):
called = []
- def assembler_helper(jitframe, virtualizable):
+ def assembler_helper(jitframe):
assert self.cpu.get_latest_value_int(jitframe, 0) == 97
- faildescr =self.cpu.get_latest_descr(jitframe)
+ faildescr =self.cpu.get_latest_descr(jitframe)
failindex = self.cpu.get_fail_descr_number(faildescr)
called.append(failindex)
return 4 + 9
- FUNCPTR = lltype.Ptr(lltype.FuncType([self.cpu.JITFRAMEPTR,
llmemory.GCREF],
+ FUNCPTR = lltype.Ptr(lltype.FuncType([llmemory.GCREF],
lltype.Signed))
class FakeJitDriverSD:
index_of_virtualizable = -1
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit