[pypy-commit] pypy default: Slight changes of the interface, to make it clear that callers don't
arigo
noreply at buildbot.pypy.org
Wed Feb 29 11:53:28 CET 2012
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r53014:62365cdbdeb6
Date: 2012-02-29 11:53 +0100
http://bitbucket.org/pypy/pypy/changeset/62365cdbdeb6/
Log: Slight changes of the interface, to make it clear that callers don't
expect to do anything with the token --- just check if it's 0 or
not.
diff --git a/pypy/jit/metainterp/pyjitpl.py b/pypy/jit/metainterp/pyjitpl.py
--- a/pypy/jit/metainterp/pyjitpl.py
+++ b/pypy/jit/metainterp/pyjitpl.py
@@ -2349,7 +2349,7 @@
# warmstate.py.
virtualizable_box = self.virtualizable_boxes[-1]
virtualizable = vinfo.unwrap_virtualizable_box(virtualizable_box)
- assert not vinfo.gettoken(virtualizable)
+ assert not vinfo.is_token_nonnull_gcref(virtualizable)
# fill the virtualizable with the local boxes
self.synchronize_virtualizable()
#
diff --git a/pypy/jit/metainterp/resume.py b/pypy/jit/metainterp/resume.py
--- a/pypy/jit/metainterp/resume.py
+++ b/pypy/jit/metainterp/resume.py
@@ -1101,14 +1101,14 @@
virtualizable = self.decode_ref(numb.nums[index])
if self.resume_after_guard_not_forced == 1:
# in the middle of handle_async_forcing()
- assert vinfo.gettoken(virtualizable)
- vinfo.settoken(virtualizable, vinfo.TOKEN_NONE)
+ assert vinfo.is_token_nonnull_gcref(virtualizable)
+ vinfo.reset_token_gcref(virtualizable)
else:
# just jumped away from assembler (case 4 in the comment in
# virtualizable.py) into tracing (case 2); check that vable_token
# is and stays 0. Note the call to reset_vable_token() in
# warmstate.py.
- assert not vinfo.gettoken(virtualizable)
+ assert not vinfo.is_token_nonnull_gcref(virtualizable)
return vinfo.write_from_resume_data_partial(virtualizable, self, numb)
def load_value_of_type(self, TYPE, tagged):
diff --git a/pypy/jit/metainterp/virtualizable.py b/pypy/jit/metainterp/virtualizable.py
--- a/pypy/jit/metainterp/virtualizable.py
+++ b/pypy/jit/metainterp/virtualizable.py
@@ -262,15 +262,15 @@
force_now._dont_inline_ = True
self.force_now = force_now
- def gettoken(virtualizable):
+ def is_token_nonnull_gcref(virtualizable):
virtualizable = cast_gcref_to_vtype(virtualizable)
- return virtualizable.vable_token
- self.gettoken = gettoken
+ return bool(virtualizable.vable_token)
+ self.is_token_nonnull_gcref = is_token_nonnull_gcref
- def settoken(virtualizable, token):
+ def reset_token_gcref(virtualizable):
virtualizable = cast_gcref_to_vtype(virtualizable)
- virtualizable.vable_token = token
- self.settoken = settoken
+ virtualizable.vable_token = VirtualizableInfo.TOKEN_NONE
+ self.reset_token_gcref = reset_token_gcref
def _freeze_(self):
return True
More information about the pypy-commit
mailing list