Reviewers: Hannes Payer,

Description:
Update Isolate::RequestGarbageCollection after r18691

BUG=none
[email protected]
LOG=n

Please review this at https://codereview.chromium.org/143403002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+5, -10 lines):
  M src/api.cc
  M src/extensions/gc-extension.cc


Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 6b5c1a921c2d7904d44241ab4b99ee929c2f159b..3aa7af7366c6b65c92e13cfa5d686f98055f380b 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<i::Isolate*>(this)->heap()->CollectAllGarbage(
-        i::Heap::kNoGCFlags, "Isolate::RequestGarbageCollection",
-        kGCCallbackFlagForced);
+        i::Heap::kAbortIncrementalMarkingMask,
+        "Isolate::RequestGarbageCollection", kGCCallbackFlagForced);
   }
 }

Index: src/extensions/gc-extension.cc
diff --git a/src/extensions/gc-extension.cc b/src/extensions/gc-extension.cc
index c79024939250f975e481e378d5eaa7fb43f8548d..1d4873de73ed01d99a81d8a9bf6af3b90764a446 100644
--- a/src/extensions/gc-extension.cc
+++ b/src/extensions/gc-extension.cc
@@ -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


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to