Index: src/extensions/gc-extension.cc |
diff --git a/src/extensions/gc-extension.cc b/src/extensions/gc-extension.cc |
index f921552aaaa7fa2c3156cb35c5904bfbe1d7f9fc..813b9219bfec7eacd0638cf002c8abb368bba3d2 100644 |
--- a/src/extensions/gc-extension.cc |
+++ b/src/extensions/gc-extension.cc |
@@ -40,7 +40,11 @@ v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunction( |
v8::Handle<v8::Value> GCExtension::GC(const v8::Arguments& args) { |
- HEAP->CollectAllGarbage(Heap::kNoGCFlags, "gc extension"); |
+ if (args[0]->BooleanValue()) { |
+ HEAP->CollectGarbage(NEW_SPACE, "gc extension"); |
+ } else { |
+ HEAP->CollectAllGarbage(Heap::kNoGCFlags, "gc extension"); |
+ } |
return v8::Undefined(); |
} |