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

Unified Diff: src/heap/heap.cc

Issue 980523004: Retain maps embedded in optimized code for several garbage collections. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Clear on context disposal Created 5 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/heap.h ('k') | src/heap/mark-compact.h » ('j') | src/objects-inl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 26cffc8fb5524e51310776f74c2fbc3e0e7edf8b..978920ff01d8da694ae9fd37c11a5a9f0a9e3a58 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -915,6 +915,7 @@ int Heap::NotifyContextDisposed(bool dependant_context) {
if (!dependant_context) {
tracer()->ResetSurvivalEvents();
old_generation_size_configured_ = false;
+ set_retained_maps(ArrayList::cast(empty_fixed_array()));
}
if (isolate()->concurrent_recompilation_enabled()) {
// Flush the queued recompilation tasks.
@@ -3107,6 +3108,7 @@ void Heap::CreateInitialObjects() {
}
set_detached_contexts(empty_fixed_array());
+ set_retained_maps(ArrayList::cast(empty_fixed_array()));
set_weak_object_to_code_table(
*WeakHashTable::New(isolate(), 16, USE_DEFAULT_MINIMUM_CAPACITY,
@@ -5747,6 +5749,18 @@ DependentCode* Heap::LookupWeakObjectToCodeDependency(Handle<HeapObject> obj) {
}
+void Heap::AddRetainedMap(Handle<Map> map) {
+ if (FLAG_retain_maps_for_n_gc == 0) return;
+ Handle<WeakCell> cell = Map::WeakCellForMap(map);
+ Handle<ArrayList> array(retained_maps(), isolate());
+ array = ArrayList::Add(
+ array, cell, handle(Smi::FromInt(FLAG_retain_maps_for_n_gc), isolate()));
+ if (*array != retained_maps()) {
+ set_retained_maps(*array);
+ }
+}
+
+
void Heap::FatalProcessOutOfMemory(const char* location, bool take_snapshot) {
v8::internal::V8::FatalProcessOutOfMemory(location, take_snapshot);
}
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.h » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698