[pypy-commit] pypy no-write-barrier-in-const-ptrs: We don't need write barrier for ConstPtrs (since they're always old anyhow)

fijal noreply at buildbot.pypy.org
Thu Sep 11 21:09:11 CEST 2014


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: no-write-barrier-in-const-ptrs
Changeset: r73468:e7e97150a2cd
Date: 2014-09-11 13:08 -0600
http://bitbucket.org/pypy/pypy/changeset/e7e97150a2cd/

Log:	We don't need write barrier for ConstPtrs (since they're always old
	anyhow)

diff --git a/rpython/jit/backend/llsupport/rewrite.py b/rpython/jit/backend/llsupport/rewrite.py
--- a/rpython/jit/backend/llsupport/rewrite.py
+++ b/rpython/jit/backend/llsupport/rewrite.py
@@ -390,8 +390,7 @@
         val = op.getarg(0)
         if val not in self.write_barrier_applied:
             v = op.getarg(1)
-            if isinstance(v, BoxPtr) or (isinstance(v, ConstPtr) and
-                                         bool(v.value)): # store a non-NULL
+            if isinstance(v, BoxPtr) or not isinstance(v, ConstPtr):
                 self.gen_write_barrier(val)
                 #op = op.copy_and_change(rop.SETFIELD_RAW)
         self.newops.append(op)
@@ -400,8 +399,7 @@
         val = op.getarg(0)
         if val not in self.write_barrier_applied:
             v = op.getarg(2)
-            if isinstance(v, BoxPtr) or (isinstance(v, ConstPtr) and
-                                         bool(v.value)): # store a non-NULL
+            if isinstance(v, BoxPtr) or not isinstance(v, ConstPtr):
                 self.gen_write_barrier_array(val, op.getarg(1))
                 #op = op.copy_and_change(rop.SET{ARRAYITEM,INTERIORFIELD}_RAW)
         self.newops.append(op)


More information about the pypy-commit mailing list