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

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: Check constructor. Created 5 years, 9 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') | no next file with comments »
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 6e6f00cd591ac20da9fcd896ef6e04ef70b9e6f1..a59d8ba35fbf7a2140704f4cda8af89a1c4e78e2 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -928,6 +928,7 @@ int Heap::NotifyContextDisposed(bool dependant_context) {
isolate()->optimizing_compiler_thread()->Flush();
}
AgeInlineCaches();
+ set_retained_maps(ArrayList::cast(empty_fixed_array()));
tracer()->AddContextDisposalTime(base::OS::TimeCurrentMillis());
return ++contexts_disposed_;
}
@@ -3110,6 +3111,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,
@@ -3160,6 +3162,7 @@ bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) {
case kMicrotaskQueueRootIndex:
case kDetachedContextsRootIndex:
case kWeakObjectToCodeTableRootIndex:
+ case kRetainedMapsRootIndex:
// Smi values
#define SMI_ENTRY(type, name, Name) case k##Name##RootIndex:
SMI_ROOT_LIST(SMI_ENTRY)
@@ -5753,6 +5756,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698