diff --git a/deps/v8/src/compiler.cc b/deps/v8/src/compiler.cc index 8bb53323ab..4276d23e73 100644 --- a/deps/v8/src/compiler.cc +++ b/deps/v8/src/compiler.cc @@ -1926,7 +1926,10 @@ void Compiler::PostInstantiation(Handle function, PretenureFlag pretenure) { Handle shared(function->shared()); - if (FLAG_always_opt && shared->allows_lazy_compilation()) { + if (FLAG_always_opt && + shared->allows_lazy_compilation() && + !shared->optimization_disabled() && + !shared->dont_crankshaft()) { function->MarkForOptimization(); }