Author: Armin Rigo <[email protected]>
Branch: stm-thread-2
Changeset: r59381:895204d1310d
Date: 2012-12-10 00:57 +0100
http://bitbucket.org/pypy/pypy/changeset/895204d1310d/

Log:    Revert changes to writebarrier.py, and implement it directly in
        src_stm/et.h.

diff --git a/pypy/translator/stm/src_stm/et.h b/pypy/translator/stm/src_stm/et.h
--- a/pypy/translator/stm/src_stm/et.h
+++ b/pypy/translator/stm/src_stm/et.h
@@ -74,6 +74,10 @@
 #define STM_PTR_EQ(P1, P2)                      \
     stm_PtrEq((gcptr)(P1), (gcptr)(P2))
 
+/* special usage only */
+#define OP_STM_READ_BARRIER(P, R)   R = STM_BARRIER_P2R(P)
+#define OP_STM_WRITE_BARRIER(P, W)   W = STM_BARRIER_P2W(P)
+
 
 void BeginTransaction(jmp_buf *);
 void BeginInevitableTransaction(void);
diff --git a/pypy/translator/stm/writebarrier.py 
b/pypy/translator/stm/writebarrier.py
--- a/pypy/translator/stm/writebarrier.py
+++ b/pypy/translator/stm/writebarrier.py
@@ -86,10 +86,6 @@
             elif (op.opname in ('ptr_eq', 'ptr_ne') and
                   op.args[0].concretetype.TO._gckind == 'gc'):
                 expand_comparison.add(op)
-            elif op.opname == 'stm_read_barrier':
-                wants_a_barrier[op] = 'R'
-            elif op.opname == 'stm_write_barrier':
-                wants_a_barrier[op] = 'W'
         #
         if wants_a_barrier or expand_comparison:
             # note: 'renamings' maps old vars to new vars, but cast_pointers
@@ -100,8 +96,7 @@
             newoperations = []
             for op in block.operations:
                 #
-                opname = op.opname
-                if opname == 'cast_pointer':
+                if op.opname == 'cast_pointer':
                     v = op.args[0]
                     renamings[op.result] = renamings.setdefault(v, [v])
                     continue
@@ -119,10 +114,8 @@
                         newoperations.append(newop)
                         v_holder[0] = w
                         category[w] = to
-                    if opname in ('stm_read_barrier', 'stm_write_barrier'):
-                        opname = 'same_as'      # done its job, remove op
                 #
-                newop = SpaceOperation(opname,
+                newop = SpaceOperation(op.opname,
                                        [renamings_get(v) for v in op.args],
                                        op.result)
                 newoperations.append(newop)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to