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

Unified Diff: src/runtime/runtime-compiler.cc

Issue 809333002: [turbofan] Implement OSR for outer loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
Index: src/runtime/runtime-compiler.cc
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc
index ebd0c13f0f9b1ef2e2bb44d5bfcb4d017d5e041c..37e17862fa60fa6c62a4d0825be8607ddb2cbf71 100644
--- a/src/runtime/runtime-compiler.cc
+++ b/src/runtime/runtime-compiler.cc
@@ -290,8 +290,15 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
// match. Fix heuristics for reenabling optimizations!
function->shared()->increment_deopt_count();
- // TODO(titzer): Do not install code into the function.
- function->ReplaceCode(*result);
+ if (result->is_turbofanned()) {
+ // TurboFanned OSR code cannot be installed into the function.
+ // But the function is obviously hot, so optimize it next time.
+ function->ReplaceCode(
+ isolate->builtins()->builtin(Builtins::kCompileOptimized));
+ } else {
+ // Crankshafted OSR code can be installed into the function.
+ function->ReplaceCode(*result);
+ }
return *result;
}
}
« src/compiler/code-generator.cc ('K') | « src/objects.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698