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 8229ebc712ed6ffaeb987453c5bca08574d4d2a0..d48007b858e4fe13d326272be3c75a03be54b8e9 100644 |
--- a/src/compiler/mips64/instruction-selector-mips64.cc |
+++ b/src/compiler/mips64/instruction-selector-mips64.cc |
@@ -1854,6 +1854,15 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { |
: g.UseRegister(length) |
: g.UseRegister(length); |
+ if (length->opcode() == IrOpcode::kInt32Constant) { |
+ Int32Matcher m(length); |
+ if (m.IsPowerOf2()) { |
+ Emit(opcode, g.DefineAsRegister(node), offset_operand, |
+ g.UseImmediate(length), g.UseRegister(buffer)); |
+ return; |
+ } |
+ } |
+ |
Emit(opcode | AddressingModeField::encode(kMode_MRI), |
g.DefineAsRegister(node), offset_operand, length_operand, |
g.UseRegister(buffer)); |
@@ -1906,6 +1915,15 @@ void InstructionSelector::VisitCheckedStore(Node* node) { |
: g.UseRegister(length) |
: g.UseRegister(length); |
+ if (length->opcode() == IrOpcode::kInt32Constant) { |
+ Int32Matcher m(length); |
+ if (m.IsPowerOf2()) { |
+ Emit(opcode, g.NoOutput(), offset_operand, g.UseImmediate(length), |
+ g.UseRegisterOrImmediateZero(value), g.UseRegister(buffer)); |
+ return; |
+ } |
+ } |
+ |
Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
offset_operand, length_operand, g.UseRegisterOrImmediateZero(value), |
g.UseRegister(buffer)); |