Commit d109cdb1 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[ptr-compr][turbofan] Mark as (Compressed|Tagged)(Pointer|Signed) when possible

In instruction selector we were tagging as Compressed or Tagged Any when
we could have been more specific. Also, we were marking as Word32 or Word64
when we should have been using CompressedSigned or TaggedSigned, respectively.

Drive-by cleanup: Rename MarkAsReference to MarkAsTagged.

Bug: v8:7703
Change-Id: I4df7a17e25cfa51a1e11eac0af40be21efb50990
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1739367Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63119}
parent 66741e4e
...@@ -1276,9 +1276,9 @@ void InstructionSelector::VisitNode(Node* node) { ...@@ -1276,9 +1276,9 @@ void InstructionSelector::VisitNode(Node* node) {
// No code needed for these graph artifacts. // No code needed for these graph artifacts.
return; return;
case IrOpcode::kIfException: case IrOpcode::kIfException:
return MarkAsReference(node), VisitIfException(node); return MarkAsTagged(node), VisitIfException(node);
case IrOpcode::kFinishRegion: case IrOpcode::kFinishRegion:
return MarkAsReference(node), VisitFinishRegion(node); return MarkAsTagged(node), VisitFinishRegion(node);
case IrOpcode::kParameter: { case IrOpcode::kParameter: {
MachineType type = MachineType type =
linkage()->GetParameterType(ParameterIndexOf(node->op())); linkage()->GetParameterType(ParameterIndexOf(node->op()));
...@@ -1286,7 +1286,7 @@ void InstructionSelector::VisitNode(Node* node) { ...@@ -1286,7 +1286,7 @@ void InstructionSelector::VisitNode(Node* node) {
return VisitParameter(node); return VisitParameter(node);
} }
case IrOpcode::kOsrValue: case IrOpcode::kOsrValue:
return MarkAsReference(node), VisitOsrValue(node); return MarkAsTagged(node), VisitOsrValue(node);
case IrOpcode::kPhi: { case IrOpcode::kPhi: {
MachineRepresentation rep = PhiRepresentationOf(node->op()); MachineRepresentation rep = PhiRepresentationOf(node->op());
if (rep == MachineRepresentation::kNone) return; if (rep == MachineRepresentation::kNone) return;
...@@ -1306,16 +1306,16 @@ void InstructionSelector::VisitNode(Node* node) { ...@@ -1306,16 +1306,16 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kFloat64Constant: case IrOpcode::kFloat64Constant:
return MarkAsFloat64(node), VisitConstant(node); return MarkAsFloat64(node), VisitConstant(node);
case IrOpcode::kHeapConstant: case IrOpcode::kHeapConstant:
return MarkAsReference(node), VisitConstant(node); return MarkAsTagged(node), VisitConstant(node);
case IrOpcode::kCompressedHeapConstant: case IrOpcode::kCompressedHeapConstant:
return MarkAsCompressed(node), VisitConstant(node); return MarkAsCompressed(node), VisitConstant(node);
case IrOpcode::kNumberConstant: { case IrOpcode::kNumberConstant: {
double value = OpParameter<double>(node->op()); double value = OpParameter<double>(node->op());
if (!IsSmiDouble(value)) MarkAsReference(node); if (!IsSmiDouble(value)) MarkAsTagged(node);
return VisitConstant(node); return VisitConstant(node);
} }
case IrOpcode::kDelayedStringConstant: case IrOpcode::kDelayedStringConstant:
return MarkAsReference(node), VisitConstant(node); return MarkAsTagged(node), VisitConstant(node);
case IrOpcode::kCall: case IrOpcode::kCall:
return VisitCall(node); return VisitCall(node);
case IrOpcode::kDeoptimizeIf: case IrOpcode::kDeoptimizeIf:
...@@ -1484,7 +1484,7 @@ void InstructionSelector::VisitNode(Node* node) { ...@@ -1484,7 +1484,7 @@ void InstructionSelector::VisitNode(Node* node) {
return MarkAsRepresentation(MachineType::PointerRepresentation(), node), return MarkAsRepresentation(MachineType::PointerRepresentation(), node),
VisitBitcastTaggedToWord(node); VisitBitcastTaggedToWord(node);
case IrOpcode::kBitcastWordToTagged: case IrOpcode::kBitcastWordToTagged:
return MarkAsReference(node), VisitBitcastWordToTagged(node); return MarkAsTagged(node), VisitBitcastWordToTagged(node);
case IrOpcode::kBitcastWordToTaggedSigned: case IrOpcode::kBitcastWordToTaggedSigned:
return MarkAsRepresentation(MachineRepresentation::kTaggedSigned, node), return MarkAsRepresentation(MachineRepresentation::kTaggedSigned, node),
EmitIdentity(node); EmitIdentity(node);
...@@ -1536,18 +1536,20 @@ void InstructionSelector::VisitNode(Node* node) { ...@@ -1536,18 +1536,20 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kChangeTaggedToCompressed: case IrOpcode::kChangeTaggedToCompressed:
return MarkAsCompressed(node), VisitChangeTaggedToCompressed(node); return MarkAsCompressed(node), VisitChangeTaggedToCompressed(node);
case IrOpcode::kChangeTaggedPointerToCompressedPointer: case IrOpcode::kChangeTaggedPointerToCompressedPointer:
return MarkAsCompressed(node), return MarkAsRepresentation(MachineRepresentation::kCompressedPointer,
node),
VisitChangeTaggedPointerToCompressedPointer(node); VisitChangeTaggedPointerToCompressedPointer(node);
case IrOpcode::kChangeTaggedSignedToCompressedSigned: case IrOpcode::kChangeTaggedSignedToCompressedSigned:
return MarkAsWord32(node), return MarkAsRepresentation(MachineRepresentation::kCompressedSigned,
node),
VisitChangeTaggedSignedToCompressedSigned(node); VisitChangeTaggedSignedToCompressedSigned(node);
case IrOpcode::kChangeCompressedToTagged: case IrOpcode::kChangeCompressedToTagged:
return MarkAsReference(node), VisitChangeCompressedToTagged(node); return MarkAsTagged(node), VisitChangeCompressedToTagged(node);
case IrOpcode::kChangeCompressedPointerToTaggedPointer: case IrOpcode::kChangeCompressedPointerToTaggedPointer:
return MarkAsReference(node), return MarkAsRepresentation(MachineRepresentation::kTaggedPointer, node),
VisitChangeCompressedPointerToTaggedPointer(node); VisitChangeCompressedPointerToTaggedPointer(node);
case IrOpcode::kChangeCompressedSignedToTaggedSigned: case IrOpcode::kChangeCompressedSignedToTaggedSigned:
return MarkAsWord64(node), return MarkAsRepresentation(MachineRepresentation::kTaggedSigned, node),
VisitChangeCompressedSignedToTaggedSigned(node); VisitChangeCompressedSignedToTaggedSigned(node);
#endif #endif
case IrOpcode::kTruncateFloat64ToFloat32: case IrOpcode::kTruncateFloat64ToFloat32:
...@@ -1697,7 +1699,7 @@ void InstructionSelector::VisitNode(Node* node) { ...@@ -1697,7 +1699,7 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kFloat64InsertHighWord32: case IrOpcode::kFloat64InsertHighWord32:
return MarkAsFloat64(node), VisitFloat64InsertHighWord32(node); return MarkAsFloat64(node), VisitFloat64InsertHighWord32(node);
case IrOpcode::kTaggedPoisonOnSpeculation: case IrOpcode::kTaggedPoisonOnSpeculation:
return MarkAsReference(node), VisitTaggedPoisonOnSpeculation(node); return MarkAsTagged(node), VisitTaggedPoisonOnSpeculation(node);
case IrOpcode::kWord32PoisonOnSpeculation: case IrOpcode::kWord32PoisonOnSpeculation:
return MarkAsWord32(node), VisitWord32PoisonOnSpeculation(node); return MarkAsWord32(node), VisitWord32PoisonOnSpeculation(node);
case IrOpcode::kWord64PoisonOnSpeculation: case IrOpcode::kWord64PoisonOnSpeculation:
......
...@@ -543,7 +543,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final { ...@@ -543,7 +543,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
void MarkAsSimd128(Node* node) { void MarkAsSimd128(Node* node) {
MarkAsRepresentation(MachineRepresentation::kSimd128, node); MarkAsRepresentation(MachineRepresentation::kSimd128, node);
} }
void MarkAsReference(Node* node) { void MarkAsTagged(Node* node) {
MarkAsRepresentation(MachineRepresentation::kTagged, node); MarkAsRepresentation(MachineRepresentation::kTagged, node);
} }
void MarkAsCompressed(Node* node) { void MarkAsCompressed(Node* node) {
......
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