1. Pypy
  2. Untitled project
  3. pypy

Commits

Armin Rigo  committed 895204d

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

  • Participants
  • Parent commits d2c8017
  • Branches stm-thread-2

Comments (0)

Files changed (2)

File pypy/translator/stm/src_stm/et.h

View file
 #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);

File pypy/translator/stm/writebarrier.py

View file
             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
             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
                         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)