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

Unified Diff: src/runtime-profiler.cc

Issue 2208603005: [interpreter] Fix profiler when hitting OSR frame. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/runtime-profiler.h ('k') | test/mjsunit/regress/regress-crbug-632800.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime-profiler.cc
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
index 89e0e2f1caa7c0463ed6d93630646c3e6da43453..246d1193f9e83aea59db3e347e9db68bad7b6ca2 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -264,7 +264,8 @@ void RuntimeProfiler::MaybeOptimizeFullCodegen(JSFunction* function,
}
}
-void RuntimeProfiler::MaybeBaselineIgnition(JSFunction* function) {
+void RuntimeProfiler::MaybeBaselineIgnition(JSFunction* function,
+ bool frame_optimized) {
if (function->IsInOptimizationQueue()) return;
SharedFunctionInfo* shared = function->shared();
@@ -276,10 +277,11 @@ void RuntimeProfiler::MaybeBaselineIgnition(JSFunction* function) {
if (FLAG_ignition_osr && FLAG_always_osr) {
AttemptOnStackReplacement(function, AbstractCode::kMaxLoopNestingMarker);
// Fall through and do a normal baseline compile as well.
- } else if (function->IsMarkedForBaseline() ||
- function->IsMarkedForOptimization() ||
- function->IsMarkedForConcurrentOptimization() ||
- function->IsOptimized()) {
+ } else if (!frame_optimized &&
+ (function->IsMarkedForBaseline() ||
+ function->IsMarkedForOptimization() ||
+ function->IsMarkedForConcurrentOptimization() ||
+ function->IsOptimized())) {
// Attempt OSR if we are still running interpreted code even though the
// the function has long been marked or even already been optimized.
int64_t allowance =
@@ -304,7 +306,8 @@ void RuntimeProfiler::MaybeBaselineIgnition(JSFunction* function) {
}
}
-void RuntimeProfiler::MaybeOptimizeIgnition(JSFunction* function) {
+void RuntimeProfiler::MaybeOptimizeIgnition(JSFunction* function,
+ bool frame_optimized) {
if (function->IsInOptimizationQueue()) return;
SharedFunctionInfo* shared = function->shared();
@@ -316,10 +319,11 @@ void RuntimeProfiler::MaybeOptimizeIgnition(JSFunction* function) {
if (FLAG_ignition_osr && FLAG_always_osr) {
AttemptOnStackReplacement(function, AbstractCode::kMaxLoopNestingMarker);
// Fall through and do a normal optimized compile as well.
- } else if (function->IsMarkedForBaseline() ||
- function->IsMarkedForOptimization() ||
- function->IsMarkedForConcurrentOptimization() ||
- function->IsOptimized()) {
+ } else if (!frame_optimized &&
+ (function->IsMarkedForBaseline() ||
+ function->IsMarkedForOptimization() ||
+ function->IsMarkedForConcurrentOptimization() ||
+ function->IsOptimized())) {
// Attempt OSR if we are still running interpreted code even though the
// the function has long been marked or even already been optimized.
int64_t allowance =
@@ -399,13 +403,12 @@ void RuntimeProfiler::MarkCandidatesForOptimization() {
Compiler::CompilationTier next_tier =
Compiler::NextCompilationTier(function);
- if (frame->is_interpreted()) {
+ if (function->shared()->HasBytecodeArray()) {
if (next_tier == Compiler::BASELINE) {
- DCHECK(!frame->is_optimized());
- MaybeBaselineIgnition(function);
+ MaybeBaselineIgnition(function, frame->is_optimized());
} else {
DCHECK_EQ(next_tier, Compiler::OPTIMIZED);
- MaybeOptimizeIgnition(function);
+ MaybeOptimizeIgnition(function, frame->is_optimized());
}
} else {
DCHECK_EQ(next_tier, Compiler::OPTIMIZED);
« no previous file with comments | « src/runtime-profiler.h ('k') | test/mjsunit/regress/regress-crbug-632800.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698