本文整理汇总了Python中pypy.jit.metainterp.warmstate.WarmEnterState.can_inline_callable方法的典型用法代码示例。如果您正苦于以下问题:Python WarmEnterState.can_inline_callable方法的具体用法?Python WarmEnterState.can_inline_callable怎么用?Python WarmEnterState.can_inline_callable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.jit.metainterp.warmstate.WarmEnterState
的用法示例。
在下文中一共展示了WarmEnterState.can_inline_callable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_make_jitdriver_callbacks_1
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import can_inline_callable [as 别名]
def test_make_jitdriver_callbacks_1():
class FakeWarmRunnerDesc:
can_inline_ptr = None
get_printable_location_ptr = None
state = WarmEnterState(FakeWarmRunnerDesc())
state.make_jitdriver_callbacks()
res = state.can_inline_callable([BoxInt(5), BoxFloat(42.5)])
assert res is True
res = state.get_location_str([BoxInt(5), BoxFloat(42.5)])
assert res == '(no jitdriver.get_printable_location!)'
示例2: test_make_jitdriver_callbacks_2
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import can_inline_callable [as 别名]
def test_make_jitdriver_callbacks_2():
def can_inline(x, y):
assert x == 5
assert y == 42.5
return False
CAN_INLINE = lltype.Ptr(lltype.FuncType([lltype.Signed, lltype.Float],
lltype.Bool))
class FakeWarmRunnerDesc:
rtyper = None
green_args_spec = [lltype.Signed, lltype.Float]
can_inline_ptr = llhelper(CAN_INLINE, can_inline)
get_printable_location_ptr = None
state = WarmEnterState(FakeWarmRunnerDesc())
state.make_jitdriver_callbacks()
res = state.can_inline_callable([BoxInt(5), BoxFloat(42.5)])
assert res is False
示例3: test_make_jitdriver_callbacks_1
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import can_inline_callable [as 别名]
def test_make_jitdriver_callbacks_1():
class FakeWarmRunnerDesc:
can_inline_ptr = None
get_printable_location_ptr = None
confirm_enter_jit_ptr = None
green_args_spec = [lltype.Signed, lltype.Float]
class FakeCell:
dont_trace_here = False
state = WarmEnterState(FakeWarmRunnerDesc())
def jit_getter(*args):
return FakeCell()
state.jit_getter = jit_getter
state.make_jitdriver_callbacks()
res = state.can_inline_callable([ConstInt(5), ConstFloat(42.5)])
assert res is True
res = state.get_location_str([ConstInt(5), ConstFloat(42.5)])
assert res == '(no jitdriver.get_printable_location!)'
示例4: test_make_jitdriver_callbacks_2
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import can_inline_callable [as 别名]
def test_make_jitdriver_callbacks_2():
def can_inline(x, y):
assert x == 5
assert y == 42.5
return False
CAN_INLINE = lltype.Ptr(lltype.FuncType([lltype.Signed, lltype.Float],
lltype.Bool))
class FakeCell:
dont_trace_here = False
class FakeWarmRunnerDesc:
rtyper = None
green_args_spec = [lltype.Signed, lltype.Float]
can_inline_ptr = llhelper(CAN_INLINE, can_inline)
get_printable_location_ptr = None
confirm_enter_jit_ptr = None
state = WarmEnterState(FakeWarmRunnerDesc())
def jit_getter(*args):
return FakeCell()
state.jit_getter = jit_getter
state.make_jitdriver_callbacks()
res = state.can_inline_callable([ConstInt(5), ConstFloat(42.5)])
assert res is False