[pypy-commit] pypy jitframe-on-heap: write garbage to jitframe so we get crashes of incorrect gcmap quicker

fijal noreply at buildbot.pypy.org
Wed Feb 27 13:07:33 CET 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: jitframe-on-heap
Changeset: r61843:c4f9e6db0526
Date: 2013-02-27 14:07 +0200
http://bitbucket.org/pypy/pypy/changeset/c4f9e6db0526/

Log:	write garbage to jitframe so we get crashes of incorrect gcmap
	quicker

diff --git a/rpython/jit/backend/llsupport/gc.py b/rpython/jit/backend/llsupport/gc.py
--- a/rpython/jit/backend/llsupport/gc.py
+++ b/rpython/jit/backend/llsupport/gc.py
@@ -132,10 +132,10 @@
         """ This functions retuns an arraydescr of type for the JITFRAME"""
         raise NotImplementedError
 
-    def malloc_jitframe(self, frame_info):
+    def malloc_jitframe(self, frame_info, staticsize):
         """ Allocate a new frame, overwritten by tests
         """
-        frame = jitframe.JITFRAME.allocate(frame_info)
+        frame = jitframe.JITFRAME.allocate(frame_info, staticsize)
         llop.gc_assume_young_pointers(lltype.Void, frame)
         return frame
 
diff --git a/rpython/jit/backend/llsupport/jitframe.py b/rpython/jit/backend/llsupport/jitframe.py
--- a/rpython/jit/backend/llsupport/jitframe.py
+++ b/rpython/jit/backend/llsupport/jitframe.py
@@ -38,9 +38,13 @@
 # the JITFRAME that's stored on the heap. See backend/<backend>/arch.py for
 # detailed explanation how it is on your architecture
 
-def jitframe_allocate(frame_info):
+def jitframe_allocate(frame_info, staticsize):
     frame = lltype.malloc(JITFRAME, frame_info.jfi_frame_depth, zero=True)
     frame.jf_frame_info = frame_info
+    i = 0
+    while i < staticsize:
+        frame.jf_frame[i] = 13
+        i += 1
     return frame
 
 JITFRAME = lltype.GcStruct(
diff --git a/rpython/jit/backend/llsupport/llmodel.py b/rpython/jit/backend/llsupport/llmodel.py
--- a/rpython/jit/backend/llsupport/llmodel.py
+++ b/rpython/jit/backend/llsupport/llmodel.py
@@ -210,7 +210,8 @@
             func = rffi.cast(FUNCPTR, addr)
             #llop.debug_print(lltype.Void, ">>>> Entering", addr)
             frame_info = clt.frame_info
-            frame = self.gc_ll_descr.malloc_jitframe(frame_info)
+            frame = self.gc_ll_descr.malloc_jitframe(frame_info,
+                                                     self.JITFRAME_FIXED_SIZE)
             ll_frame = lltype.cast_opaque_ptr(llmemory.GCREF, frame)
             locs = executable_token.compiled_loop_token._ll_initial_locs
             prev_interpreter = None   # help flow space


More information about the pypy-commit mailing list