[maglev] Use tagged_alternative for Float64 EnsureTagged

EnsureTagged for Int32 and Uint32 uses NodeInfo::tagged_alternative, but
Float64 was still using the old "check next node" approach. Update this
to be inline with the others.

Bug: v8:7700
Change-Id: I682c48828753d98b740df0f6ac21ae1c6bda722c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4022708
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84288}
This commit is contained in:
Leszek Swirski 2022-11-11 16:08:15 +01:00 committed by V8 LUCI CQ
parent 8ecc4ccc61
commit c7c8a5ce4e

View File

@ -812,19 +812,17 @@ class MergePointInterpreterFrameState {
DCHECK_EQ(value->properties().value_representation(),
ValueRepresentation::kFloat64);
DCHECK(!value->properties().is_conversion());
// Check if the next Node in the block after value is its Float64Box
// version and reuse it.
if (value->NextNode()) {
Float64Box* tagged = value->NextNode()->TryCast<Float64Box>();
if (tagged != nullptr && value == tagged->input().node()) {
return tagged;
}
NodeInfo* node_info = known_node_aspects.GetOrCreateInfoFor(value);
if (!node_info->tagged_alternative) {
// Create a tagged version.
ValueNode* tagged =
Node::New<Float64Box>(compilation_unit.zone(), {value});
Node::List::AddAfter(value, tagged);
compilation_unit.RegisterNodeInGraphLabeller(tagged);
node_info->tagged_alternative = tagged;
}
// Otherwise create a tagged version.
ValueNode* tagged = Node::New<Float64Box>(compilation_unit.zone(), {value});
Node::List::AddAfter(value, tagged);
compilation_unit.RegisterNodeInGraphLabeller(tagged);
return tagged;
return node_info->tagged_alternative;
}
// TODO(victorgomes): Consider refactor this function to share code with