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 |