[vm] Canonicalize unboxed int constants

Constants should be canonicalized.

Split off https://dart-review.googlesource.com/c/sdk/+/284300.

TEST=Apparently not triggered by any current tests.
TEST=Triggered by CL mentioned above.

Change-Id: Icfa0728303d53dd61607addeab2d09552f30a296
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332686
Reviewed-by: Tess Strickland <sstrickl@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
Daco Harkes 2023-10-30 16:42:37 +00:00 committed by Commit Queue
parent 991f1aa248
commit 3cab7a2ce5

View file

@ -261,7 +261,7 @@ Fragment BaseFlowGraphBuilder::IntConstant(int64_t value) {
Fragment BaseFlowGraphBuilder::UnboxedIntConstant(
int64_t value,
Representation representation) {
const auto& obj = Integer::ZoneHandle(Z, Integer::New(value, Heap::kOld));
const auto& obj = Integer::ZoneHandle(Z, Integer::NewCanonical(value));
auto const constant = new (Z) UnboxedConstantInstr(obj, representation);
Push(constant);
return Fragment(constant);