| Index: test/cctest/test-heap.cc
|
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
|
| index eb4f07245a9c9927a800b13d834ab0d73189dadc..4ec205630ea80e150b1debf33acabcb1f960b1cc 100644
|
| --- a/test/cctest/test-heap.cc
|
| +++ b/test/cctest/test-heap.cc
|
| @@ -358,10 +358,11 @@ TEST(GlobalHandles) {
|
|
|
| static bool WeakPointerCleared = false;
|
|
|
| -static void TestWeakGlobalHandleCallback(v8::Persistent<v8::Value> handle,
|
| +static void TestWeakGlobalHandleCallback(v8::Isolate* isolate,
|
| + v8::Persistent<v8::Value> handle,
|
| void* id) {
|
| if (1234 == reinterpret_cast<intptr_t>(id)) WeakPointerCleared = true;
|
| - handle.Dispose();
|
| + handle.Dispose(isolate);
|
| }
|
|
|
|
|
| @@ -386,6 +387,7 @@ TEST(WeakGlobalHandlesScavenge) {
|
|
|
| global_handles->MakeWeak(h2.location(),
|
| reinterpret_cast<void*>(1234),
|
| + NULL,
|
| &TestWeakGlobalHandleCallback);
|
|
|
| // Scavenge treats weak pointers as normal roots.
|
| @@ -429,6 +431,7 @@ TEST(WeakGlobalHandlesMark) {
|
|
|
| global_handles->MakeWeak(h2.location(),
|
| reinterpret_cast<void*>(1234),
|
| + NULL,
|
| &TestWeakGlobalHandleCallback);
|
| CHECK(!GlobalHandles::IsNearDeath(h1.location()));
|
| CHECK(!GlobalHandles::IsNearDeath(h2.location()));
|
| @@ -462,6 +465,7 @@ TEST(DeleteWeakGlobalHandle) {
|
|
|
| global_handles->MakeWeak(h.location(),
|
| reinterpret_cast<void*>(1234),
|
| + NULL,
|
| &TestWeakGlobalHandleCallback);
|
|
|
| // Scanvenge does not recognize weak reference.
|
| @@ -1314,7 +1318,7 @@ TEST(TestInternalWeakLists) {
|
|
|
| // Dispose the native contexts one by one.
|
| for (int i = 0; i < kNumTestContexts; i++) {
|
| - ctx[i].Dispose();
|
| + ctx[i].Dispose(ctx[i]->GetIsolate());
|
| ctx[i].Clear();
|
|
|
| // Scavenge treats these references as strong.
|
| @@ -1617,12 +1621,12 @@ TEST(LeakNativeContextViaMap) {
|
| ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
|
| ctx2->Exit();
|
| ctx1->Exit();
|
| - ctx1.Dispose();
|
| + ctx1.Dispose(ctx1->GetIsolate());
|
| v8::V8::ContextDisposedNotification();
|
| }
|
| HEAP->CollectAllAvailableGarbage();
|
| CHECK_EQ(2, NumberOfGlobalObjects());
|
| - ctx2.Dispose();
|
| + ctx2.Dispose(ctx2->GetIsolate());
|
| HEAP->CollectAllAvailableGarbage();
|
| CHECK_EQ(0, NumberOfGlobalObjects());
|
| }
|
| @@ -1655,12 +1659,12 @@ TEST(LeakNativeContextViaFunction) {
|
| ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
|
| ctx2->Exit();
|
| ctx1->Exit();
|
| - ctx1.Dispose();
|
| + ctx1.Dispose(ctx1->GetIsolate());
|
| v8::V8::ContextDisposedNotification();
|
| }
|
| HEAP->CollectAllAvailableGarbage();
|
| CHECK_EQ(2, NumberOfGlobalObjects());
|
| - ctx2.Dispose();
|
| + ctx2.Dispose(ctx2->GetIsolate());
|
| HEAP->CollectAllAvailableGarbage();
|
| CHECK_EQ(0, NumberOfGlobalObjects());
|
| }
|
| @@ -1691,12 +1695,12 @@ TEST(LeakNativeContextViaMapKeyed) {
|
| ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
|
| ctx2->Exit();
|
| ctx1->Exit();
|
| - ctx1.Dispose();
|
| + ctx1.Dispose(ctx1->GetIsolate());
|
| v8::V8::ContextDisposedNotification();
|
| }
|
| HEAP->CollectAllAvailableGarbage();
|
| CHECK_EQ(2, NumberOfGlobalObjects());
|
| - ctx2.Dispose();
|
| + ctx2.Dispose(ctx2->GetIsolate());
|
| HEAP->CollectAllAvailableGarbage();
|
| CHECK_EQ(0, NumberOfGlobalObjects());
|
| }
|
| @@ -1731,12 +1735,12 @@ TEST(LeakNativeContextViaMapProto) {
|
| ctx2->Global()->Set(v8_str("o"), v8::Int32::New(0));
|
| ctx2->Exit();
|
| ctx1->Exit();
|
| - ctx1.Dispose();
|
| + ctx1.Dispose(ctx1->GetIsolate());
|
| v8::V8::ContextDisposedNotification();
|
| }
|
| HEAP->CollectAllAvailableGarbage();
|
| CHECK_EQ(2, NumberOfGlobalObjects());
|
| - ctx2.Dispose();
|
| + ctx2.Dispose(ctx2->GetIsolate());
|
| HEAP->CollectAllAvailableGarbage();
|
| CHECK_EQ(0, NumberOfGlobalObjects());
|
| }
|
|
|