Author: Armin Rigo <ar...@tunes.org>
Branch: stmgc-c4
Changeset: r66867:1b6f11c55022
Date: 2013-09-09 18:28 +0200
http://bitbucket.org/pypy/pypy/changeset/1b6f11c55022/

Log:    Add raw_load and raw_store here, to generate the correct barriers
        when applied on GC objects.

diff --git a/rpython/translator/stm/inevitable.py 
b/rpython/translator/stm/inevitable.py
--- a/rpython/translator/stm/inevitable.py
+++ b/rpython/translator/stm/inevitable.py
@@ -25,8 +25,8 @@
     if opname.startswith('stm_'):
         ALWAYS_ALLOW_OPERATIONS.add(opname)
 
-GETTERS = set(['getfield', 'getarrayitem', 'getinteriorfield'])
-SETTERS = set(['setfield', 'setarrayitem', 'setinteriorfield'])
+GETTERS = set(['getfield', 'getarrayitem', 'getinteriorfield', 'raw_load'])
+SETTERS = set(['setfield', 'setarrayitem', 'setinteriorfield', 'raw_store'])
 MALLOCS = set(['malloc', 'malloc_varsize',
                'malloc_nonmovable', 'malloc_nonmovable_varsize'])
 # ____________________________________________________________
diff --git a/rpython/translator/stm/writebarrier.py 
b/rpython/translator/stm/writebarrier.py
--- a/rpython/translator/stm/writebarrier.py
+++ b/rpython/translator/stm/writebarrier.py
@@ -23,7 +23,7 @@
     if op.opname in ('getfield', 'setfield'):
         STRUCT = op.args[0].concretetype.TO
         return STRUCT._immutable_field(op.args[1].value)
-    if op.opname in ('getarrayitem', 'setarrayitem'):
+    if op.opname in ('getarrayitem', 'setarrayitem', 'raw_load', 'raw_store'):
         ARRAY = op.args[0].concretetype.TO
         return ARRAY._immutable_field()
     if op.opname == 'getinteriorfield':
@@ -70,7 +70,7 @@
         expand_comparison = set()
         for op in self.block.operations:
             is_getter = (op.opname in ('getfield', 'getarrayitem',
-                                       'getinteriorfield') and
+                                       'getinteriorfield', 'raw_load') and
                          op.result.concretetype is not lltype.Void and
                          is_gc_ptr(op.args[0].concretetype))
 
@@ -93,7 +93,7 @@
                 wants_a_barrier[op] = 'R'
 
             elif (op.opname in ('setfield', 'setarrayitem',
-                                'setinteriorfield') and
+                                'setinteriorfield', 'raw_store') and
                   op.args[-1].concretetype is not lltype.Void and
                   is_gc_ptr(op.args[0].concretetype)):
                 # setfields need a regular write barrier
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to