[pypy-commit] pypy exception-cannot-occur: More.
arigo
noreply at buildbot.pypy.org
Sun Apr 1 20:08:56 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch: exception-cannot-occur
Changeset: r54129:9a1134601e5b
Date: 2012-04-01 19:46 +0200
http://bitbucket.org/pypy/pypy/changeset/9a1134601e5b/
Log: More.
diff --git a/pypy/rlib/objectmodel.py b/pypy/rlib/objectmodel.py
--- a/pypy/rlib/objectmodel.py
+++ b/pypy/rlib/objectmodel.py
@@ -215,6 +215,7 @@
def specialize_call(self, hop):
from pypy.rpython.lltypesystem import lltype
+ hop.exception_cannot_occur()
return hop.inputconst(lltype.Bool, hop.s_result.const)
# ____________________________________________________________
@@ -397,6 +398,7 @@
r_obj, = hop.args_r
v_obj, = hop.inputargs(r_obj)
ll_fn = r_obj.get_ll_hash_function()
+ hop.exception_is_here()
return hop.gendirectcall(ll_fn, v_obj)
class Entry(ExtRegistryEntry):
diff --git a/pypy/rpython/rbool.py b/pypy/rpython/rbool.py
--- a/pypy/rpython/rbool.py
+++ b/pypy/rpython/rbool.py
@@ -34,6 +34,7 @@
def rtype_float(_, hop):
vlist = hop.inputargs(Float)
+ hop.exception_cannot_occur()
return vlist[0]
#
diff --git a/pypy/rpython/rbuiltin.py b/pypy/rpython/rbuiltin.py
--- a/pypy/rpython/rbuiltin.py
+++ b/pypy/rpython/rbuiltin.py
@@ -205,7 +205,7 @@
# ____________________________________________________________
def rtype_builtin_bool(hop):
- xxx # not called any more?
+ # not called any more?
assert hop.nb_args == 1
return hop.args_r[0].rtype_is_true(hop)
@@ -536,11 +536,13 @@
def rtype_identity_hash(hop):
vlist = hop.inputargs(hop.args_r[0])
+ hop.exception_cannot_occur()
return hop.genop('gc_identityhash', vlist, resulttype=lltype.Signed)
def rtype_runtime_type_info(hop):
assert isinstance(hop.args_r[0], rptr.PtrRepr)
vlist = hop.inputargs(hop.args_r[0])
+ hop.exception_cannot_occur()
return hop.genop('runtime_type_info', vlist,
resulttype = hop.r_result.lowleveltype)
diff --git a/pypy/rpython/rfloat.py b/pypy/rpython/rfloat.py
--- a/pypy/rpython/rfloat.py
+++ b/pypy/rpython/rfloat.py
@@ -136,7 +136,10 @@
hop.exception_cannot_occur()
return hop.genop('cast_float_to_int', vlist, resulttype=Signed)
- rtype_float = rtype_pos
+ def rtype_float(_, hop):
+ vlist = hop.inputargs(Float)
+ hop.exception_cannot_occur()
+ return vlist[0]
# version picked by specialisation based on which
# type system rtyping is using, from <type_system>.ll_str module
diff --git a/pypy/rpython/rrange.py b/pypy/rpython/rrange.py
--- a/pypy/rpython/rrange.py
+++ b/pypy/rpython/rrange.py
@@ -215,4 +215,5 @@
[v_index, v_item])
def rtype_builtin_enumerate(hop):
+ hop.exception_cannot_occur()
return hop.r_result.r_baseiter.newiter(hop)
diff --git a/pypy/rpython/test/test_rclass.py b/pypy/rpython/test/test_rclass.py
--- a/pypy/rpython/test/test_rclass.py
+++ b/pypy/rpython/test/test_rclass.py
@@ -1085,6 +1085,7 @@
return annmodel.SomeInteger()
def specialize_call(self, hop):
[v_instance] = hop.inputargs(*hop.args_r)
+ hop.exception_is_here()
return hop.gendirectcall(ll_my_gethash, v_instance)
def f(n):
More information about the pypy-commit
mailing list