[vm/compiler] Fix BinaryIntegerOpInstr::InferRange.

Fixes the change in d7feab5a, which created a base definition for
BinaryIntegerOpInstr::InferRange from BinaryInt32OpInstr (which used
GetSmiRange to get the operand ranges) instead of BinaryInt64OpInstr
(which used the operand ranges directly).

Instead, just use GetInputRange to get an appropriate range based on
the representation of each input.

Change-Id: Ib62199ecc3ea3246fcf5deffc69285a15124f462
Bug: https://github.com/dart-lang/sdk/issues/42948
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156906
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This commit is contained in:
Tess Strickland 2020-08-05 11:48:18 +00:00 committed by commit-bot@chromium.org
parent fd5140d491
commit 9c774d796b

View file

@ -2859,8 +2859,12 @@ static void CacheRange(Range** slot,
}
void BinaryIntegerOpInstr::InferRange(RangeAnalysis* analysis, Range* range) {
InferRangeHelper(analysis->GetSmiRange(left()),
analysis->GetSmiRange(right()), range);
auto const left_size =
RepresentationToRangeSize(RequiredInputRepresentation(0));
auto const right_size =
RepresentationToRangeSize(RequiredInputRepresentation(1));
InferRangeHelper(GetInputRange(analysis, left_size, left()),
GetInputRange(analysis, right_size, right()), range);
}
void BinarySmiOpInstr::InferRange(RangeAnalysis* analysis, Range* range) {