Commits

Maciej Fijalkowski committed 3f25d53

no storing registers for free, I'm a moron

  • Participants
  • Parent commits d79c5ea
  • Branches jitframe-on-heap

Comments (0)

Files changed (4)

File pypy/jit/backend/llsupport/llmodel.py

         pass
 
     def _setup_frame_realloc(self):
-        FUNC_TP = lltype.Ptr(lltype.FuncType([llmemory.GCREF, lltype.Signed],
+        FUNC_TP = lltype.Ptr(lltype.FuncType([llmemory.GCREF],
                                              llmemory.GCREF))
 
-        def realloc_frame(frame, size):
+        def realloc_frame(frame):
             frame = lltype.cast_opaque_ptr(jitframe.JITFRAMEPTR, frame)
             new_frame = frame.copy()
-            assert frame.jf_frame_info.jfi_frame_depth >= size
             # XXX now we know, rewrite this
             # we need to do this, because we're not sure what things
             # are GC pointers and which ones are not

File pypy/jit/backend/x86/assembler.py

         operations = regalloc.prepare_loop(inputargs, operations, looptoken,
                                            clt.allgcrefs)
         rgc._make_sure_does_not_move(clt.frame_info)
+        self._insert_frame_adjustment(clt.frame_info)
         looppos = self.mc.get_relative_pos()
         looptoken._x86_loop_code = looppos
         frame_depth = self._assemble(regalloc, inputargs, operations)
                                              operations,
                                              self.current_clt.allgcrefs,
                                              self.current_clt.frame_info)
-        stack_check_patch_ofs, stack_check_patch_ofs2 = self._check_frame_depth()
+        stack_check_patch_ofs = self._check_frame_depth()
         frame_depth = self._assemble(regalloc, inputargs, operations)
         codeendpos = self.mc.get_relative_pos()
         self.write_pending_failure_recoveries()
         frame_depth = max(self.current_clt.frame_info.jfi_frame_depth,
                           frame_depth + JITFRAME_FIXED_SIZE)
         self._patch_stackadjust(stack_check_patch_ofs + rawstart, frame_depth)
-        self._patch_stackadjust(stack_check_patch_ofs2 + rawstart, frame_depth)
         self.fixup_target_tokens(rawstart)
         self.current_clt.frame_info.jfi_frame_depth = frame_depth
         self._update_gcmap(self.current_clt.frame_info, regalloc)
         assert not IS_X86_32
         self.mc.J_il8(rx86.Conditions['GE'], 0)
         jg_location = self.mc.get_relative_pos()
-        self.mc.MOV_ri(esi.value, 0xffffff)
-        ofs = self.mc.get_relative_pos() - 4
         self.mc.CALL(imm(self._stack_check_failure))
         # patch the JG above
         offset = self.mc.get_relative_pos() - jg_location
         assert 0 < offset <= 127
         self.mc.overwrite(jg_location-1, chr(offset))
-        return stack_check_cmp_ofs, ofs
+        return stack_check_cmp_ofs
 
     def _insert_frame_adjustment(self, frame_info):
         # XXX note that this can be easily shifted to JUMP

File pypy/jit/backend/x86/test/test_gc_integration.py

         assert frame.jf_gcmap[0] == 1
         assert frame.jf_gcmap[1] == 3
 
+    def test_label(self):
+        ops = '''
+        [i0, p0, i1, p1]
+        label(i0, p0, i1, p1, descr=targettoken)
+        p3 = getfield_gc(p0, descr=fielddescr)
+        force_spill(p3)
+        guard_true(i0) [p0, i1, p1, p3]
+        finish()
+        '''
+        s1 = lltype.malloc(self.S)
+        s2 = lltype.malloc(self.S)
+        s1.field = s2
+        loop = self.interpret(ops, [0, s1, 1, s2])
+        ops2 = '''
+        [p0]
+        jump(1, p0, 1, p0, descr=targettoken)
+        '''
+        self.interpret(ops2)
+        xxx
+
     def test_rewrite_constptr(self):
         ops = '''
         []

File pypy/jit/backend/x86/test/test_regalloc.py

     namespace = locals().copy()
     type_system = 'lltype'
 
-    def parse(self, s, boxkinds=None):
-        return parse(s, self.cpu, self.namespace,
+    def parse(self, s, boxkinds=None, namespace=None):
+        return parse(s, self.cpu, namespace or self.namespace,
                      type_system=self.type_system,
                      boxkinds=boxkinds)