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

Unified Diff: src/heap.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: Fix styles 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
« src/heap.h ('K') | « src/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 0d2cc42402f4b3457b1d28340984069d452dbd7d..9458ab0065faecfe3a677b8723a248da02ebd542 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -671,9 +671,9 @@ bool Heap::CollectGarbage(AllocationSpace space,
}
-void Heap::PerformScavenge() {
+void Heap::PerformScavenge(bool force_scavenge) {
Michael Starzinger 2012/10/25 11:47:29 This change becomes obsolete then.
haraken 2012/10/25 11:54:49 Done.
GCTracer tracer(this, NULL, NULL);
- if (incremental_marking()->IsStopped()) {
+ if (force_scavenge || incremental_marking()->IsStopped()) {
PerformGarbageCollection(SCAVENGER, &tracer);
} else {
PerformGarbageCollection(MARK_COMPACTOR, &tracer);
@@ -852,6 +852,10 @@ void Heap::UpdateSurvivalRateTrend(int start_new_space_size) {
bool Heap::PerformGarbageCollection(GarbageCollector collector,
GCTracer* tracer) {
+ if (collector == SCAVENGER)
Michael Starzinger 2012/10/25 11:47:29 Looks like leftover debugging code.
haraken 2012/10/25 11:54:49 Done.
+ fprintf(stderr, "SCAVENGER\n");
+ else
+ fprintf(stderr, "MARK_AND_COMPACT\n");
bool next_gc_likely_to_collect_more = false;
if (collector != SCAVENGER) {
« src/heap.h ('K') | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698