[pypy-commit] pypy default: make record_exact_class checkable with lldebug
cfbolz
noreply at buildbot.pypy.org
Wed Aug 19 18:23:17 CEST 2015
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch:
Changeset: r79062:6775ce8fbaee
Date: 2015-08-19 18:04 +0200
http://bitbucket.org/pypy/pypy/changeset/6775ce8fbaee/
Log: make record_exact_class checkable with lldebug
diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -1087,6 +1087,16 @@
"""
assert type(value) is cls
+def ll_record_exact_class(ll_value, ll_cls):
+ from rpython.rlib.debug import ll_assert
+ from rpython.rtyper.lltypesystem.lloperation import llop
+ from rpython.rtyper.lltypesystem import lltype
+ from rpython.rtyper.rclass import ll_type
+ ll_assert(ll_value == lltype.nullptr(lltype.typeOf(ll_value).TO), "record_exact_class called with None argument")
+ ll_assert(ll_type(ll_value) is ll_cls, "record_exact_class called with invalid arguments")
+ llop.jit_record_exact_class(lltype.Void, ll_value, ll_cls)
+
+
class Entry(ExtRegistryEntry):
_about_ = record_exact_class
@@ -1100,12 +1110,10 @@
from rpython.rtyper import rclass
classrepr = rclass.get_type_repr(hop.rtyper)
-
- hop.exception_cannot_occur()
v_inst = hop.inputarg(hop.args_r[0], arg=0)
v_cls = hop.inputarg(classrepr, arg=1)
- return hop.genop('jit_record_exact_class', [v_inst, v_cls],
- resulttype=lltype.Void)
+ hop.exception_is_here()
+ return hop.gendirectcall(ll_record_exact_class, v_inst, v_cls)
def _jit_conditional_call(condition, function, *args):
pass
More information about the pypy-commit
mailing list