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

Unified Diff: src/runtime-profiler.cc

Issue 16381006: Change PC for OSR entries to point to something more sensible (i.e. the first UnknownOsrValue), rem… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add --always-osr flag. Created 7 years, 6 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/objects.cc ('k') | src/x64/lithium-codegen-x64.cc » ('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 9b7dd34ccd1d61c6fdd6075cdd4de61c24c4ffd1..00f7de476061db3529e256a168df618ec528a484 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -153,9 +153,6 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function) {
// See AlwaysFullCompiler (in compiler.cc) comment on why we need
// Debug::has_break_points().
- ASSERT(function->IsMarkedForLazyRecompilation() ||
- function->IsMarkedForParallelRecompilation() ||
- function->IsOptimized());
if (!FLAG_use_osr ||
isolate_->DebuggerHasBreakPoints() ||
function->IsBuiltin()) {
@@ -273,12 +270,21 @@ void RuntimeProfiler::OptimizeNow() {
if (shared_code->kind() != Code::FUNCTION) continue;
if (function->IsInRecompileQueue()) continue;
- // Attempt OSR if we are still running unoptimized code even though the
- // the function has long been marked or even already been optimized.
- if (!frame->is_optimized() &&
+ if (FLAG_always_osr &&
+ shared_code->allow_osr_at_loop_nesting_level() == 0) {
+ // Testing mode: always try an OSR compile for every function.
+ for (int i = 0; i < Code::kMaxLoopNestingMarker; i++) {
+ // TODO(titzer): fix AttemptOnStackReplacement to avoid this dumb loop.
+ shared_code->set_allow_osr_at_loop_nesting_level(i);
+ AttemptOnStackReplacement(function);
+ }
+ // Fall through and do a normal optimized compile as well.
+ } else if (!frame->is_optimized() &&
(function->IsMarkedForLazyRecompilation() ||
function->IsMarkedForParallelRecompilation() ||
function->IsOptimized())) {
+ // Attempt OSR if we are still running unoptimized code even though the
+ // the function has long been marked or even already been optimized.
int ticks = shared_code->profiler_ticks();
int allowance = kOSRCodeSizeAllowanceBase +
ticks * kOSRCodeSizeAllowancePerTick;
« no previous file with comments | « src/objects.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698