Commit 739c0187 authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Exhaustive switches for MachineRepresentation.

Review URL: https://codereview.chromium.org/1542093002

Cr-Commit-Position: refs/heads/master@{#33011}
parent b7ff2bd5
...@@ -308,7 +308,7 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -308,7 +308,7 @@ void InstructionSelector::VisitLoad(Node* node) {
Node* base = node->InputAt(0); Node* base = node->InputAt(0);
Node* index = node->InputAt(1); Node* index = node->InputAt(1);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kArmVldrF32; opcode = kArmVldrF32;
...@@ -327,7 +327,8 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -327,7 +327,8 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
opcode = kArmLdr; opcode = kArmLdr;
break; break;
default: case MachineRepresentation::kNone: // Fall through.
case MachineRepresentation::kWord64:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -382,7 +383,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -382,7 +383,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode)); code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps); Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else { } else {
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kArmVstrF32; opcode = kArmVstrF32;
...@@ -401,7 +402,8 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -401,7 +402,8 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
opcode = kArmStr; opcode = kArmStr;
break; break;
default: case MachineRepresentation::kNone: // Fall through.
case MachineRepresentation::kWord64:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -423,7 +425,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -423,7 +425,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
Node* const buffer = node->InputAt(0); Node* const buffer = node->InputAt(0);
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8; opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8;
...@@ -440,7 +442,10 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -440,7 +442,10 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedLoadFloat64; opcode = kCheckedLoadFloat64;
break; break;
default: case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -461,7 +466,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -461,7 +466,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
Node* const value = node->InputAt(3); Node* const value = node->InputAt(3);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = kCheckedStoreWord8; opcode = kCheckedStoreWord8;
...@@ -478,7 +483,10 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -478,7 +483,10 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedStoreFloat64; opcode = kCheckedStoreFloat64;
break; break;
default: case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
......
...@@ -342,7 +342,7 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -342,7 +342,7 @@ void InstructionSelector::VisitLoad(Node* node) {
Arm64OperandGenerator g(this); Arm64OperandGenerator g(this);
Node* base = node->InputAt(0); Node* base = node->InputAt(0);
Node* index = node->InputAt(1); Node* index = node->InputAt(1);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
ImmediateMode immediate_mode = kNoImmediate; ImmediateMode immediate_mode = kNoImmediate;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
...@@ -371,7 +371,7 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -371,7 +371,7 @@ void InstructionSelector::VisitLoad(Node* node) {
opcode = kArm64Ldr; opcode = kArm64Ldr;
immediate_mode = kLoadStoreImm64; immediate_mode = kLoadStoreImm64;
break; break;
default: case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -426,7 +426,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -426,7 +426,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode)); code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps); Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else { } else {
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
ImmediateMode immediate_mode = kNoImmediate; ImmediateMode immediate_mode = kNoImmediate;
switch (rep) { switch (rep) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
...@@ -455,7 +455,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -455,7 +455,7 @@ void InstructionSelector::VisitStore(Node* node) {
opcode = kArm64Str; opcode = kArm64Str;
immediate_mode = kLoadStoreImm64; immediate_mode = kLoadStoreImm64;
break; break;
default: case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -476,7 +476,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -476,7 +476,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
Node* const buffer = node->InputAt(0); Node* const buffer = node->InputAt(0);
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8; opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8;
...@@ -496,7 +496,9 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -496,7 +496,9 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedLoadFloat64; opcode = kCheckedLoadFloat64;
break; break;
default: case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -512,7 +514,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -512,7 +514,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
Node* const value = node->InputAt(3); Node* const value = node->InputAt(3);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = kCheckedStoreWord8; opcode = kCheckedStoreWord8;
...@@ -532,7 +534,9 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -532,7 +534,9 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedStoreFloat64; opcode = kCheckedStoreFloat64;
break; break;
default: case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
......
...@@ -171,7 +171,7 @@ void VisitFloatUnop(InstructionSelector* selector, Node* node, Node* input, ...@@ -171,7 +171,7 @@ void VisitFloatUnop(InstructionSelector* selector, Node* node, Node* input,
void InstructionSelector::VisitLoad(Node* node) { void InstructionSelector::VisitLoad(Node* node) {
LoadRepresentation load_rep = LoadRepresentationOf(node->op()); LoadRepresentation load_rep = LoadRepresentationOf(node->op());
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kIA32Movss; opcode = kIA32Movss;
...@@ -190,7 +190,8 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -190,7 +190,8 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
opcode = kIA32Movl; opcode = kIA32Movl;
break; break;
default: case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -255,7 +256,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -255,7 +256,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode)); code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps); Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else { } else {
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kIA32Movss; opcode = kIA32Movss;
...@@ -274,7 +275,8 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -274,7 +275,8 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
opcode = kIA32Movl; opcode = kIA32Movl;
break; break;
default: case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -307,7 +309,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -307,7 +309,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
Node* const buffer = node->InputAt(0); Node* const buffer = node->InputAt(0);
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8; opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8;
...@@ -324,7 +326,10 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -324,7 +326,10 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedLoadFloat64; opcode = kCheckedLoadFloat64;
break; break;
default: case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -350,7 +355,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -350,7 +355,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
Node* const value = node->InputAt(3); Node* const value = node->InputAt(3);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = kCheckedStoreWord8; opcode = kCheckedStoreWord8;
...@@ -367,7 +372,10 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -367,7 +372,10 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedStoreFloat64; opcode = kCheckedStoreFloat64;
break; break;
default: case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
......
...@@ -139,6 +139,18 @@ std::ostream& operator<<(std::ostream& os, ...@@ -139,6 +139,18 @@ std::ostream& operator<<(std::ostream& os,
os << "|E"; os << "|E";
} }
switch (allocated.representation()) { switch (allocated.representation()) {
case MachineRepresentation::kNone:
os << "|-";
break;
case MachineRepresentation::kBit:
os << "|b";
break;
case MachineRepresentation::kWord8:
os << "|w8";
break;
case MachineRepresentation::kWord16:
os << "|w16";
break;
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
os << "|w32"; os << "|w32";
break; break;
...@@ -154,9 +166,6 @@ std::ostream& operator<<(std::ostream& os, ...@@ -154,9 +166,6 @@ std::ostream& operator<<(std::ostream& os,
case MachineRepresentation::kTagged: case MachineRepresentation::kTagged:
os << "|t"; os << "|t";
break; break;
default:
os << "|?";
break;
} }
return os << "]"; return os << "]";
} }
...@@ -718,7 +727,7 @@ static MachineRepresentation FilterRepresentation(MachineRepresentation rep) { ...@@ -718,7 +727,7 @@ static MachineRepresentation FilterRepresentation(MachineRepresentation rep) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
case MachineRepresentation::kTagged: case MachineRepresentation::kTagged:
return rep; return rep;
default: case MachineRepresentation::kNone:
break; break;
} }
UNREACHABLE(); UNREACHABLE();
......
...@@ -437,9 +437,14 @@ class LocationOperand : public InstructionOperand { ...@@ -437,9 +437,14 @@ class LocationOperand : public InstructionOperand {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
case MachineRepresentation::kTagged: case MachineRepresentation::kTagged:
return true; return true;
default: case MachineRepresentation::kBit:
case MachineRepresentation::kWord8:
case MachineRepresentation::kWord16:
case MachineRepresentation::kNone:
return false; return false;
} }
UNREACHABLE();
return false;
} }
static LocationOperand* cast(InstructionOperand* op) { static LocationOperand* cast(InstructionOperand* op) {
...@@ -1150,13 +1155,7 @@ class InstructionSequence final : public ZoneObject { ...@@ -1150,13 +1155,7 @@ class InstructionSequence final : public ZoneObject {
MachineRepresentation::kTagged; MachineRepresentation::kTagged;
} }
bool IsFloat(int virtual_register) const { bool IsFloat(int virtual_register) const {
switch (GetRepresentation(virtual_register)) { return IsFloatingPoint(GetRepresentation(virtual_register));
case MachineRepresentation::kFloat32:
case MachineRepresentation::kFloat64:
return true;
default:
return false;
}
} }
Instruction* GetBlockStart(RpoNumber rpo) const; Instruction* GetBlockStart(RpoNumber rpo) const;
......
...@@ -394,7 +394,8 @@ const Operator* MachineOperatorBuilder::Store(StoreRepresentation store_rep) { ...@@ -394,7 +394,8 @@ const Operator* MachineOperatorBuilder::Store(StoreRepresentation store_rep) {
break; break;
MACHINE_REPRESENTATION_LIST(STORE) MACHINE_REPRESENTATION_LIST(STORE)
#undef STORE #undef STORE
default: case MachineRepresentation::kBit:
case MachineRepresentation::kNone:
break; break;
} }
UNREACHABLE(); UNREACHABLE();
...@@ -423,7 +424,8 @@ const Operator* MachineOperatorBuilder::CheckedStore( ...@@ -423,7 +424,8 @@ const Operator* MachineOperatorBuilder::CheckedStore(
return &cache_.kCheckedStore##kRep; return &cache_.kCheckedStore##kRep;
MACHINE_REPRESENTATION_LIST(STORE) MACHINE_REPRESENTATION_LIST(STORE)
#undef STORE #undef STORE
default: case MachineRepresentation::kBit:
case MachineRepresentation::kNone:
break; break;
} }
UNREACHABLE(); UNREACHABLE();
......
...@@ -132,7 +132,7 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -132,7 +132,7 @@ void InstructionSelector::VisitLoad(Node* node) {
Node* base = node->InputAt(0); Node* base = node->InputAt(0);
Node* index = node->InputAt(1); Node* index = node->InputAt(1);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kMipsLwc1; opcode = kMipsLwc1;
...@@ -151,7 +151,8 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -151,7 +151,8 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
opcode = kMipsLw; opcode = kMipsLw;
break; break;
default: case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -211,7 +212,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -211,7 +212,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode)); code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps); Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else { } else {
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kMipsSwc1; opcode = kMipsSwc1;
...@@ -230,7 +231,8 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -230,7 +231,8 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
opcode = kMipsSw; opcode = kMipsSw;
break; break;
default: case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -850,7 +852,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -850,7 +852,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
Node* const buffer = node->InputAt(0); Node* const buffer = node->InputAt(0);
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8; opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8;
...@@ -867,7 +869,10 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -867,7 +869,10 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedLoadFloat64; opcode = kCheckedLoadFloat64;
break; break;
default: case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -894,7 +899,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -894,7 +899,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
Node* const value = node->InputAt(3); Node* const value = node->InputAt(3);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = kCheckedStoreWord8; opcode = kCheckedStoreWord8;
......
...@@ -137,7 +137,7 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -137,7 +137,7 @@ void InstructionSelector::VisitLoad(Node* node) {
Node* base = node->InputAt(0); Node* base = node->InputAt(0);
Node* index = node->InputAt(1); Node* index = node->InputAt(1);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kMips64Lwc1; opcode = kMips64Lwc1;
...@@ -159,7 +159,7 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -159,7 +159,7 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kWord64: case MachineRepresentation::kWord64:
opcode = kMips64Ld; opcode = kMips64Ld;
break; break;
default: case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -219,7 +219,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -219,7 +219,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode)); code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps); Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else { } else {
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kMips64Swc1; opcode = kMips64Swc1;
...@@ -241,7 +241,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -241,7 +241,7 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kWord64: case MachineRepresentation::kWord64:
opcode = kMips64Sd; opcode = kMips64Sd;
break; break;
default: case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -1285,7 +1285,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -1285,7 +1285,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
Node* const buffer = node->InputAt(0); Node* const buffer = node->InputAt(0);
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8; opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8;
...@@ -1305,7 +1305,9 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -1305,7 +1305,9 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedLoadFloat64; opcode = kCheckedLoadFloat64;
break; break;
default: case MachineRepresentation::kBit:
case MachineRepresentation::kTagged:
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -1332,7 +1334,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -1332,7 +1334,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
Node* const value = node->InputAt(3); Node* const value = node->InputAt(3);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = kCheckedStoreWord8; opcode = kCheckedStoreWord8;
...@@ -1352,7 +1354,9 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -1352,7 +1354,9 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedStoreFloat64; opcode = kCheckedStoreFloat64;
break; break;
default: case MachineRepresentation::kBit:
case MachineRepresentation::kTagged:
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
......
...@@ -198,7 +198,10 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -198,7 +198,10 @@ void InstructionSelector::VisitLoad(Node* node) {
mode = kInt16Imm_4ByteAligned; mode = kInt16Imm_4ByteAligned;
break; break;
#endif #endif
default: #if !V8_TARGET_ARCH_PPC64
case MachineRepresentation::kWord64:
#endif
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
......
...@@ -104,10 +104,11 @@ int GetByteWidth(MachineRepresentation rep) { ...@@ -104,10 +104,11 @@ int GetByteWidth(MachineRepresentation rep) {
case MachineRepresentation::kWord64: case MachineRepresentation::kWord64:
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
return 8; return 8;
default: case MachineRepresentation::kNone:
UNREACHABLE(); break;
return 0;
} }
UNREACHABLE();
return 0;
} }
} // namespace } // namespace
......
...@@ -145,7 +145,7 @@ Node* RepresentationChanger::GetRepresentationFor(Node* node, ...@@ -145,7 +145,7 @@ Node* RepresentationChanger::GetRepresentationFor(Node* node,
return GetWord32RepresentationFor(node, output_type); return GetWord32RepresentationFor(node, output_type);
case MachineRepresentation::kWord64: case MachineRepresentation::kWord64:
return GetWord64RepresentationFor(node, output_type); return GetWord64RepresentationFor(node, output_type);
default: case MachineRepresentation::kNone:
return node; return node;
} }
UNREACHABLE(); UNREACHABLE();
......
...@@ -184,8 +184,6 @@ bool MachineTypeIsSubtype(MachineSemantic t1, MachineSemantic t2) { ...@@ -184,8 +184,6 @@ bool MachineTypeIsSubtype(MachineSemantic t1, MachineSemantic t2) {
return t2 == MachineSemantic::kNumber || t2 == MachineSemantic::kAny; return t2 == MachineSemantic::kNumber || t2 == MachineSemantic::kAny;
case MachineSemantic::kAny: case MachineSemantic::kAny:
return t2 == MachineSemantic::kAny; return t2 == MachineSemantic::kAny;
default:
break;
} }
UNREACHABLE(); UNREACHABLE();
return false; return false;
...@@ -231,8 +229,6 @@ bool MachineRepresentationIsSubtype(MachineRepresentation r1, ...@@ -231,8 +229,6 @@ bool MachineRepresentationIsSubtype(MachineRepresentation r1,
r2 == MachineRepresentation::kTagged; r2 == MachineRepresentation::kTagged;
case MachineRepresentation::kTagged: case MachineRepresentation::kTagged:
return r2 == MachineRepresentation::kTagged; return r2 == MachineRepresentation::kTagged;
default:
break;
} }
UNREACHABLE(); UNREACHABLE();
return false; return false;
......
...@@ -111,7 +111,7 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -111,7 +111,7 @@ void InstructionSelector::VisitLoad(Node* node) {
LoadRepresentation load_rep = LoadRepresentationOf(node->op()); LoadRepresentation load_rep = LoadRepresentationOf(node->op());
X64OperandGenerator g(this); X64OperandGenerator g(this);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kX64Movss; opcode = kX64Movss;
...@@ -133,7 +133,7 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -133,7 +133,7 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kWord64: case MachineRepresentation::kWord64:
opcode = kX64Movq; opcode = kX64Movq;
break; break;
default: case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -197,7 +197,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -197,7 +197,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode)); code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps); Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else { } else {
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kX64Movss; opcode = kX64Movss;
...@@ -219,7 +219,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -219,7 +219,7 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kWord64: case MachineRepresentation::kWord64:
opcode = kX64Movq; opcode = kX64Movq;
break; break;
default: case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -243,7 +243,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -243,7 +243,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
Node* const buffer = node->InputAt(0); Node* const buffer = node->InputAt(0);
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8; opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8;
...@@ -263,7 +263,9 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -263,7 +263,9 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedLoadFloat64; opcode = kCheckedLoadFloat64;
break; break;
default: case MachineRepresentation::kBit:
case MachineRepresentation::kTagged:
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -293,7 +295,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -293,7 +295,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
Node* const value = node->InputAt(3); Node* const value = node->InputAt(3);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = kCheckedStoreWord8; opcode = kCheckedStoreWord8;
...@@ -313,7 +315,9 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -313,7 +315,9 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedStoreFloat64; opcode = kCheckedStoreFloat64;
break; break;
default: case MachineRepresentation::kBit:
case MachineRepresentation::kTagged:
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
......
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