Author: Armin Rigo <[email protected]>
Branch: stm-thread-2
Changeset: r58971:03f18ccce216
Date: 2012-11-17 19:42 +0100
http://bitbucket.org/pypy/pypy/changeset/03f18ccce216/
Log: Fixes following the merge.
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
@@ -1895,9 +1895,12 @@
if guardtok.is_guard_not_forced:
mc.writechar(chr(self.CODE_FORCED))
self.write_failure_recovery_description(mc, guardtok.failargs,
- guardtok.fail_locs,
- fail_index)
+ guardtok.fail_locs)
+ # write the fail_index too
+ mc.writeimm32(fail_index)
+ # for testing the decoding, write a final byte 0xCC
if not we_are_translated():
+ mc.writechar('\xCC')
faillocs = [loc for loc in guardtok.fail_locs if loc is not None]
guardtok.faildescr._x86_debug_faillocs = faillocs
return startpos
@@ -1912,8 +1915,7 @@
CODE_INPUTARG = 8 | DESCR_SPECIAL
CODE_FORCED = 12 | DESCR_SPECIAL
- def write_failure_recovery_description(self, mc, failargs, locs,
- fail_index):
+ def write_failure_recovery_description(self, mc, failargs, locs):
for i in range(len(failargs)):
arg = failargs[i]
if arg is not None:
diff --git a/pypy/jit/backend/x86/runner.py b/pypy/jit/backend/x86/runner.py
--- a/pypy/jit/backend/x86/runner.py
+++ b/pypy/jit/backend/x86/runner.py
@@ -103,17 +103,10 @@
return self.assembler.assemble_bridge(faildescr, inputargs, operations,
original_loop_token, log=log)
- def clear_latest_values(self, count):
- asmtlocal = stmtlocal.get_asm_tlocal(self)
- null = lltype.nullptr(llmemory.GCREF.TO)
- for index in range(count):
- asmtlocal.fail_boxes_ptr[index] = null
-
def make_execute_token(self, *ARGS):
FUNCPTR = lltype.Ptr(lltype.FuncType(ARGS, llmemory.GCREF))
#
def execute_token(executable_token, *args):
- stmtlocal.prepare_asm_tlocal(self)
clt = executable_token.compiled_loop_token
assert len(args) == clt._debug_nbargs
#
diff --git a/pypy/jit/backend/x86/stmtlocal.py
b/pypy/jit/backend/x86/stmtlocal.py
--- a/pypy/jit/backend/x86/stmtlocal.py
+++ b/pypy/jit/backend/x86/stmtlocal.py
@@ -1,15 +1,6 @@
-#
-# This is hopefully a temporary hack for x86 and x86-64
-#
-
-from pypy.rpython.lltypesystem import lltype, rffi, llmemory
-from pypy.rpython import annlowlevel
-from pypy.jit.codewriter import longlong
+from pypy.rpython.lltypesystem import lltype, rffi
from pypy.translator.tool.cbuild import ExternalCompilationInfo
from pypy.jit.backend.x86.arch import WORD
-from pypy.rlib.objectmodel import we_are_translated
-from pypy.rlib import rgc
-from pypy.module.thread.ll_thread import get_ident
if WORD == 4:
@@ -39,55 +30,3 @@
mc.writechar('\x65') # %gs:
else:
mc.writechar('\x64') # %fs:
-
-# ____________________________________________________________
-
-
-FAILARGS_LIMIT = 1000 # xxx repeated constant
-
-ASSEMBLER_THREAD_LOCAL = lltype.GcStruct(
- 'ASSEMBLER_THREAD_LOCAL',
- ('fail_ebp', lltype.Signed),
- ('fail_boxes_count', lltype.Signed),
- ('fail_boxes_ptr', lltype.FixedSizeArray(llmemory.GCREF, FAILARGS_LIMIT)),
- ('fail_boxes_int', lltype.FixedSizeArray(lltype.Signed, FAILARGS_LIMIT)),
- ('fail_boxes_float', lltype.FixedSizeArray(longlong.FLOATSTORAGE,
- FAILARGS_LIMIT)),
- )
-
-def get_thread_ident(cpu):
- if cpu.with_threads:
- return get_ident()
- else:
- return 0
-
[email protected]_collect
-def get_asm_tlocal(cpu):
- id = get_thread_ident(cpu)
- return cpu.assembler.asmtlocals[id]
-
-def prepare_asm_tlocal(cpu):
- id = get_thread_ident(cpu)
- if id not in cpu.assembler.asmtlocals:
- cpu.assembler.asmtlocals[id] = lltype.malloc(ASSEMBLER_THREAD_LOCAL)
-
-def fail_boxes_int_addr(tlocal, num):
- tgt = llmemory.cast_ptr_to_adr(tlocal)
- tgt += rffi.offsetof(ASSEMBLER_THREAD_LOCAL, 'fail_boxes_int')
- tgt = rffi.cast(lltype.Signed, tgt)
- tgt += num * rffi.sizeof(lltype.Signed)
- return tgt
-
-def fail_boxes_ptr_addr(tlocal, num):
- tgt = llmemory.cast_ptr_to_adr(tlocal)
- tgt += rffi.offsetof(ASSEMBLER_THREAD_LOCAL, 'fail_boxes_ptr')
- tgt = rffi.cast(lltype.Signed, tgt)
- tgt += num * rffi.sizeof(llmemory.GCREF)
- return tgt
-
-def fail_boxes_float_addr(tlocal, num):
- tgt = llmemory.cast_ptr_to_adr(tlocal)
- tgt += rffi.offsetof(ASSEMBLER_THREAD_LOCAL, 'fail_boxes_float')
- tgt = rffi.cast(lltype.Signed, tgt)
- tgt += num * rffi.sizeof(longlong.FLOATSTORAGE)
- return tgt
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit