| Index: Source/heap/HeapTest.cpp
|
| diff --git a/Source/heap/HeapTest.cpp b/Source/heap/HeapTest.cpp
|
| index a1d3512127e22c51391a26ee5b91cd081c1a63b0..51743f74e7b6095730eb24ecc12d3da687bad6bc 100644
|
| --- a/Source/heap/HeapTest.cpp
|
| +++ b/Source/heap/HeapTest.cpp
|
| @@ -338,7 +338,7 @@ public:
|
| visitor->trace(m_bar);
|
| }
|
|
|
| - void clear() { m_bar.clear(); }
|
| + void clear() { m_bar.release(); }
|
|
|
| private:
|
| explicit Baz(Bar* bar)
|
| @@ -653,8 +653,8 @@ TEST(HeapTest, TypedHeapSanity)
|
| // We use TraceCounter for allocating an object on the general heap.
|
| Persistent<TraceCounter> generalHeapObject = TraceCounter::create();
|
| Persistent<TestTypedHeapClass> typedHeapObject = TestTypedHeapClass::create();
|
| - EXPECT_NE(pageHeaderAddress(reinterpret_cast<Address>(generalHeapObject.raw())),
|
| - pageHeaderAddress(reinterpret_cast<Address>(typedHeapObject.raw())));
|
| + EXPECT_NE(pageHeaderAddress(reinterpret_cast<Address>(generalHeapObject.get())),
|
| + pageHeaderAddress(reinterpret_cast<Address>(typedHeapObject.get())));
|
| }
|
|
|
| Heap::shutdown();
|
| @@ -994,7 +994,7 @@ TEST(HeapTest, WeakMembers)
|
| EXPECT_FALSE(h4->weakIsThere()); // h3 is gone from weak pointer.
|
| EXPECT_TRUE(h5->strongIsThere());
|
| EXPECT_FALSE(h5->weakIsThere()); // h3 is gone from weak pointer.
|
| - h1.clear(); // Zero out h1.
|
| + h1.release(); // Zero out h1.
|
| Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
|
| EXPECT_EQ(3u, Bar::s_live); // Only h4, h5 and h2 are left.
|
| EXPECT_TRUE(h4->strongIsThere()); // h2 is still pointed to from h4.
|
| @@ -1007,6 +1007,21 @@ TEST(HeapTest, WeakMembers)
|
| Heap::shutdown();
|
| }
|
|
|
| +TEST(HeapTest, Comparisons)
|
| +{
|
| + Heap::init();
|
| +
|
| + {
|
| + Persistent<Bar> barPersistent = Bar::create();
|
| + Persistent<Foo> fooPersistent = Foo::create(barPersistent);
|
| + EXPECT_TRUE(barPersistent != fooPersistent);
|
| + barPersistent = fooPersistent;
|
| + EXPECT_TRUE(barPersistent == fooPersistent);
|
| + }
|
| +
|
| + Heap::shutdown();
|
| +}
|
| +
|
| DEFINE_GC_INFO(Bar);
|
| DEFINE_GC_INFO(Baz);
|
| DEFINE_GC_INFO(ClassWithMember);
|
|
|