Commit 84e0835c authored by Hong Zheng's avatar Hong Zheng Committed by Commit Bot

Update load start time

Add a V8 API to update load start time for RAIL PERFORMANCE_LOAD mode

Bug: v8:10947

Change-Id: If86a815f8974b47a6f4ba82c3661c21b73f39553
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2423403
Auto-Submit: Hong Zheng <hong.zheng@intel.com>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73393}
parent a7c8a3ea
...@@ -9323,6 +9323,11 @@ class V8_EXPORT Isolate { ...@@ -9323,6 +9323,11 @@ class V8_EXPORT Isolate {
*/ */
void SetRAILMode(RAILMode rail_mode); void SetRAILMode(RAILMode rail_mode);
/**
* Update load start time of the RAIL mode
*/
void UpdateLoadStartTime();
/** /**
* Optional notification to tell V8 the current isolate is used for debugging * Optional notification to tell V8 the current isolate is used for debugging
* and requires higher heap limit. * and requires higher heap limit.
......
...@@ -8761,6 +8761,11 @@ void Isolate::SetRAILMode(RAILMode rail_mode) { ...@@ -8761,6 +8761,11 @@ void Isolate::SetRAILMode(RAILMode rail_mode) {
return isolate->SetRAILMode(rail_mode); return isolate->SetRAILMode(rail_mode);
} }
void Isolate::UpdateLoadStartTime() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
isolate->UpdateLoadStartTime();
}
void Isolate::IncreaseHeapLimitForDebugging() { void Isolate::IncreaseHeapLimitForDebugging() {
// No-op. // No-op.
} }
......
...@@ -4575,6 +4575,11 @@ double Isolate::LoadStartTimeMs() { ...@@ -4575,6 +4575,11 @@ double Isolate::LoadStartTimeMs() {
return load_start_time_ms_; return load_start_time_ms_;
} }
void Isolate::UpdateLoadStartTime() {
base::MutexGuard guard(&rail_mutex_);
load_start_time_ms_ = heap()->MonotonicallyIncreasingTimeInMs();
}
void Isolate::SetRAILMode(RAILMode rail_mode) { void Isolate::SetRAILMode(RAILMode rail_mode) {
RAILMode old_rail_mode = rail_mode_.load(); RAILMode old_rail_mode = rail_mode_.load();
if (old_rail_mode != PERFORMANCE_LOAD && rail_mode == PERFORMANCE_LOAD) { if (old_rail_mode != PERFORMANCE_LOAD && rail_mode == PERFORMANCE_LOAD) {
......
...@@ -1601,6 +1601,8 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { ...@@ -1601,6 +1601,8 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
double LoadStartTimeMs(); double LoadStartTimeMs();
void UpdateLoadStartTime();
void IsolateInForegroundNotification(); void IsolateInForegroundNotification();
void IsolateInBackgroundNotification(); void IsolateInBackgroundNotification();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment