Index: src/runtime-profiler.cc |
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc |
index b76785deeb7c7b67a05b0fdae8e3228d77a47e8e..6c9de86ef309dfe96771e2d61fca33d74b7f82d3 100644 |
--- a/src/runtime-profiler.cc |
+++ b/src/runtime-profiler.cc |
@@ -106,7 +106,11 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) { |
PrintF("]\n"); |
} |
- function->AttemptConcurrentOptimization(); |
+ if (function->shared()->HasBytecodeArray()) { |
+ function->MarkForBaseline(); |
+ } else { |
+ function->AttemptConcurrentOptimization(); |
+ } |
} |
@@ -247,7 +251,8 @@ void RuntimeProfiler::MaybeOptimizeIgnition(JSFunction* function, |
// TODO(rmcilroy): Consider whether we should optimize small functions when |
// they are first seen on the stack (e.g., kMaxSizeEarlyOpt). |
- if (!frame_optimized && (function->IsMarkedForOptimization() || |
+ if (!frame_optimized && (function->IsMarkedForBaseline() || |
+ function->IsMarkedForOptimization() || |
function->IsMarkedForConcurrentOptimization() || |
function->IsOptimized())) { |
// TODO(rmcilroy): Support OSR in these cases. |
@@ -320,7 +325,7 @@ void RuntimeProfiler::MarkCandidatesForOptimization() { |
} |
} |
- if (FLAG_ignition) { |
+ if (frame->is_interpreted()) { |
MaybeOptimizeIgnition(function, frame->is_optimized()); |
} else { |
MaybeOptimizeFullCodegen(function, frame_count, frame->is_optimized()); |