From: jochen@chromium.org Date: Mon, 20 Jan 2014 15:44:03 +0000 (+0000) Subject: Update Isolate::RequestGarbageCollection after r18691 X-Git-Tag: upstream/4.7.83~11094 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c970c1cb6f0c753cdc6fef5991d0a209c418e7a4;p=platform%2Fupstream%2Fv8.git Update Isolate::RequestGarbageCollection after r18691 BUG=none R=hpayer@chromium.org LOG=n Review URL: https://codereview.chromium.org/143403002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18695 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/api.cc b/src/api.cc index 6b5c1a9..3aa7af7 100644 --- a/src/api.cc +++ b/src/api.cc @@ -6444,8 +6444,8 @@ void Isolate::RequestGarbageCollectionForTesting(GarbageCollectionType type) { } else { ASSERT_EQ(kFullGarbageCollection, type); reinterpret_cast(this)->heap()->CollectAllGarbage( - i::Heap::kNoGCFlags, "Isolate::RequestGarbageCollection", - kGCCallbackFlagForced); + i::Heap::kAbortIncrementalMarkingMask, + "Isolate::RequestGarbageCollection", kGCCallbackFlagForced); } } diff --git a/src/extensions/gc-extension.cc b/src/extensions/gc-extension.cc index c790249..1d4873d 100644 --- a/src/extensions/gc-extension.cc +++ b/src/extensions/gc-extension.cc @@ -40,14 +40,9 @@ v8::Handle GCExtension::GetNativeFunctionTemplate( void GCExtension::GC(const v8::FunctionCallbackInfo& args) { - i::Isolate* isolate = reinterpret_cast(args.GetIsolate()); - if (args[0]->BooleanValue()) { - isolate->heap()->CollectGarbage( - NEW_SPACE, "gc extension", v8::kGCCallbackFlagForced); - } else { - isolate->heap()->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask, - "gc extension", v8::kGCCallbackFlagForced); - } + args.GetIsolate()->RequestGarbageCollectionForTesting( + args[0]->BooleanValue() ? v8::Isolate::kMinorGarbageCollection + : v8::Isolate::kFullGarbageCollection); } } } // namespace v8::internal diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index b54aa16..5af3e7a 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -7121,6 +7121,7 @@ void WhammyPropertyGetter(Local name, THREADED_TEST(WeakReference) { + i::FLAG_expose_gc = true; v8::Isolate* isolate = CcTest::isolate(); v8::HandleScope handle_scope(isolate); v8::Handle templ= v8::ObjectTemplate::New(isolate); @@ -13479,6 +13480,7 @@ static void CheckSurvivingGlobalObjectsCount(int expected) { TEST(DontLeakGlobalObjects) { // Regression test for issues 1139850 and 1174891. + i::FLAG_expose_gc = true; v8::V8::Initialize(); for (int i = 0; i < 5; i++) { diff --git a/test/cctest/test-compiler.cc b/test/cctest/test-compiler.cc index 7df8511..ae414d7 100644 --- a/test/cctest/test-compiler.cc +++ b/test/cctest/test-compiler.cc @@ -232,6 +232,7 @@ TEST(UncaughtThrow) { // | JS | // | C-to-JS | TEST(C2JSFrames) { + FLAG_expose_gc = true; v8::HandleScope scope(CcTest::isolate()); v8::Local context = CcTest::NewContext(PRINT_EXTENSION | GC_EXTENSION);