Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(927)

Unified Diff: src/extensions/gc-extension.cc

Issue 11232065: Expose gc(true) to JavaScript, which triggers a scavenger GC. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Reviewer comments addressed Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698