Author: Maciej Fijalkowski <[email protected]>
Branch: jitframe-on-heap
Changeset: r60157:3f25d53e2d16
Date: 2013-01-17 23:53 +0200
http://bitbucket.org/pypy/pypy/changeset/3f25d53e2d16/
Log: no storing registers for free, I'm a moron
diff --git a/pypy/jit/backend/llsupport/llmodel.py
b/pypy/jit/backend/llsupport/llmodel.py
--- a/pypy/jit/backend/llsupport/llmodel.py
+++ b/pypy/jit/backend/llsupport/llmodel.py
@@ -52,13 +52,12 @@
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
diff --git a/pypy/jit/backend/x86/assembler.py
b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -536,6 +536,7 @@
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)
@@ -593,7 +594,7 @@
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()
@@ -614,7 +615,6 @@
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)
@@ -685,14 +685,12 @@
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
diff --git a/pypy/jit/backend/x86/test/test_gc_integration.py
b/pypy/jit/backend/x86/test/test_gc_integration.py
--- a/pypy/jit/backend/x86/test/test_gc_integration.py
+++ b/pypy/jit/backend/x86/test/test_gc_integration.py
@@ -73,6 +73,26 @@
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 = '''
[]
diff --git a/pypy/jit/backend/x86/test/test_regalloc.py
b/pypy/jit/backend/x86/test/test_regalloc.py
--- a/pypy/jit/backend/x86/test/test_regalloc.py
+++ b/pypy/jit/backend/x86/test/test_regalloc.py
@@ -145,8 +145,8 @@
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)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit