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

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

Issue 760063002: Abort optimization in corner case. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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/regress/regress-436893.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 bd6182a93d54035feb54bd35f4636203abd0e692..7aa280917c3192ec2261596ac8c7bcde034a79a8 100644
--- a/src/runtime/runtime-test.cc
+++ b/src/runtime/runtime-test.cc
@@ -62,9 +62,14 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) {
if (!isolate->use_crankshaft()) return isolate->heap()->undefined_value();
- // If the function is optimized, just return.
+ // If the function is already optimized, just return.
if (function->IsOptimized()) return isolate->heap()->undefined_value();
+ // If the function cannot optimized, just return.
+ if (function->shared()->optimization_disabled()) {
+ return isolate->heap()->undefined_value();
+ }
+
function->MarkForOptimization();
Code* unoptimized = function->shared()->code();
« no previous file with comments | « src/compiler.cc ('k') | test/mjsunit/regress/regress-436893.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698