Index: src/compiler/arm/instruction-selector-arm.cc |
diff --git a/src/compiler/arm/instruction-selector-arm.cc b/src/compiler/arm/instruction-selector-arm.cc |
index 7d3243e614bcc4665d9354ac8c38353630477e7e..52acdc85f81d7ddf1a9921d0087ce27e1f2e652e 100644 |
--- a/src/compiler/arm/instruction-selector-arm.cc |
+++ b/src/compiler/arm/instruction-selector-arm.cc |
@@ -350,6 +350,82 @@ void InstructionSelector::VisitStore(Node* node) { |
} |
+void InstructionSelector::VisitCheckedLoad(Node* node) { |
+ MachineType rep = RepresentationOf(OpParameter<MachineType>(node)); |
+ MachineType typ = TypeOf(OpParameter<MachineType>(node)); |
+ ArmOperandGenerator g(this); |
+ Node* const buffer = node->InputAt(0); |
+ Node* const offset = node->InputAt(1); |
+ Node* const length = node->InputAt(2); |
+ ArchOpcode opcode; |
+ switch (rep) { |
+ case kRepWord8: |
+ opcode = typ == kTypeInt32 ? kCheckedLoadInt8 : kCheckedLoadUint8; |
+ break; |
+ case kRepWord16: |
+ opcode = typ == kTypeInt32 ? kCheckedLoadInt16 : kCheckedLoadUint16; |
+ break; |
+ case kRepWord32: |
+ opcode = kCheckedLoadWord32; |
+ break; |
+ case kRepFloat32: |
+ opcode = kCheckedLoadFloat32; |
+ break; |
+ case kRepFloat64: |
+ opcode = kCheckedLoadFloat64; |
+ break; |
+ default: |
+ UNREACHABLE(); |
+ return; |
+ } |
+ InstructionOperand* offset_operand = g.UseRegister(offset); |
+ InstructionOperand* length_operand = g.CanBeImmediate(length, kArmCmp) |
+ ? g.UseImmediate(length) |
+ : g.UseRegister(length); |
+ Emit(opcode | AddressingModeField::encode(kMode_Offset_RR), |
+ g.DefineAsRegister(node), offset_operand, length_operand, |
+ g.UseRegister(buffer), offset_operand); |
+} |
+ |
+ |
+void InstructionSelector::VisitCheckedStore(Node* node) { |
+ MachineType rep = RepresentationOf(OpParameter<MachineType>(node)); |
+ ArmOperandGenerator g(this); |
+ Node* const buffer = node->InputAt(0); |
+ Node* const offset = node->InputAt(1); |
+ Node* const length = node->InputAt(2); |
+ Node* const value = node->InputAt(3); |
+ ArchOpcode opcode; |
+ switch (rep) { |
+ case kRepWord8: |
+ opcode = kCheckedStoreWord8; |
+ break; |
+ case kRepWord16: |
+ opcode = kCheckedStoreWord16; |
+ break; |
+ case kRepWord32: |
+ opcode = kCheckedStoreWord32; |
+ break; |
+ case kRepFloat32: |
+ opcode = kCheckedStoreFloat32; |
+ break; |
+ case kRepFloat64: |
+ opcode = kCheckedStoreFloat64; |
+ break; |
+ default: |
+ UNREACHABLE(); |
+ return; |
+ } |
+ InstructionOperand* offset_operand = g.UseRegister(offset); |
+ InstructionOperand* length_operand = g.CanBeImmediate(length, kArmCmp) |
+ ? g.UseImmediate(length) |
+ : g.UseRegister(length); |
+ Emit(opcode | AddressingModeField::encode(kMode_Offset_RR), nullptr, |
+ offset_operand, length_operand, g.UseRegister(value), |
+ g.UseRegister(buffer), offset_operand); |
+} |
+ |
+ |
namespace { |
void EmitBic(InstructionSelector* selector, Node* node, Node* left, |