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..368f4b492121092e3138587d4a57fddd5be6280d 100644 |
--- a/src/compiler/x64/instruction-selector-x64.cc |
+++ b/src/compiler/x64/instruction-selector-x64.cc |
@@ -155,11 +155,8 @@ class X64OperandGenerator final : public OperandGenerator { |
} |
}; |
- |
-void InstructionSelector::VisitLoad(Node* node) { |
- LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
- X64OperandGenerator g(this); |
- |
+namespace { |
+ArchOpcode GetLoadOpcode(LoadRepresentation load_rep) { |
ArchOpcode opcode = kArchNop; |
switch (load_rep.representation()) { |
case MachineRepresentation::kFloat32: |
@@ -187,9 +184,17 @@ void InstructionSelector::VisitLoad(Node* node) { |
case MachineRepresentation::kSimd128: // Fall through. |
case MachineRepresentation::kNone: |
UNREACHABLE(); |
- return; |
+ break; |
} |
+ return opcode; |
+} |
+} // namespace |
+void InstructionSelector::VisitLoad(Node* node) { |
+ LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
+ X64OperandGenerator g(this); |
+ |
+ ArchOpcode opcode = GetLoadOpcode(load_rep); |
InstructionOperand outputs[1]; |
outputs[0] = g.DefineAsRegister(node); |
InstructionOperand inputs[3]; |
@@ -200,6 +205,24 @@ void InstructionSelector::VisitLoad(Node* node) { |
Emit(code, 1, outputs, input_count, inputs); |
} |
+void InstructionSelector::VisitProtectedLoad(Node* node) { |
+ LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
+ X64OperandGenerator g(this); |
+ |
+ ArchOpcode opcode = GetLoadOpcode(load_rep); |
+ 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); |