Skip to content

Commit fd1ffe4

Browse files
bnoordhuisMylesBorins
authored andcommitted
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: #9293 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent bad0d93 commit fd1ffe4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

deps/v8/src/compiler.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,10 @@ void Compiler::PostInstantiation(Handle<JSFunction> function,
19261926
PretenureFlag pretenure) {
19271927
Handle<SharedFunctionInfo> shared(function->shared());
19281928

1929-
if (FLAG_always_opt && shared->allows_lazy_compilation()) {
1929+
if (FLAG_always_opt &&
1930+
shared->allows_lazy_compilation() &&
1931+
!shared->optimization_disabled() &&
1932+
!shared->dont_crankshaft()) {
19301933
function->MarkForOptimization();
19311934
}
19321935

0 commit comments

Comments
 (0)