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

Unified Diff: src/isolate.cc

Issue 2407153002: [heap] Use RAIL mode for initial heap sizing (Closed)
Patch Set: fix test Created 4 years 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/isolate.h ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 42a5a55b9d622a39ecf8cea37bcf555a7329b47f..2dc44d9355b4fa3977346329120cf61bf3a985ad 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2112,6 +2112,7 @@ Isolate::Isolate(bool enable_serializer)
// be fixed once the default isolate cleanup is done.
random_number_generator_(NULL),
rail_mode_(PERFORMANCE_ANIMATION),
+ load_start_time_ms_(0),
serializer_enabled_(enable_serializer),
has_fatal_error_(false),
initialized_from_snapshot_(false),
@@ -3441,8 +3442,22 @@ void Isolate::CheckDetachedContextsAfterGC() {
}
}
+double Isolate::LoadStartTimeMs() {
+ base::LockGuard<base::Mutex> guard(&rail_mutex_);
+ return load_start_time_ms_;
+}
+
void Isolate::SetRAILMode(RAILMode rail_mode) {
+ RAILMode old_rail_mode = rail_mode_.Value();
+ if (old_rail_mode != PERFORMANCE_LOAD && rail_mode == PERFORMANCE_LOAD) {
+ base::LockGuard<base::Mutex> guard(&rail_mutex_);
+ load_start_time_ms_ = heap()->MonotonicallyIncreasingTimeInMs();
+ }
rail_mode_.SetValue(rail_mode);
+ if (old_rail_mode == PERFORMANCE_LOAD && rail_mode != PERFORMANCE_LOAD) {
+ heap()->incremental_marking()->incremental_marking_job()->ScheduleTask(
+ heap());
+ }
if (FLAG_trace_rail) {
PrintIsolate(this, "RAIL mode: %s\n", RAILModeName(rail_mode));
}
« no previous file with comments | « src/isolate.h ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698