[pypy-commit] pypy stmgc-c4: reintroduce the medium fastpath for PRIVATE_FROM_PROTECTED objects
Raemi
noreply at buildbot.pypy.org
Tue Jan 14 10:44:18 CET 2014
Author: Remi Meier <remi.meier at gmail.com>
Branch: stmgc-c4
Changeset: r68660:1f646fa9a6ac
Date: 2014-01-14 10:28 +0100
http://bitbucket.org/pypy/pypy/changeset/1f646fa9a6ac/
Log: reintroduce the medium fastpath for PRIVATE_FROM_PROTECTED objects
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
@@ -529,6 +529,31 @@
mc = codebuf.MachineCodeBlockWrapper()
#
if not for_frame:
+ if descr.stmcat in ['A2W', 'A2V']:
+ # slow fastpath
+ # check if PRIV_FROM_PROT is set, but not
+ # WRITE_BARRIER
+ mc.MOV_rs(X86_64_SCRATCH_REG.value, WORD)
+
+ flag = StmGC.GCFLAG_WRITE_BARRIER >> 32
+ off = 4
+ assert 0 < flag < 256
+ mc.TEST8_mi((X86_64_SCRATCH_REG.value, off), flag)
+ mc.J_il8(rx86.Conditions['NZ'], 0)
+ jz1 = mc.get_relative_pos()
+ # if flag set, jump over the next check & RET
+
+ flag = StmGC.GCFLAG_PRIVATE_FROM_PROTECTED >> 40
+ off = 5
+ assert 0 < flag < 256
+ mc.TEST8_mi((X86_64_SCRATCH_REG.value, off), flag)
+ mc.J_il8(rx86.Conditions['Z'], 0)
+ jz2 = mc.get_relative_pos()
+ # if PRIV_F_PROT, RET
+ mc.RET()
+ mc.overwrite(jz2 - 1, chr(mc.get_relative_pos() - jz2))
+ mc.overwrite(jz1 - 1, chr(mc.get_relative_pos() - jz1))
+
self._push_all_regs_to_frame(mc, [], withfloats, callee_only=True)
if IS_X86_32:
# we have 2 extra words on stack for retval and we pass 1 extra
More information about the pypy-commit
mailing list