本文整理匯總了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