Author: Maciej Fijalkowski <[email protected]>
Branch: resume-refactor
Changeset: r68710:47558757c155
Date: 2014-01-17 11:49 +0100
http://bitbucket.org/pypy/pypy/changeset/47558757c155/
Log: a little bit of progress
diff --git a/rpython/jit/resume/backend.py b/rpython/jit/resume/backend.py
--- a/rpython/jit/resume/backend.py
+++ b/rpython/jit/resume/backend.py
@@ -118,6 +118,8 @@
frame_pos = op.getarg(1).getint()
pos_in_frame = op.getarg(2).getint()
box = op.getarg(0)
+ if box in self.virtuals:
+ xxx
if isinstance(box, Const):
pos = self.builder.encode_const(box)
self.builder.resume_put(pos, frame_pos, pos_in_frame)
@@ -132,6 +134,11 @@
self.frontend_pos[box] = (frame_pos, pos_in_frame)
elif op.getopnum() == rop.LEAVE_FRAME:
self.builder.leave_frame()
+ elif op.getopnum() == rop.RESUME_NEW:
+ v_pos = len(self.virtuals)
+ self.virtuals[op.result] = v_pos
+ XXX
+ self.builder.resume_new(v_pos, op.getdescr())
else:
xxx
return
diff --git a/rpython/jit/resume/reader.py b/rpython/jit/resume/reader.py
--- a/rpython/jit/resume/reader.py
+++ b/rpython/jit/resume/reader.py
@@ -102,7 +102,7 @@
return ord(self.bytecode.opcodes[pos])
def read_short(self, pos):
- return self.read(pos) + (self.read(pos + 1) << 16)
+ return self.read(pos) + (self.read(pos + 1) << 8)
def interpret_until(self, bytecode, until, pos=0):
self.bytecode = bytecode
diff --git a/rpython/jit/resume/test/test_backend.py
b/rpython/jit/resume/test/test_backend.py
--- a/rpython/jit/resume/test/test_backend.py
+++ b/rpython/jit/resume/test/test_backend.py
@@ -58,6 +58,7 @@
def test_resume_new(self):
jitcode = JitCode("name")
+ jitcode.global_index = 1
jitcode.setup(num_regs_i=1, num_regs_r=0, num_regs_f=0)
S = lltype.GcStruct('S', ('field', lltype.Signed))
structdescr = self.cpu.sizeof(S)
@@ -78,9 +79,9 @@
looptoken = JitCellToken()
self.cpu.compile_loop(None, loop.inputargs, loop.operations,
looptoken)
- expected_resume = parse("""
- [i0]
- enter_frame(-1, descr=jitcode)
+ xxx
+ expected_resume = preparse("""
+ enter_frame -1 frame-1
p0 = resume_new(descr=structdescr)
resume_setfield_gc(p0, i0, descr=fielddescr)
resume_put(p0, 0, 0)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit