Index: src/compiler/x64/instruction-selector-x64.cc |
diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc |
index 04c4df307fba45730a88ced167b1af0f122494a8..792ef7df4cf85e1877f46ae1785c767e54ec8782 100644 |
--- a/src/compiler/x64/instruction-selector-x64.cc |
+++ b/src/compiler/x64/instruction-selector-x64.cc |
@@ -200,6 +200,53 @@ void InstructionSelector::VisitLoad(Node* node) { |
Emit(code, 1, outputs, input_count, inputs); |
} |
+void InstructionSelector::VisitTrapableLoad(Node* node) { |
+ LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
+ X64OperandGenerator g(this); |
+ |
+ ArchOpcode opcode = kArchNop; |
+ switch (load_rep.representation()) { |
+ case MachineRepresentation::kFloat32: |
+ opcode = kX64Movss; |
+ break; |
+ case MachineRepresentation::kFloat64: |
+ opcode = kX64Movsd; |
+ break; |
+ case MachineRepresentation::kBit: // Fall through. |
+ case MachineRepresentation::kWord8: |
+ opcode = load_rep.IsSigned() ? kX64Movsxbl : kX64Movzxbl; |
+ break; |
+ case MachineRepresentation::kWord16: |
+ opcode = load_rep.IsSigned() ? kX64Movsxwl : kX64Movzxwl; |
+ break; |
+ case MachineRepresentation::kWord32: |
+ opcode = kX64TrapMovl; |
+ break; |
+ case MachineRepresentation::kTaggedSigned: // Fall through. |
+ case MachineRepresentation::kTaggedPointer: // Fall through. |
+ case MachineRepresentation::kTagged: // Fall through. |
+ case MachineRepresentation::kWord64: |
+ opcode = kX64Movq; |
+ break; |
+ case MachineRepresentation::kSimd128: // Fall through. |
+ case MachineRepresentation::kNone: |
+ UNREACHABLE(); |
+ return; |
+ } |
+ |
+ InstructionOperand outputs[1]; |
+ outputs[0] = g.DefineAsRegister(node); |
+ InstructionOperand inputs[4]; |
+ size_t input_count = 0; |
+ AddressingMode mode = |
+ g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count); |
+ // Add the context parameter as an input. |
+ inputs[input_count++] = g.UseUniqueRegister(node->InputAt(2)); |
+ // Add the source position as an input |
+ inputs[input_count++] = g.UseImmediate(node->InputAt(3)); |
+ InstructionCode code = opcode | AddressingModeField::encode(mode); |
+ Emit(code, 1, outputs, input_count, inputs); |
+} |
void InstructionSelector::VisitStore(Node* node) { |
X64OperandGenerator g(this); |