本文整理汇总了Python中pypy.jit.codewriter.jtransform.Transformer._get_list_nonneg_canraise_flags方法的典型用法代码示例。如果您正苦于以下问题:Python Transformer._get_list_nonneg_canraise_flags方法的具体用法?Python Transformer._get_list_nonneg_canraise_flags怎么用?Python Transformer._get_list_nonneg_canraise_flags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.jit.codewriter.jtransform.Transformer
的用法示例。
在下文中一共展示了Transformer._get_list_nonneg_canraise_flags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: builtin_test
# 需要导入模块: from pypy.jit.codewriter.jtransform import Transformer [as 别名]
# 或者: from pypy.jit.codewriter.jtransform.Transformer import _get_list_nonneg_canraise_flags [as 别名]
def builtin_test(oopspec_name, args, RESTYPE, expected):
v_result = varoftype(RESTYPE)
tr = Transformer(FakeCPU(), FakeCallControl())
tr.immutable_arrays = {}
tr.vable_array_vars = {}
if '/' in oopspec_name:
oopspec_name, property = oopspec_name.split('/')
def force_flags(op):
if property == 'NONNEG': return True
if property == 'NEG': return False
raise ValueError(property)
tr._get_list_nonneg_canraise_flags = force_flags
op = SpaceOperation('direct_call',
[Constant("myfunc", lltype.Void)] + args,
v_result)
try:
oplist = tr._handle_list_call(op, oopspec_name, args)
except NotSupported:
assert expected is NotSupported
else:
assert expected is not NotSupported
assert oplist is not None
flattener = GraphFlattener(None, fake_regallocs())
if not isinstance(oplist, list):
oplist = [oplist]
for op1 in oplist:
flattener.serialize_op(op1)
assert_format(flattener.ssarepr, expected)