Author: Maciej Fijalkowski <[email protected]>
Branch: jitframe-on-heap
Changeset: r61077:af844bfac322
Date: 2013-02-11 12:17 +0200
http://bitbucket.org/pypy/pypy/changeset/af844bfac322/
Log: remove "simple" logic duplication that was not quite correct
diff --git a/rpython/jit/backend/x86/regalloc.py
b/rpython/jit/backend/x86/regalloc.py
--- a/rpython/jit/backend/x86/regalloc.py
+++ b/rpython/jit/backend/x86/regalloc.py
@@ -164,7 +164,7 @@
def prepare_loop(self, inputargs, operations, looptoken, allgcrefs):
operations = self._prepare(inputargs, operations, allgcrefs)
- self._set_initial_bindings(inputargs)
+ self._set_initial_bindings(inputargs, looptoken)
# note: we need to make a copy of inputargs because possibly_free_vars
# is also used on op args, which is a non-resizable list
self.possibly_free_vars(list(inputargs))
@@ -188,10 +188,13 @@
def get_final_frame_depth(self):
return self.fm.get_frame_depth()
- def _set_initial_bindings(self, inputargs):
+ def _set_initial_bindings(self, inputargs, looptoken):
+ locs = []
for box in inputargs:
assert isinstance(box, Box)
- self.fm.get_new_loc(box)
+ loc = self.fm.get_new_loc(box)
+ locs.append(loc.value)
+ looptoken.compiled_loop_token._x86_initial_locs = locs
def possibly_free_var(self, var):
if var.type == FLOAT:
diff --git a/rpython/jit/backend/x86/runner.py
b/rpython/jit/backend/x86/runner.py
--- a/rpython/jit/backend/x86/runner.py
+++ b/rpython/jit/backend/x86/runner.py
@@ -119,25 +119,24 @@
#llop.debug_print(lltype.Void, ">>>> Entering", addr)
frame_info = clt.frame_info
frame = self.gc_ll_descr.malloc_jitframe(frame_info)
+ base_ofs = self.get_baseofs_of_frame_field()
ll_frame = lltype.cast_opaque_ptr(llmemory.GCREF, frame)
+ locs = executable_token.compiled_loop_token._x86_initial_locs
prev_interpreter = None # help flow space
if not self.translate_support_code:
prev_interpreter = LLInterpreter.current_interpreter
LLInterpreter.current_interpreter = self.debug_ll_interpreter
try:
- num = JITFRAME_FIXED_SIZE * WORD
for i, kind in kinds:
arg = args[i]
+ num = locs[i] - base_ofs
if kind == history.INT:
self.set_int_value(ll_frame, num, arg)
elif kind == history.FLOAT:
self.set_float_value(ll_frame, num, arg)
- if IS_X86_32:
- num += WORD
else:
assert kind == history.REF
self.set_ref_value(ll_frame, num, arg)
- num += WORD
ll_frame = func(ll_frame)
finally:
if not self.translate_support_code:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit