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

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

Issue 2594543003: [Interpreter] Ensure that a function is compiled before tiering up to baseline. (Closed)
Patch Set: Fixed an error in DCHECK. Created 3 years, 12 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/compiler.cc ('k') | test/mjsunit/ignition/regress-5768.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-test.cc
diff --git a/src/runtime/runtime-test.cc b/src/runtime/runtime-test.cc
index 2d331c9e83ee094cdaa91d9cd9c3225c5eba0906..df3d343c3d24b34da100a2aec88562d96db57ed1 100644
--- a/src/runtime/runtime-test.cc
+++ b/src/runtime/runtime-test.cc
@@ -177,6 +177,12 @@ RUNTIME_FUNCTION(Runtime_BaselineFunctionOnNextCall) {
}
Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
+ // If function isn't compiled, compile it now.
+ if (!function->shared()->is_compiled() &&
+ !Compiler::Compile(function, Compiler::CLEAR_EXCEPTION)) {
+ return isolate->heap()->undefined_value();
+ }
+
// Do not tier down if we are already on optimized code. Replacing optimized
// code without actual deoptimization can lead to funny bugs.
if (function->code()->kind() != Code::OPTIMIZED_FUNCTION &&
« no previous file with comments | « src/compiler.cc ('k') | test/mjsunit/ignition/regress-5768.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698