Browse Source

v8: fix --always-opt bug

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: https://github.com/nodejs/node/pull/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>
v6.x
Ben Noordhuis 8 years ago
committed by Myles Borins
parent
commit
fd1ffe4f5a
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 5
      deps/v8/src/compiler.cc

5
deps/v8/src/compiler.cc

@ -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();
}

Loading…
Cancel
Save