[pypy-commit] pypy default: Put @elidable on calls to identityhash() only.
arigo
noreply at buildbot.pypy.org
Thu Jul 28 18:00:28 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r46050:88f51d44dcd9
Date: 2011-07-28 11:58 +0200
http://bitbucket.org/pypy/pypy/changeset/88f51d44dcd9/
Log: Put @elidable on calls to identityhash() only.
diff --git a/pypy/jit/codewriter/support.py b/pypy/jit/codewriter/support.py
--- a/pypy/jit/codewriter/support.py
+++ b/pypy/jit/codewriter/support.py
@@ -20,6 +20,7 @@
from pypy.rpython.annlowlevel import MixLevelHelperAnnotator
from pypy.jit.metainterp.typesystem import deref
from pypy.rlib import rgc
+from pypy.rlib.jit import elidable
from pypy.rlib.rarithmetic import r_longlong, r_ulonglong, r_uint, intmask
def getargtypes(annotator, values):
@@ -167,9 +168,14 @@
_ll_5_list_ll_arraycopy = rgc.ll_arraycopy
+ at elidable
def _ll_1_gc_identityhash(x):
return lltype.identityhash(x)
+# the following function should not be "@elidable": I can think of
+# a corner case in which id(const) is constant-folded, and then 'const'
+# disappears and is collected too early (possibly causing another object
+# with the same id() to appear).
def _ll_1_gc_id(ptr):
return llop.gc_id(lltype.Signed, ptr)
More information about the pypy-commit
mailing list