Commits

Maciej Fijalkowski committed af844bf

remove "simple" logic duplication that was not quite correct

Comments (0)

Files changed (2)

rpython/jit/backend/x86/regalloc.py

 
     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))
     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:

rpython/jit/backend/x86/runner.py

             #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: