Skip to content

Commit

Permalink
v8: fix --always-opt bug
Browse files Browse the repository at this point in the history
Don't try to optimize known-unoptimizable functions when --always-opt
is specified on the command line, it makes Crankshaft emit wrong code.

This was fixed upstream when improved WASM support was introduced but
that specific change can't be back-ported because it depends on prior
work that doesn't exist in V8 5.1.  Ergo, I decided to redo the fix
from scratch.

PR-URL: #9293
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
bnoordhuis authored and MylesBorins committed Mar 9, 2017
1 parent bad0d93 commit fd1ffe4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deps/v8/src/compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,10 @@ void Compiler::PostInstantiation(Handle<JSFunction> function,
PretenureFlag pretenure) {
Handle<SharedFunctionInfo> 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();
}

Expand Down

0 comments on commit fd1ffe4

Please sign in to comment.