Commit 09410621 authored by Benedikt Meurer's avatar Benedikt Meurer

[turbofan] Don't introduce PlainPrimitiveToNumber for String inputs.

During JSTypedLowering we can decide to insert PlainPrimitiveToNumber
operators on the inputs to still utilize pure Number operators, when
the type feedback on the numeric binary operation is NumberOrOddball.
However that is not beneficial if the inputs can be Strings, that is
we cannot statically rule out String based on input type, as that
inserts a ToNumber stub call into the hot code path.

This repairs the NavierStokes regression with Ignition on Octane.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/2432143003 .

Cr-Commit-Position: refs/heads/master@{#40427}
parent acf99a89
......@@ -525,7 +525,7 @@ Reduction JSTypedLowering::ReduceNumberBinop(Node* node) {
NumberOperationHint hint;
if (r.GetBinaryNumberOperationHint(&hint)) {
if (hint == NumberOperationHint::kNumberOrOddball &&
r.BothInputsAre(Type::PlainPrimitive())) {
r.BothInputsAre(Type::NumberOrOddball())) {
r.ConvertInputsToNumber();
return r.ChangeToPureOperator(r.NumberOp(), Type::Number());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment