Author: Armin Rigo <ar...@tunes.org> Branch: exception-cannot-occur Changeset: r54132:7d6635820406 Date: 2012-04-01 20:32 +0200 http://bitbucket.org/pypy/pypy/changeset/7d6635820406/
Log: More. diff --git a/pypy/jit/backend/llgraph/llimpl.py b/pypy/jit/backend/llgraph/llimpl.py --- a/pypy/jit/backend/llgraph/llimpl.py +++ b/pypy/jit/backend/llgraph/llimpl.py @@ -1797,6 +1797,7 @@ if specialize_as_constant: def specialize_call(self, hop): llvalue = func(hop.args_s[0].const) + hop.exception_cannot_occur() return hop.inputconst(lltype.typeOf(llvalue), llvalue) else: # specialize as direct_call @@ -1813,6 +1814,7 @@ sm = ootype._static_meth(FUNCTYPE, _name=func.__name__, _callable=func) cfunc = hop.inputconst(FUNCTYPE, sm) args_v = hop.inputargs(*hop.args_r) + hop.exception_is_here() return hop.genop('direct_call', [cfunc] + args_v, hop.r_result) diff --git a/pypy/objspace/fake/objspace.py b/pypy/objspace/fake/objspace.py --- a/pypy/objspace/fake/objspace.py +++ b/pypy/objspace/fake/objspace.py @@ -86,6 +86,7 @@ return s_None def specialize_call(self, hop): + hop.exception_cannot_occur() return hop.inputconst(lltype.Void, None) # ____________________________________________________________ diff --git a/pypy/rlib/jit_hooks.py b/pypy/rlib/jit_hooks.py --- a/pypy/rlib/jit_hooks.py +++ b/pypy/rlib/jit_hooks.py @@ -22,6 +22,7 @@ c_name = hop.inputconst(lltype.Void, 'access_helper') args_v = [hop.inputarg(arg, arg=i) for i, arg in enumerate(hop.args_r)] + hop.exception_cannot_occur() return hop.genop('jit_marker', [c_name, c_func] + args_v, resulttype=hop.r_result) return helper diff --git a/pypy/rlib/rerased.py b/pypy/rlib/rerased.py --- a/pypy/rlib/rerased.py +++ b/pypy/rlib/rerased.py @@ -155,7 +155,6 @@ def specialize_call(self, hop): [v] = hop.inputargs(hop.args_r[0]) assert isinstance(hop.s_result, annmodel.SomeInteger) - hop.exception_cannot_occur() return hop.args_r[0].rtype_unerase_int(hop, v) def ll_unerase_int(gcref): @@ -217,6 +216,7 @@ return hop.genop('cast_opaque_ptr', [v], resulttype=hop.r_result) def rtype_unerase_int(self, hop, v): + hop.exception_cannot_occur() return hop.gendirectcall(ll_unerase_int, v) def rtype_erase_int(self, hop): @@ -267,6 +267,7 @@ def rtype_unerase_int(self, hop, v): c_one = hop.inputconst(lltype.Signed, 1) + hop.exception_cannot_occur() v2 = hop.genop('oounbox_int', [v], resulttype=hop.r_result) return hop.genop('int_rshift', [v2, c_one], resulttype=lltype.Signed) diff --git a/pypy/rlib/rgc.py b/pypy/rlib/rgc.py --- a/pypy/rlib/rgc.py +++ b/pypy/rlib/rgc.py @@ -382,6 +382,7 @@ def compute_result_annotation(self): return s_list_of_gcrefs() def specialize_call(self, hop): + hop.exception_cannot_occur() return hop.genop('gc_get_rpy_roots', [], resulttype = hop.r_result) class Entry(ExtRegistryEntry): @@ -392,6 +393,7 @@ return s_list_of_gcrefs() def specialize_call(self, hop): vlist = hop.inputargs(hop.args_r[0]) + hop.exception_cannot_occur() return hop.genop('gc_get_rpy_referents', vlist, resulttype = hop.r_result) @@ -402,6 +404,7 @@ return annmodel.SomeInteger() def specialize_call(self, hop): vlist = hop.inputargs(hop.args_r[0]) + hop.exception_cannot_occur() return hop.genop('gc_get_rpy_memory_usage', vlist, resulttype = hop.r_result) @@ -412,6 +415,7 @@ return annmodel.SomeInteger() def specialize_call(self, hop): vlist = hop.inputargs(hop.args_r[0]) + hop.exception_cannot_occur() return hop.genop('gc_get_rpy_type_index', vlist, resulttype = hop.r_result) @@ -430,6 +434,7 @@ return annmodel.SomeBool() def specialize_call(self, hop): vlist = hop.inputargs(hop.args_r[0]) + hop.exception_cannot_occur() return hop.genop('gc_is_rpy_instance', vlist, resulttype = hop.r_result) @@ -449,6 +454,7 @@ classrepr = getclassrepr(hop.rtyper, classdef) vtable = classrepr.getvtable() assert lltype.typeOf(vtable) == rclass.CLASSTYPE + hop.exception_cannot_occur() return Constant(vtable, concretetype=rclass.CLASSTYPE) class Entry(ExtRegistryEntry): diff --git a/pypy/rlib/rstring.py b/pypy/rlib/rstring.py --- a/pypy/rlib/rstring.py +++ b/pypy/rlib/rstring.py @@ -245,5 +245,5 @@ raise ValueError("Value is not no_nul") def specialize_call(self, hop): - pass + hop.exception_cannot_occur() diff --git a/pypy/rpython/controllerentry.py b/pypy/rpython/controllerentry.py --- a/pypy/rpython/controllerentry.py +++ b/pypy/rpython/controllerentry.py @@ -201,6 +201,7 @@ def specialize_call(self, hop): from pypy.rpython.lltypesystem import lltype assert hop.s_result.is_constant() + hop.exception_cannot_occur() return hop.inputconst(lltype.Bool, hop.s_result.const) # ____________________________________________________________ diff --git a/pypy/translator/cli/dotnet.py b/pypy/translator/cli/dotnet.py --- a/pypy/translator/cli/dotnet.py +++ b/pypy/translator/cli/dotnet.py @@ -459,6 +459,7 @@ def specialize_call(self, hop): + hop.exception_cannot_occur() assert hop.args_s[1].is_constant() TYPE = hop.args_s[1].const v_obj = hop.inputarg(hop.args_r[0], arg=0) @@ -507,6 +508,7 @@ def specialize_call(self, hop): v_obj, = hop.inputargs(*hop.args_r) + hop.exception_cannot_occur() return hop.genop('same_as', [v_obj], hop.r_result.lowleveltype) def new_array(type, length): @@ -608,6 +610,7 @@ def specialize_call(self, hop): v_type, = hop.inputargs(*hop.args_r) + hop.exception_cannot_occur() return hop.genop('cli_typeof', [v_type], hop.r_result.lowleveltype) @@ -626,6 +629,7 @@ v_obj, = hop.inputargs(*hop.args_r) methodname = hop.args_r[0].methodname c_methodname = hop.inputconst(ootype.Void, methodname) + hop.exception_cannot_occur() return hop.genop('cli_eventhandler', [v_obj, c_methodname], hop.r_result.lowleveltype) @@ -647,6 +651,7 @@ def specialize_call(self, hop): assert isinstance(hop.args_s[0], annmodel.SomeOOInstance) v_inst = hop.inputarg(hop.args_r[0], arg=0) + hop.exception_cannot_occur() return hop.genop('oodowncast', [v_inst], resulttype = hop.r_result.lowleveltype) @@ -668,6 +673,7 @@ def specialize_call(self, hop): assert isinstance(hop.args_s[0], annmodel.SomeOOInstance) v_inst = hop.inputarg(hop.args_r[0], arg=0) + hop.exception_cannot_occur() return hop.genop('ooupcast', [v_inst], resulttype = hop.r_result.lowleveltype) @@ -701,6 +707,7 @@ def specialize_call(self, hop): v_obj = hop.inputarg(hop.args_r[0], arg=0) + hop.exception_cannot_occur() return hop.genop('oodowncast', [v_obj], hop.r_result.lowleveltype) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit