Author: Armin Rigo <[email protected]>
Branch: optresult-unroll
Changeset: r79411:6c3f58de10b2
Date: 2015-09-04 10:40 +0200
http://bitbucket.org/pypy/pypy/changeset/6c3f58de10b2/
Log: probable fix, but really needs tests
diff --git a/rpython/jit/backend/llsupport/gc.py
b/rpython/jit/backend/llsupport/gc.py
--- a/rpython/jit/backend/llsupport/gc.py
+++ b/rpython/jit/backend/llsupport/gc.py
@@ -688,7 +688,7 @@
type_info_group = llop.gc_get_type_info_group(llmemory.Address)
type_info_group = rffi.cast(lltype.Signed, type_info_group)
expected_typeid = classptr - sizeof_ti - type_info_group
- if IS_X86_32:
+ if WORD == 4:
expected_typeid >>= 2
return expected_typeid
@@ -702,7 +702,13 @@
type_info_group = llop.gc_get_type_info_group(llmemory.Address)
type_info_group = rffi.cast(lltype.Signed, type_info_group)
infobits_offset = rffi.cast(lltype.Signed, self._infobits_offset)
- return (type_info_group + infobits_offset, self._T_IS_RPYTHON_INSTANCE)
+ if WORD == 4:
+ shift_by = 2
+ elif WORD == 8:
+ shift_by = 0
+ return (type_info_group + infobits_offset,
+ shift_by,
+ self._T_IS_RPYTHON_INSTANCE)
# ____________________________________________________________
diff --git a/rpython/jit/backend/x86/assembler.py
b/rpython/jit/backend/x86/assembler.py
--- a/rpython/jit/backend/x86/assembler.py
+++ b/rpython/jit/backend/x86/assembler.py
@@ -1786,14 +1786,12 @@
[loc_object, loc_typeid] = locs
# idea: read the typeid, fetch the field 'infobits' from the big
# typeinfo table, and check the flag 'T_IS_RPYTHON_INSTANCE'.
- base_type_info, IS_OBJECT_FLAG = (
+ base_type_info, shift_by, IS_OBJECT_FLAG = (
self.cpu.gc_ll_descr.get_translated_info_for_guard_is_object())
if IS_X86_32:
self.mc.MOVZX16(loc_typeid, mem(loc_object, 0))
- shift_by = 2
else:
self.mc.MOVZX32(loc_typeid, mem(loc_object, 0))
- shift_by = 0
loc_infobits = addr_add(imm(base_type_info), loc_typeid,
scale=shift_by)
self.mc.TEST(loc_infobits, imm(IS_OBJECT_FLAG))
#
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit