1. Omar Ali Fdal
  2. pypy

Commits

Maciej Fijalkowski  committed af9feb4

Pass the first virtualizable test. Seems the other one explodes with
"already forced" assertion error.

  • Participants
  • Parent commits 73160a5
  • Branches direct-assembler-call

Comments (0)

Files changed (2)

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

View file
  • Ignore whitespace
                                    arglocs, result_loc):
         # XXX temporary code. We generally want a separate entry point,
         #     needs more tests
-        self._emit_call(rel32(op.descr._x86_direct_bootstrap_code), arglocs, 1,
+        self._emit_call(rel32(op.descr._x86_direct_bootstrap_code), arglocs, 2,
                         tmp=eax)
-        self._emit_call(rel32(self.assembler_helper_adr), [eax, imm(0)], 0,
+        self._emit_call(rel32(self.assembler_helper_adr), [eax, arglocs[1]], 0,
                         tmp=ecx)
         if isinstance(result_loc, MODRM64):
             self.mc.FSTP(result_loc)

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

View file
  • Ignore whitespace
         descr = op.descr
         assert isinstance(descr, LoopToken)
         size = descr._calldescr.get_result_size(self.translate_support_code)
-        self._call(op, [imm(size)] +
+        vable_index = self.assembler.cpu.index_of_virtualizable
+        if vable_index != -1:
+            vable = self.fm.loc(op.args[vable_index], 1)
+        else:
+            vable = imm(0)
+        self._call(op, [imm(size), vable] +
                    [self.loc(arg) for arg in op.args],
                    guard_not_forced_op=guard_op)