Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
 def test_is_likely_virtual_3(self):
     h = HeapCache()
     box1 = RefFrontendOp(1)
     h.new(box1)
     assert h.is_unescaped(box1)
     assert h.is_likely_virtual(box1)
     h.reset_keep_likely_virtuals()
     assert not h.is_unescaped(box1)
     assert h.is_likely_virtual(box1)
     h.class_now_known(box1)     # interaction of the two families of flags
     assert not h.is_unescaped(box1)
     assert h.is_likely_virtual(box1)
Beispiel #4
0
 def test_is_likely_virtual_3(self):
     h = HeapCache()
     box1 = RefFrontendOp(1)
     h.new(box1)
     assert h.is_unescaped(box1)
     assert h.is_likely_virtual(box1)
     h.reset_keep_likely_virtuals()
     assert not h.is_unescaped(box1)
     assert h.is_likely_virtual(box1)
     h.class_now_known(box1)     # interaction of the two families of flags
     assert not h.is_unescaped(box1)
     assert h.is_likely_virtual(box1)
Beispiel #5
0
    def test_known_nullity_more_cases(self):
        h = HeapCache()
        box1 = RefFrontendOp(1)
        box2 = RefFrontendOp(2)
        h.class_now_known(box1)
        assert h.is_nullity_known(box1)

        h.new(box2)
        assert h.is_nullity_known(box2)

        h.reset()
        assert not h.is_nullity_known(box1)
        assert not h.is_nullity_known(box2)
Beispiel #6
0
    def test_known_class_box(self):
        h = HeapCache()
        box1 = RefFrontendOp(1)
        box2 = RefFrontendOp(2)
        assert not h.is_class_known(box1)
        assert not h.is_class_known(box2)
        h.class_now_known(box1)
        assert h.is_class_known(box1)
        assert not h.is_class_known(box2)

        h.reset()
        assert not h.is_class_known(box1)
        assert not h.is_class_known(box2)
Beispiel #7
0
    def test_known_class_box(self):
        h = HeapCache()
        box1 = RefFrontendOp(1)
        box2 = RefFrontendOp(2)
        assert not h.is_class_known(box1)
        assert not h.is_class_known(box2)
        h.class_now_known(box1)
        assert h.is_class_known(box1)
        assert not h.is_class_known(box2)

        h.reset()
        assert not h.is_class_known(box1)
        assert not h.is_class_known(box2)