本文整理汇总了Python中pypy.jit.metainterp.warmstate.WarmEnterState.make_jitcell_getter方法的典型用法代码示例。如果您正苦于以下问题:Python WarmEnterState.make_jitcell_getter方法的具体用法?Python WarmEnterState.make_jitcell_getter怎么用?Python WarmEnterState.make_jitcell_getter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.jit.metainterp.warmstate.WarmEnterState
的用法示例。
在下文中一共展示了WarmEnterState.make_jitcell_getter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_make_jitcell_getter
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import make_jitcell_getter [as 别名]
def test_make_jitcell_getter():
class FakeWarmRunnerDesc:
green_args_spec = [lltype.Float]
get_jitcell_at_ptr = None
state = WarmEnterState(FakeWarmRunnerDesc())
get_jitcell = state.make_jitcell_getter()
cell1 = get_jitcell(1.75)
cell2 = get_jitcell(1.75)
assert cell1 is cell2
assert get_jitcell is state.make_jitcell_getter()
示例2: test_make_jitcell_getter
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import make_jitcell_getter [as 别名]
def test_make_jitcell_getter():
class FakeJitDriverSD:
_green_args_spec = [lltype.Float]
_get_jitcell_at_ptr = None
state = WarmEnterState(None, FakeJitDriverSD())
get_jitcell = state.make_jitcell_getter()
cell1 = get_jitcell(True, 1.75)
cell2 = get_jitcell(True, 1.75)
assert cell1 is cell2
assert get_jitcell is state.make_jitcell_getter()
示例3: test_attach_unoptimized_bridge_from_interp
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import make_jitcell_getter [as 别名]
def test_attach_unoptimized_bridge_from_interp():
class FakeWarmRunnerDesc:
green_args_spec = [lltype.Signed, lltype.Float]
get_jitcell_at_ptr = None
state = WarmEnterState(FakeWarmRunnerDesc())
get_jitcell = state.make_jitcell_getter()
state.attach_unoptimized_bridge_from_interp([BoxInt(5), BoxFloat(2.25)],
"entry loop token")
cell1 = get_jitcell(5, 2.25)
assert cell1.counter < 0
assert cell1.entry_loop_token == "entry loop token"
示例4: test_attach_unoptimized_bridge_from_interp
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import make_jitcell_getter [as 别名]
def test_attach_unoptimized_bridge_from_interp():
class FakeJitDriverSD:
_green_args_spec = [lltype.Signed, lltype.Float]
_get_jitcell_at_ptr = None
state = WarmEnterState(None, FakeJitDriverSD())
get_jitcell = state.make_jitcell_getter()
class FakeLoopToken(object):
pass
looptoken = FakeLoopToken()
state.attach_unoptimized_bridge_from_interp([ConstInt(5),
constfloat(2.25)],
looptoken)
cell1 = get_jitcell(True, 5, 2.25)
assert cell1.counter < 0
assert cell1.get_entry_loop_token() is looptoken