1. Pypy
  2. Untitled project
  3. pypy

Commits

Maciej Fijalkowski  committed bc9a7d2

fixes

  • Participants
  • Parent commits 2a740e4
  • Branches jitframe-on-heap

Comments (0)

Files changed (4)

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

View file
  • Ignore whitespace
                                              llmemory.GCREF))
 
         def realloc_frame(frame):
-            frame = lltype.cast_opaque_ptr(jitframe.JITFRAME, frame)
-            import pdb
-            pdb.set_trace()
-            return frame
+            frame = lltype.cast_opaque_ptr(jitframe.JITFRAMEPTR, frame)
+            frame_info = frame.jf_frame_info
+            new_frame = lltype.malloc(jitframe.JITFRAME,
+                                      frame_info.jfi_frame_depth)
+            new_frame.jf_frame_info = frame_info
+            # we need to do this, because we're not sure what things
+            # are GC pointers and which ones are not
+            llop.gc_writebarrier_before_copy(lltype.Bool, frame, new_frame,
+                                             0, 0, len(frame.jf_frame))
+            i = 0
+            while i < len(frame.jf_frame):
+                new_frame.jf_frame[i] = frame.jf_frame[i]
+                i += 1
+            new_frame.jf_savedata = frame.jf_savedata
+            # all other fields are empty
+            return lltype.cast_opaque_ptr(llmemory.GCREF, new_frame)
         
         f = llhelper(FUNC_TP, realloc_frame)
         self.realloc_frame = heaptracker.adr2int(llmemory.cast_ptr_to_adr(f))

File pypy/jit/backend/test/runner_test.py

View file
  • Ignore whitespace
                                     EffectInfo.MOST_GENERAL)
 
         def func2(a, b, c, d, e, f, g, h, i, j, k, l):
-            import pdb
-            pdb.set_trace()
+            pass
 
         FUNC2 = self.FuncType([lltype.Signed] * 12, lltype.Void)
         FPTR2 = self.Ptr(FUNC2)
         """, namespace=locals())
         self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         frame = self.cpu.execute_token(looptoken, 0, 0, 3)
-        assert self.cpu.get_latest_descr(frame) is guarddescr
+        #assert self.cpu.get_latest_descr(frame) is guarddescr
+        from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU
+
+        if not isinstance(self.cpu, AbstractLLCPU):
+            py.test.skip("pointless test on non-asm")
+            
+        frame = lltype.cast_opaque_ptr(jitframe.JITFRAMEPTR, frame)
+        assert len(frame.jf_frame) == frame.jf_frame_info.jfi_frame_depth

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

View file
  • Ignore whitespace
         assert not IS_X86_32
         # push first arg
         mc.LEA_rb(edi.value, -base_ofs)
+        mc.SUB_ri(esp.value, WORD) # we need that cause we're inside a call
         mc.CALL(imm(self.cpu.realloc_frame))
+        mc.ADD_ri(esp.value, WORD) 
         mc.LEA_rm(ebp.value, (eax.value, base_ofs))
         self._pop_all_regs_from_frame(mc, self.cpu.supports_floats)
         mc.RET()

File pypy/rpython/lltypesystem/opimpl.py

View file
  • Ignore whitespace
                                    source_start, dest_start, length):
     A = lltype.typeOf(source)
     assert A == lltype.typeOf(dest)
-    assert isinstance(A.TO, lltype.GcArray)
-    assert isinstance(A.TO.OF, lltype.Ptr)
-    assert A.TO.OF.TO._gckind == 'gc'
+    if isinstance(A.TO, lltype.GcArray):
+        assert isinstance(A.TO.OF, lltype.Ptr)
+        assert A.TO.OF.TO._gckind == 'gc'
+    else:
+        assert isinstance(A.TO, lltype.GcStruct)
+        assert hasattr(A.TO, '_arrayfld')
     assert type(source_start) is int
     assert type(dest_start) is int
     assert type(length) is int