Commits

Armin Rigo committed 895204d

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

Comments (0)

Files changed (2)

pypy/translator/stm/src_stm/et.h

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

pypy/translator/stm/writebarrier.py

             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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.