[pypy-commit] pypy stmgc-c7: translation fixes
arigo
noreply at buildbot.pypy.org
Sat Feb 21 09:34:17 CET 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r76020:30fb754cc44a
Date: 2015-02-20 19:48 +0100
http://bitbucket.org/pypy/pypy/changeset/30fb754cc44a/
Log: translation fixes
diff --git a/rpython/jit/backend/x86/callbuilder.py b/rpython/jit/backend/x86/callbuilder.py
--- a/rpython/jit/backend/x86/callbuilder.py
+++ b/rpython/jit/backend/x86/callbuilder.py
@@ -189,6 +189,7 @@
"""This occurs just before emit_raw_call().
"""
mc = self.mc
+ SEGMENT_NO = self.asm.SEGMENT_NO
if handle_lasterror and (save_err & rffi.RFFI_READSAVED_LASTERROR):
# must call SetLastError(). There are no registers to save
@@ -202,7 +203,7 @@
rpy_lasterror = llerrno.get_rpy_lasterror_offset(self.asm.cpu)
tlofsreg = self.get_tlofs_reg() # => esi, callee-saved
self.save_stack_position() # => edi, callee-saved
- mc.PUSH_m((tlofsreg.value, rpy_lasterror))
+ mc.PUSH_m((SEGMENT_NO, tlofsreg.value, rpy_lasterror))
mc.CALL(imm(SetLastError_addr))
# restore the stack position without assuming a particular
# calling convention of _SetLastError()
@@ -220,20 +221,21 @@
tmpreg = edx
else:
tmpreg = r11 # edx is used for 3rd argument
- mc.MOV_rm(tmpreg.value, (tlofsreg.value, p_errno))
- mc.MOV32_rm(eax.value, (tlofsreg.value, rpy_errno))
- mc.MOV32_mr((tmpreg.value, 0), eax.value)
+ mc.MOV_rm(tmpreg.value, (SEGMENT_NO, tlofsreg.value, p_errno))
+ mc.MOV32_rm(eax.value, (SEGMENT_NO, tlofsreg.value, rpy_errno))
+ mc.MOV32_mr((SEGMENT_NO, tmpreg.value, 0), eax.value)
elif save_err & rffi.RFFI_ZERO_ERRNO_BEFORE:
# Same, but write zero.
p_errno = llerrno.get_p_errno_offset(self.asm.cpu)
tlofsreg = self.get_tlofs_reg() # => esi or r12, callee-saved
- mc.MOV_rm(eax.value, (tlofsreg.value, p_errno))
- mc.MOV32_mi((eax.value, 0), 0)
+ mc.MOV_rm(eax.value, (SEGMENT_NO, tlofsreg.value, p_errno))
+ mc.MOV32_mi((SEGMENT_NO, eax.value, 0), 0)
def read_real_errno(self, save_err):
"""This occurs after emit_raw_call() and after restore_stack_pointer().
"""
mc = self.mc
+ SEGMENT_NO = self.asm.SEGMENT_NO
if save_err & rffi.RFFI_SAVE_ERRNO:
# Just after a call, read the real 'errno' and save a copy of
@@ -244,9 +246,9 @@
rpy_errno = llerrno.get_rpy_errno_offset(self.asm.cpu)
p_errno = llerrno.get_p_errno_offset(self.asm.cpu)
tlofsreg = self.get_tlofs_reg() # => esi or r12 (possibly reused)
- mc.MOV_rm(edi.value, (tlofsreg.value, p_errno))
- mc.MOV32_rm(edi.value, (edi.value, 0))
- mc.MOV32_mr((tlofsreg.value, rpy_errno), edi.value)
+ mc.MOV_rm(edi.value, (SEGMENT_NO, tlofsreg.value, p_errno))
+ mc.MOV32_rm(edi.value, (SEGMENT_NO, edi.value, 0))
+ mc.MOV32_mr((SEGMENT_NO, tlofsreg.value, rpy_errno), edi.value)
if handle_lasterror and (save_err & (rffi.RFFI_SAVE_LASTERROR |
rffi.RFFI_SAVE_WSALASTERROR)):
@@ -265,7 +267,7 @@
mc.CALL(imm(GetLastError_addr))
#
tlofsreg = self.get_tlofs_reg() # => esi (possibly reused)
- mc.MOV32_mr((tlofsreg.value, rpy_lasterror), eax.value)
+ mc.MOV32_mr((SEGMENT_NO, tlofsreg.value, rpy_lasterror), eax.value)
def move_real_result_and_call_reacqgil_addr(self, fastgil):
from rpython.jit.backend.x86 import rx86
@@ -688,9 +690,9 @@
from rpython.rlib import rstm
# after any CALL_RELEASE_GIL, invoke the
# pypy_stm_start_if_not_atomic() function
- self.save_result_value_reacq()
+ self.save_result_value(True)
self.mc.CALL(imm(rstm.adr_pypy_stm_start_if_not_atomic))
- self.restore_result_value_reacq()
+ self.restore_result_value(True)
if IS_X86_32:
diff --git a/rpython/jit/backend/x86/runner.py b/rpython/jit/backend/x86/runner.py
--- a/rpython/jit/backend/x86/runner.py
+++ b/rpython/jit/backend/x86/runner.py
@@ -106,7 +106,7 @@
def guard_already_patched(self, faildescr):
# only needed for STM so far
- return faildescr._x86_adr_jump_offset == 0
+ return faildescr.adr_jump_offset == 0
def clear_latest_values(self, count):
diff --git a/rpython/jit/metainterp/compile.py b/rpython/jit/metainterp/compile.py
--- a/rpython/jit/metainterp/compile.py
+++ b/rpython/jit/metainterp/compile.py
@@ -491,8 +491,9 @@
class ResumeGuardDescr(ResumeDescr):
_attrs_ = ('rd_numb', 'rd_count', 'rd_consts', 'rd_virtuals',
- 'rd_frame_info_list', 'rd_pendingfields', 'status')
-
+ 'rd_frame_info_list', 'rd_pendingfields', 'status',
+ 'stm_location_int', 'stm_location_ref') # stm only
+
rd_numb = lltype.nullptr(NUMBERING)
rd_count = 0
rd_consts = None
diff --git a/rpython/jit/metainterp/history.py b/rpython/jit/metainterp/history.py
--- a/rpython/jit/metainterp/history.py
+++ b/rpython/jit/metainterp/history.py
@@ -154,7 +154,8 @@
index = -1
final_descr = False
- _attrs_ = ('adr_jump_offset', 'rd_locs', 'rd_loop_token')
+ _attrs_ = ('adr_jump_offset', 'rd_locs', 'rd_loop_token',
+ '_x86_stm_guard_failure') # only with stm
def handle_fail(self, deadframe, metainterp_sd, jitdriver_sd):
raise NotImplementedError
More information about the pypy-commit
mailing list