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

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

Issue 2280613002: Revert of [turbofan] Insert dummy values when changing from None type. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 c3eaddfe054cfd1300ea32c74dd68d1b1fad9652..6f1e3306c1c68715af002b32de0eb866fbb9d05a 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -350,10 +350,6 @@
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:
@@ -366,13 +362,17 @@
UNREACHABLE();
break;
default:
- 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);
+ 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);
+ }
}
}
UNREACHABLE();
@@ -1067,6 +1067,19 @@
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))) {
@@ -1307,6 +1320,42 @@
}
}
+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