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 878e778da068c3563b1d06d7446c2411cf82fe28..31099d22aca27c9996806b2805f80858e26a1efc 100644 |
--- a/src/compiler/x64/instruction-selector-x64.cc |
+++ b/src/compiler/x64/instruction-selector-x64.cc |
@@ -171,8 +171,7 @@ class X64OperandGenerator final : public OperandGenerator { |
}; |
namespace { |
- |
-ArchOpcode GetLoadOpcode(LoadRepresentation load_rep) { |
+ArchOpcode GetLoadOpcode(LoadRepresentation load_rep, bool protect) { |
ArchOpcode opcode = kArchNop; |
switch (load_rep.representation()) { |
case MachineRepresentation::kFloat32: |
@@ -189,7 +188,7 @@ ArchOpcode GetLoadOpcode(LoadRepresentation load_rep) { |
opcode = load_rep.IsSigned() ? kX64Movsxwl : kX64Movzxwl; |
break; |
case MachineRepresentation::kWord32: |
- opcode = kX64Movl; |
+ opcode = protect ? kX64TrapMovl : kX64Movl; |
break; |
case MachineRepresentation::kTaggedSigned: // Fall through. |
case MachineRepresentation::kTaggedPointer: // Fall through. |
@@ -211,7 +210,8 @@ void InstructionSelector::VisitLoad(Node* node) { |
LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
X64OperandGenerator g(this); |
- ArchOpcode opcode = GetLoadOpcode(load_rep); |
+ const bool protect = false; |
+ ArchOpcode opcode = GetLoadOpcode(load_rep, protect); |
InstructionOperand outputs[1]; |
outputs[0] = g.DefineAsRegister(node); |
InstructionOperand inputs[3]; |
@@ -226,7 +226,8 @@ void InstructionSelector::VisitProtectedLoad(Node* node) { |
LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
X64OperandGenerator g(this); |
- ArchOpcode opcode = GetLoadOpcode(load_rep); |
+ const bool protect = true; |
+ ArchOpcode opcode = GetLoadOpcode(load_rep, protect); |
InstructionOperand outputs[1]; |
outputs[0] = g.DefineAsRegister(node); |
InstructionOperand inputs[4]; |