Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: src/compiler/instruction-selector.cc

Issue 2277283002: Reland of [turbofan] Insert dummy values when changing from None type. (Closed)
Patch Set: Workaround for uninhabited representations. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/instruction-scheduler.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index d59d5f0c2fb5cff49bf4a19e3c180df3c1f8a489..2143ec9c16ccdfd2a39a2f784ebbdd9a78e30581 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -348,6 +348,10 @@ enum class FrameStateInputKind { kAny, kStackSlot };
InstructionOperand OperandForDeopt(OperandGenerator* g, Node* input,
FrameStateInputKind kind,
MachineRepresentation rep) {
+ if (rep == MachineRepresentation::kNone) {
+ return g->TempImmediate(FrameStateDescriptor::kImpossibleValue);
+ }
+
switch (input->opcode()) {
case IrOpcode::kInt32Constant:
case IrOpcode::kInt64Constant:
@@ -360,17 +364,13 @@ InstructionOperand OperandForDeopt(OperandGenerator* g, Node* input,
UNREACHABLE();
break;
default:
- if (rep == MachineRepresentation::kNone) {
- return g->TempImmediate(FrameStateDescriptor::kImpossibleValue);
- } else {
- switch (kind) {
- case FrameStateInputKind::kStackSlot:
- return g->UseUniqueSlot(input);
- case FrameStateInputKind::kAny:
- // Currently deopts "wrap" other operations, so the deopt's inputs
- // are potentially needed untill the end of the deoptimising code.
- return g->UseAnyAtEnd(input);
- }
+ switch (kind) {
+ case FrameStateInputKind::kStackSlot:
+ return g->UseUniqueSlot(input);
+ case FrameStateInputKind::kAny:
+ // Currently deopts "wrap" other operations, so the deopt's inputs
+ // are potentially needed untill the end of the deoptimising code.
+ return g->UseAnyAtEnd(input);
}
}
UNREACHABLE();
@@ -1065,19 +1065,6 @@ void InstructionSelector::VisitNode(Node* node) {
return MarkAsWord32(node), VisitChangeFloat64ToInt32(node);
case IrOpcode::kChangeFloat64ToUint32:
return MarkAsWord32(node), VisitChangeFloat64ToUint32(node);
- case IrOpcode::kImpossibleToWord32:
- return MarkAsWord32(node), VisitImpossibleToWord32(node);
- case IrOpcode::kImpossibleToWord64:
- return MarkAsWord64(node), VisitImpossibleToWord64(node);
- case IrOpcode::kImpossibleToFloat32:
- return MarkAsFloat32(node), VisitImpossibleToFloat32(node);
- case IrOpcode::kImpossibleToFloat64:
- return MarkAsFloat64(node), VisitImpossibleToFloat64(node);
- case IrOpcode::kImpossibleToTagged:
- MarkAsRepresentation(MachineType::PointerRepresentation(), node);
- return VisitImpossibleToTagged(node);
- case IrOpcode::kImpossibleToBit:
- return MarkAsWord32(node), VisitImpossibleToBit(node);
case IrOpcode::kFloat64SilenceNaN:
MarkAsFloat64(node);
if (CanProduceSignalingNaN(node->InputAt(0))) {
@@ -1318,42 +1305,6 @@ void InstructionSelector::VisitNode(Node* node) {
}
}
-void InstructionSelector::VisitImpossibleToWord32(Node* node) {
- OperandGenerator g(this);
- Emit(kArchImpossible, g.DefineAsConstant(node, Constant(0)));
-}
-
-void InstructionSelector::VisitImpossibleToWord64(Node* node) {
- OperandGenerator g(this);
- Emit(kArchImpossible,
- g.DefineAsConstant(node, Constant(static_cast<int64_t>(0))));
-}
-
-void InstructionSelector::VisitImpossibleToFloat32(Node* node) {
- OperandGenerator g(this);
- Emit(kArchImpossible, g.DefineAsConstant(node, Constant(0.0f)));
-}
-
-void InstructionSelector::VisitImpossibleToFloat64(Node* node) {
- OperandGenerator g(this);
- Emit(kArchImpossible, g.DefineAsConstant(node, Constant(0.0)));
-}
-
-void InstructionSelector::VisitImpossibleToBit(Node* node) {
- OperandGenerator g(this);
- Emit(kArchImpossible, g.DefineAsConstant(node, Constant(0)));
-}
-
-void InstructionSelector::VisitImpossibleToTagged(Node* node) {
- OperandGenerator g(this);
-#if V8_TARGET_ARCH_64_BIT
- Emit(kArchImpossible,
- g.DefineAsConstant(node, Constant(static_cast<int64_t>(0))));
-#else // V8_TARGET_ARCH_64_BIT
- Emit(kArchImpossible, g.DefineAsConstant(node, Constant(0)));
-#endif // V8_TARGET_ARCH_64_BIT
-}
-
void InstructionSelector::VisitLoadStackPointer(Node* node) {
OperandGenerator g(this);
Emit(kArchStackPointer, g.DefineAsRegister(node));
« no previous file with comments | « src/compiler/instruction-scheduler.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698