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 ed857c57b0af8d5b1c282bc9a4ed3d514b1f5f8a..ab0abf5a558aad9a51a518455cb20dfb557e4e94 100644 |
--- a/src/compiler/x64/instruction-selector-x64.cc |
+++ b/src/compiler/x64/instruction-selector-x64.cc |
@@ -179,8 +179,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: |
@@ -197,7 +196,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. |
@@ -219,7 +218,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]; |
@@ -234,7 +234,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]; |