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

Unified Diff: src/heap.cc

Issue 27201: Experimental (somewhat): Force GCs when disposing contexts. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 10 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 | « src/heap.h ('k') | src/v8-counters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 1363)
+++ src/heap.cc (working copy)
@@ -97,6 +97,7 @@
int Heap::gc_count_ = 0;
int Heap::always_allocate_scope_depth_ = 0;
+bool Heap::context_disposed_pending_ = false;
#ifdef DEBUG
bool Heap::allocation_allowed_ = true;
@@ -293,6 +294,20 @@
}
+void Heap::CollectAllGarbageIfContextDisposed() {
+ if (context_disposed_pending_) {
+ StatsRateScope scope(&Counters::gc_context);
+ CollectAllGarbage();
+ context_disposed_pending_ = false;
+ }
+}
+
+
+void Heap::NotifyContextDisposed() {
+ context_disposed_pending_ = true;
+}
+
+
bool Heap::CollectGarbage(int requested_size, AllocationSpace space) {
// The VM is in the GC state until exiting this function.
VMState state(GC);
@@ -432,6 +447,7 @@
Shrink();
Counters::objs_since_last_full.Set(0);
+ context_disposed_pending_ = false;
}
« no previous file with comments | « src/heap.h ('k') | src/v8-counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698