Commit 53574525 authored by Ross McIlroy's avatar Ross McIlroy Committed by V8 LUCI CQ

[TurboProp] Don't scale OSR ticks.

Now that TurboProp doesn't have an earlier interupt budget, we
should no longer be scaling the number of ticks required to
OSR to TurboProp.

BUG=v8:9684

Change-Id: Ie4d41e75df697e36e7fbc3f7bc8a8d0f24f6743a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3014462
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75647}
parent 2c7876a2
...@@ -173,21 +173,11 @@ void RuntimeProfiler::MaybeOptimizeFrame(JSFunction function, ...@@ -173,21 +173,11 @@ void RuntimeProfiler::MaybeOptimizeFrame(JSFunction function,
bool RuntimeProfiler::MaybeOSR(JSFunction function, UnoptimizedFrame* frame) { bool RuntimeProfiler::MaybeOSR(JSFunction function, UnoptimizedFrame* frame) {
int ticks = function.feedback_vector().profiler_ticks(); int ticks = function.feedback_vector().profiler_ticks();
// TODO(rmcilroy): Also ensure we only OSR top-level code if it is smaller
// than kMaxToplevelSourceSize.
if (function.IsMarkedForOptimization() || if (function.IsMarkedForOptimization() ||
function.IsMarkedForConcurrentOptimization() || function.IsMarkedForConcurrentOptimization() ||
function.HasAvailableOptimizedCode()) { function.HasAvailableOptimizedCode()) {
// Attempt OSR if we are still running interpreted code even though the
// the function has long been marked or even already been optimized.
// OSR should happen roughly at the same with or without FLAG_turboprop.
// Turboprop has much lower interrupt budget so scale the ticks accordingly.
int scale_factor =
FLAG_turboprop ? FLAG_interrupt_budget_scale_factor_for_top_tier : 1;
int64_t scaled_ticks = static_cast<int64_t>(ticks) / scale_factor;
int64_t allowance = kOSRBytecodeSizeAllowanceBase + int64_t allowance = kOSRBytecodeSizeAllowanceBase +
scaled_ticks * kOSRBytecodeSizeAllowancePerTick; ticks * kOSRBytecodeSizeAllowancePerTick;
if (function.shared().GetBytecodeArray(isolate_).length() <= allowance) { if (function.shared().GetBytecodeArray(isolate_).length() <= allowance) {
AttemptOnStackReplacement(frame); AttemptOnStackReplacement(frame);
} }
......
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