Index: src/compiler/mips64/instruction-selector-mips64.cc |
diff --git a/src/compiler/mips64/instruction-selector-mips64.cc b/src/compiler/mips64/instruction-selector-mips64.cc |
index 24383f30de6481daaf8d37f572214553452f258b..7cf12b67b0b5c5f1debf0ae0a70fb506604a1da7 100644 |
--- a/src/compiler/mips64/instruction-selector-mips64.cc |
+++ b/src/compiler/mips64/instruction-selector-mips64.cc |
@@ -680,6 +680,75 @@ void InstructionSelector::VisitCall(Node* node) { |
} |
+void InstructionSelector::VisitCheckedLoad(Node* node) { |
+ MachineType rep = RepresentationOf(OpParameter<MachineType>(node)); |
+ MachineType typ = TypeOf(OpParameter<MachineType>(node)); |
+ Mips64OperandGenerator 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); |
+ Emit(opcode | AddressingModeField::encode(kMode_MRI), |
+ g.DefineAsRegister(node), offset_operand, g.UseRegister(length), |
+ g.UseRegister(buffer)); |
+} |
+ |
+ |
+void InstructionSelector::VisitCheckedStore(Node* node) { |
+ MachineType rep = RepresentationOf(OpParameter<MachineType>(node)); |
+ Mips64OperandGenerator 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); |
+ Emit(opcode | AddressingModeField::encode(kMode_MRI), nullptr, offset_operand, |
+ g.UseRegister(length), g.UseRegister(value), g.UseRegister(buffer)); |
+} |
+ |
+ |
namespace { |
// Shared routine for multiple compare operations. |