本文整理汇总了Python中pypy.jit.metainterp.heapcache.HeapCache.reset方法的典型用法代码示例。如果您正苦于以下问题:Python HeapCache.reset方法的具体用法?Python HeapCache.reset怎么用?Python HeapCache.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.jit.metainterp.heapcache.HeapCache
的用法示例。
在下文中一共展示了HeapCache.reset方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_nonstandard_virtualizable
# 需要导入模块: from pypy.jit.metainterp.heapcache import HeapCache [as 别名]
# 或者: from pypy.jit.metainterp.heapcache.HeapCache import reset [as 别名]
def test_nonstandard_virtualizable(self):
h = HeapCache()
assert not h.is_nonstandard_virtualizable(1)
assert not h.is_nonstandard_virtualizable(2)
h.nonstandard_virtualizables_now_known(1)
assert h.is_nonstandard_virtualizable(1)
assert not h.is_nonstandard_virtualizable(2)
h.reset()
assert not h.is_nonstandard_virtualizable(1)
assert not h.is_nonstandard_virtualizable(2)
示例2: test_known_class_box
# 需要导入模块: from pypy.jit.metainterp.heapcache import HeapCache [as 别名]
# 或者: from pypy.jit.metainterp.heapcache.HeapCache import reset [as 别名]
def test_known_class_box(self):
h = HeapCache()
assert not h.is_class_known(1)
assert not h.is_class_known(2)
h.class_now_known(1)
assert h.is_class_known(1)
assert not h.is_class_known(2)
h.reset()
assert not h.is_class_known(1)
assert not h.is_class_known(2)
示例3: test_heapcache_read_fields_multiple
# 需要导入模块: from pypy.jit.metainterp.heapcache import HeapCache [as 别名]
# 或者: from pypy.jit.metainterp.heapcache.HeapCache import reset [as 别名]
def test_heapcache_read_fields_multiple(self):
h = HeapCache()
h.getfield_now_known(box1, descr1, box2)
h.getfield_now_known(box3, descr1, box4)
assert h.getfield(box1, descr1) is box2
assert h.getfield(box1, descr2) is None
assert h.getfield(box3, descr1) is box4
assert h.getfield(box3, descr2) is None
h.reset()
assert h.getfield(box1, descr1) is None
assert h.getfield(box1, descr2) is None
assert h.getfield(box3, descr1) is None
assert h.getfield(box3, descr2) is None
示例4: test_heapcache_read_fields_multiple_array
# 需要导入模块: from pypy.jit.metainterp.heapcache import HeapCache [as 别名]
# 或者: from pypy.jit.metainterp.heapcache.HeapCache import reset [as 别名]
def test_heapcache_read_fields_multiple_array(self):
h = HeapCache()
h.getarrayitem_now_known(box1, descr1, index1, box2)
h.getarrayitem_now_known(box3, descr1, index1, box4)
assert h.getarrayitem(box1, descr1, index1) is box2
assert h.getarrayitem(box1, descr2, index1) is None
assert h.getarrayitem(box3, descr1, index1) is box4
assert h.getarrayitem(box3, descr2, index1) is None
h.reset()
assert h.getarrayitem(box1, descr1, index1) is None
assert h.getarrayitem(box1, descr2, index1) is None
assert h.getarrayitem(box3, descr1, index1) is None
assert h.getarrayitem(box3, descr2, index1) is None
示例5: test_heapcache_arrays
# 需要导入模块: from pypy.jit.metainterp.heapcache import HeapCache [as 别名]
# 或者: from pypy.jit.metainterp.heapcache.HeapCache import reset [as 别名]
def test_heapcache_arrays(self):
h = HeapCache()
assert h.getarrayitem(box1, descr1, index1) is None
assert h.getarrayitem(box1, descr2, index1) is None
assert h.getarrayitem(box1, descr1, index2) is None
assert h.getarrayitem(box1, descr2, index2) is None
h.setarrayitem(box1, descr1, index1, box2)
assert h.getarrayitem(box1, descr1, index1) is box2
assert h.getarrayitem(box1, descr2, index1) is None
assert h.getarrayitem(box1, descr1, index2) is None
assert h.getarrayitem(box1, descr2, index2) is None
h.setarrayitem(box1, descr1, index2, box4)
assert h.getarrayitem(box1, descr1, index1) is box2
assert h.getarrayitem(box1, descr2, index1) is None
assert h.getarrayitem(box1, descr1, index2) is box4
assert h.getarrayitem(box1, descr2, index2) is None
h.setarrayitem(box1, descr2, index1, box3)
assert h.getarrayitem(box1, descr1, index1) is box2
assert h.getarrayitem(box1, descr2, index1) is box3
assert h.getarrayitem(box1, descr1, index2) is box4
assert h.getarrayitem(box1, descr2, index2) is None
h.setarrayitem(box1, descr1, index1, box3)
assert h.getarrayitem(box1, descr1, index1) is box3
assert h.getarrayitem(box1, descr2, index1) is box3
assert h.getarrayitem(box1, descr1, index2) is box4
assert h.getarrayitem(box1, descr2, index2) is None
h.setarrayitem(box3, descr1, index1, box1)
assert h.getarrayitem(box3, descr1, index1) is box1
assert h.getarrayitem(box1, descr1, index1) is None
assert h.getarrayitem(box1, descr2, index1) is box3
assert h.getarrayitem(box1, descr1, index2) is box4
assert h.getarrayitem(box1, descr2, index2) is None
h.reset()
assert h.getarrayitem(box1, descr1, index1) is None
assert h.getarrayitem(box1, descr2, index1) is None
assert h.getarrayitem(box3, descr1, index1) is None
示例6: test_heapcache_fields
# 需要导入模块: from pypy.jit.metainterp.heapcache import HeapCache [as 别名]
# 或者: from pypy.jit.metainterp.heapcache.HeapCache import reset [as 别名]
def test_heapcache_fields(self):
h = HeapCache()
assert h.getfield(box1, descr1) is None
assert h.getfield(box1, descr2) is None
h.setfield(box1, descr1, box2)
assert h.getfield(box1, descr1) is box2
assert h.getfield(box1, descr2) is None
h.setfield(box1, descr2, box3)
assert h.getfield(box1, descr1) is box2
assert h.getfield(box1, descr2) is box3
h.setfield(box1, descr1, box3)
assert h.getfield(box1, descr1) is box3
assert h.getfield(box1, descr2) is box3
h.setfield(box3, descr1, box1)
assert h.getfield(box3, descr1) is box1
assert h.getfield(box1, descr1) is None
assert h.getfield(box1, descr2) is box3
h.reset()
assert h.getfield(box1, descr1) is None
assert h.getfield(box1, descr2) is None
assert h.getfield(box3, descr1) is None