Update Isolate::RequestGarbageCollection after r18691
authorjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 20 Jan 2014 15:44:03 +0000 (15:44 +0000)
committerjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 20 Jan 2014 15:44:03 +0000 (15:44 +0000)
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

src/api.cc
src/extensions/gc-extension.cc
test/cctest/test-api.cc
test/cctest/test-compiler.cc

index 6b5c1a9..3aa7af7 100644 (file)
@@ -6444,8 +6444,8 @@ void Isolate::RequestGarbageCollectionForTesting(GarbageCollectionType type) {
   } else {
     ASSERT_EQ(kFullGarbageCollection, type);
     reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage(
-        i::Heap::kNoGCFlags, "Isolate::RequestGarbageCollection",
-        kGCCallbackFlagForced);
+        i::Heap::kAbortIncrementalMarkingMask,
+        "Isolate::RequestGarbageCollection", kGCCallbackFlagForced);
   }
 }
 
index c790249..1d4873d 100644 (file)
@@ -40,14 +40,9 @@ v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunctionTemplate(
 
 
 void GCExtension::GC(const v8::FunctionCallbackInfo<v8::Value>& args) {
-  i::Isolate* isolate = reinterpret_cast<i::Isolate*>(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
index b54aa16..5af3e7a 100644 (file)
@@ -7121,6 +7121,7 @@ void WhammyPropertyGetter(Local<String> name,
 
 
 THREADED_TEST(WeakReference) {
+  i::FLAG_expose_gc = true;
   v8::Isolate* isolate = CcTest::isolate();
   v8::HandleScope handle_scope(isolate);
   v8::Handle<v8::ObjectTemplate> 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++) {
index 7df8511..ae414d7 100644 (file)
@@ -232,6 +232,7 @@ TEST(UncaughtThrow) {
 //   |      JS       |
 //   |   C-to-JS     |
 TEST(C2JSFrames) {
+  FLAG_expose_gc = true;
   v8::HandleScope scope(CcTest::isolate());
   v8::Local<v8::Context> context =
     CcTest::NewContext(PRINT_EXTENSION | GC_EXTENSION);