Index: src/compiler/machine-operator.cc |
diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc |
index 81805d7b36296ec517e2ef1ec8bff73d764dba4c..e632e0ef85061914bf8856bd17e989ae359c2874 100644 |
--- a/src/compiler/machine-operator.cc |
+++ b/src/compiler/machine-operator.cc |
@@ -36,6 +36,7 @@ std::ostream& operator<<(std::ostream& os, StoreRepresentation rep) { |
LoadRepresentation LoadRepresentationOf(Operator const* op) { |
DCHECK(IrOpcode::kLoad == op->opcode() || |
+ IrOpcode::kTrapableLoad == op->opcode() || |
IrOpcode::kAtomicLoad == op->opcode()); |
return OpParameter<LoadRepresentation>(op); |
} |
@@ -500,9 +501,18 @@ struct MachineOperatorGlobalCache { |
Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ |
"CheckedLoad", 3, 1, 1, 1, 1, 0, MachineType::Type()) {} \ |
}; \ |
+ struct TrapableLoad##Type##Operator final \ |
+ : public Operator1<TrapableLoadRepresentation> { \ |
+ TrapableLoad##Type##Operator() \ |
+ : Operator1<TrapableLoadRepresentation>( \ |
+ IrOpcode::kTrapableLoad, \ |
+ Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ |
+ "TrapableLoad", 4, 1, 1, 1, 1, 0, MachineType::Type()) {} \ |
+ }; \ |
Load##Type##Operator kLoad##Type; \ |
UnalignedLoad##Type##Operator kUnalignedLoad##Type; \ |
- CheckedLoad##Type##Operator kCheckedLoad##Type; |
+ CheckedLoad##Type##Operator kCheckedLoad##Type; \ |
+ TrapableLoad##Type##Operator kTrapableLoad##Type; |
MACHINE_TYPE_LIST(LOAD) |
#undef LOAD |
@@ -697,6 +707,17 @@ const Operator* MachineOperatorBuilder::Load(LoadRepresentation rep) { |
return nullptr; |
} |
+const Operator* MachineOperatorBuilder::TrapableLoad(LoadRepresentation rep) { |
+#define LOAD(Type) \ |
+ if (rep == MachineType::Type()) { \ |
+ return &cache_.kTrapableLoad##Type; \ |
+ } |
+ MACHINE_TYPE_LIST(LOAD) |
+#undef LOAD |
+ UNREACHABLE(); |
+ return nullptr; |
+} |
+ |
const Operator* MachineOperatorBuilder::StackSlot(MachineRepresentation rep) { |
#define STACKSLOT(Type) \ |
if (rep == MachineType::Type().representation()) { \ |