[pypy-commit] pypy stmgc-c8: Use 'stm_dont_track_raw_accesses' instead of 'stm_ignore' here, which is

arigo noreply at buildbot.pypy.org
Mon Jun 22 11:48:15 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c8
Changeset: r78241:c883fa17281d
Date: 2015-06-22 10:46 +0200
http://bitbucket.org/pypy/pypy/changeset/c883fa17281d/

Log:	Use 'stm_dont_track_raw_accesses' instead of 'stm_ignore' here,
	which is better supported by the JIT

diff --git a/pypy/module/pypystm/unsafe_op.py b/pypy/module/pypystm/unsafe_op.py
--- a/pypy/module/pypystm/unsafe_op.py
+++ b/pypy/module/pypystm/unsafe_op.py
@@ -1,18 +1,15 @@
 from pypy.interpreter.gateway import unwrap_spec
 from pypy.module._cffi_backend import cdataobj
-from rpython.rlib.rstm import stm_ignored
-from rpython.rlib.jit import dont_look_inside
-from rpython.rtyper.lltypesystem import rffi
+from rpython.rtyper.lltypesystem import lltype, rffi
 
 
- at dont_look_inside
-def unsafe_write(ptr, value):
-    with stm_ignored:
-        ptr[0] = value
+UNSAFE_INT = lltype.Struct('UNSAFE_INT', ('x', rffi.INT),
+                           hints = {'stm_dont_track_raw_accesses': True})
+UNSAFE_INT_P = lltype.Ptr(UNSAFE_INT)
+
 
 @unwrap_spec(w_cdata=cdataobj.W_CData, index=int, value='c_int')
 def unsafe_write_int32(space, w_cdata, index, value):
     with w_cdata as ptr:
-        ptr = rffi.cast(rffi.INTP, rffi.ptradd(ptr, index * 4))
-        value = rffi.cast(rffi.INT, value)
-        unsafe_write(ptr, value)
+        ptr = rffi.cast(UNSAFE_INT_P, rffi.ptradd(ptr, index * 4))
+        ptr.x = rffi.cast(rffi.INT, value)


More information about the pypy-commit mailing list