Commit d9af984e authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS: Use the Lsa() macro/r6 instruction in existing code.

BUG=

Review URL: https://codereview.chromium.org/1608933003

Cr-Commit-Position: refs/heads/master@{#33390}
parent 68654b64
...@@ -1411,8 +1411,7 @@ void LCodeGen::DoMulI(LMulI* instr) { ...@@ -1411,8 +1411,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
if (constant < 0) __ Subu(result, zero_reg, result); if (constant < 0) __ Subu(result, zero_reg, result);
} else if (base::bits::IsPowerOfTwo32(constant_abs - 1)) { } else if (base::bits::IsPowerOfTwo32(constant_abs - 1)) {
int32_t shift = WhichPowerOf2(constant_abs - 1); int32_t shift = WhichPowerOf2(constant_abs - 1);
__ sll(scratch, left, shift); __ Lsa(result, left, left, shift);
__ Addu(result, scratch, left);
// Correct the sign of the result if the constant is negative. // Correct the sign of the result if the constant is negative.
if (constant < 0) __ Subu(result, zero_reg, result); if (constant < 0) __ Subu(result, zero_reg, result);
} else if (base::bits::IsPowerOfTwo32(constant_abs + 1)) { } else if (base::bits::IsPowerOfTwo32(constant_abs + 1)) {
...@@ -2578,8 +2577,7 @@ void LCodeGen::DoReturn(LReturn* instr) { ...@@ -2578,8 +2577,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
Register reg = ToRegister(instr->parameter_count()); Register reg = ToRegister(instr->parameter_count());
// The argument count parameter is a smi // The argument count parameter is a smi
__ SmiUntag(reg); __ SmiUntag(reg);
__ sll(at, reg, kPointerSizeLog2); __ Lsa(sp, sp, reg, kPointerSizeLog2);
__ Addu(sp, sp, at);
} }
__ Jump(ra); __ Jump(ra);
...@@ -2781,8 +2779,7 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { ...@@ -2781,8 +2779,7 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
Register index = ToRegister(instr->index()); Register index = ToRegister(instr->index());
__ li(at, Operand(const_length + 1)); __ li(at, Operand(const_length + 1));
__ Subu(result, at, index); __ Subu(result, at, index);
__ sll(at, result, kPointerSizeLog2); __ Lsa(at, arguments, result, kPointerSizeLog2);
__ Addu(at, arguments, at);
__ lw(result, MemOperand(at)); __ lw(result, MemOperand(at));
} }
} else if (instr->index()->IsConstantOperand()) { } else if (instr->index()->IsConstantOperand()) {
...@@ -2791,12 +2788,10 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { ...@@ -2791,12 +2788,10 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
int loc = const_index - 1; int loc = const_index - 1;
if (loc != 0) { if (loc != 0) {
__ Subu(result, length, Operand(loc)); __ Subu(result, length, Operand(loc));
__ sll(at, result, kPointerSizeLog2); __ Lsa(at, arguments, result, kPointerSizeLog2);
__ Addu(at, arguments, at);
__ lw(result, MemOperand(at)); __ lw(result, MemOperand(at));
} else { } else {
__ sll(at, length, kPointerSizeLog2); __ Lsa(at, arguments, length, kPointerSizeLog2);
__ Addu(at, arguments, at);
__ lw(result, MemOperand(at)); __ lw(result, MemOperand(at));
} }
} else { } else {
...@@ -2804,8 +2799,7 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { ...@@ -2804,8 +2799,7 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
Register index = ToRegister(instr->index()); Register index = ToRegister(instr->index());
__ Subu(result, length, index); __ Subu(result, length, index);
__ Addu(result, result, 1); __ Addu(result, result, 1);
__ sll(at, result, kPointerSizeLog2); __ Lsa(at, arguments, result, kPointerSizeLog2);
__ Addu(at, arguments, at);
__ lw(result, MemOperand(at)); __ lw(result, MemOperand(at));
} }
} }
...@@ -2914,8 +2908,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { ...@@ -2914,8 +2908,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
key = ToRegister(instr->key()); key = ToRegister(instr->key());
int shift_size = (instr->hydrogen()->key()->representation().IsSmi()) int shift_size = (instr->hydrogen()->key()->representation().IsSmi())
? (element_size_shift - kSmiTagSize) : element_size_shift; ? (element_size_shift - kSmiTagSize) : element_size_shift;
__ sll(at, key, shift_size); __ Lsa(scratch, scratch, key, shift_size);
__ Addu(scratch, scratch, at);
} }
__ ldc1(result, MemOperand(scratch)); __ ldc1(result, MemOperand(scratch));
...@@ -2946,11 +2939,9 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { ...@@ -2946,11 +2939,9 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
// during bound check elimination with the index argument to the bounds // during bound check elimination with the index argument to the bounds
// check, which can be tagged, so that case must be handled here, too. // check, which can be tagged, so that case must be handled here, too.
if (instr->hydrogen()->key()->representation().IsSmi()) { if (instr->hydrogen()->key()->representation().IsSmi()) {
__ sll(scratch, key, kPointerSizeLog2 - kSmiTagSize); __ Lsa(scratch, elements, key, kPointerSizeLog2 - kSmiTagSize);
__ addu(scratch, elements, scratch);
} else { } else {
__ sll(scratch, key, kPointerSizeLog2); __ Lsa(scratch, elements, key, kPointerSizeLog2);
__ addu(scratch, elements, scratch);
} }
} }
__ lw(result, MemOperand(store_base, offset)); __ lw(result, MemOperand(store_base, offset));
...@@ -3945,8 +3936,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { ...@@ -3945,8 +3936,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
address = external_pointer; address = external_pointer;
} }
} else { } else {
__ sll(address, key, shift_size); __ Lsa(address, external_pointer, key, shift_size);
__ Addu(address, external_pointer, address);
} }
if (elements_kind == FLOAT32_ELEMENTS) { if (elements_kind == FLOAT32_ELEMENTS) {
...@@ -4063,11 +4053,9 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { ...@@ -4063,11 +4053,9 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
// during bound check elimination with the index argument to the bounds // during bound check elimination with the index argument to the bounds
// check, which can be tagged, so that case must be handled here, too. // check, which can be tagged, so that case must be handled here, too.
if (instr->hydrogen()->key()->representation().IsSmi()) { if (instr->hydrogen()->key()->representation().IsSmi()) {
__ sll(scratch, key, kPointerSizeLog2 - kSmiTagSize); __ Lsa(scratch, elements, key, kPointerSizeLog2 - kSmiTagSize);
__ addu(scratch, elements, scratch);
} else { } else {
__ sll(scratch, key, kPointerSizeLog2); __ Lsa(scratch, elements, key, kPointerSizeLog2);
__ addu(scratch, elements, scratch);
} }
} }
__ sw(value, MemOperand(store_base, offset)); __ sw(value, MemOperand(store_base, offset));
...@@ -4354,8 +4342,7 @@ void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { ...@@ -4354,8 +4342,7 @@ void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) {
__ Branch(deferred->entry(), hi, __ Branch(deferred->entry(), hi,
char_code, Operand(String::kMaxOneByteCharCode)); char_code, Operand(String::kMaxOneByteCharCode));
__ LoadRoot(result, Heap::kSingleCharacterStringCacheRootIndex); __ LoadRoot(result, Heap::kSingleCharacterStringCacheRootIndex);
__ sll(scratch, char_code, kPointerSizeLog2); __ Lsa(result, result, char_code, kPointerSizeLog2);
__ Addu(result, result, scratch);
__ lw(result, FieldMemOperand(result, FixedArray::kHeaderSize)); __ lw(result, FieldMemOperand(result, FixedArray::kHeaderSize));
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
__ Branch(deferred->entry(), eq, result, Operand(scratch)); __ Branch(deferred->entry(), eq, result, Operand(scratch));
......
...@@ -1140,8 +1140,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { ...@@ -1140,8 +1140,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// Get the current entry of the array into register a3. // Get the current entry of the array into register a3.
__ lw(a2, MemOperand(sp, 2 * kPointerSize)); __ lw(a2, MemOperand(sp, 2 * kPointerSize));
__ Addu(a2, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); __ Addu(a2, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ sll(t0, a0, kPointerSizeLog2 - kSmiTagSize); __ Lsa(t0, a2, a0, kPointerSizeLog2 - kSmiTagSize);
__ addu(t0, a2, t0); // Array base + scaled (smi) index.
__ lw(a3, MemOperand(t0)); // Current entry. __ lw(a3, MemOperand(t0)); // Current entry.
// Get the expected map from the stack or a smi in the // Get the expected map from the stack or a smi in the
...@@ -3798,8 +3797,7 @@ void FullCodeGenerator::EmitFastOneByteArrayJoin(CallRuntime* expr) { ...@@ -3798,8 +3797,7 @@ void FullCodeGenerator::EmitFastOneByteArrayJoin(CallRuntime* expr) {
__ mov(string_length, zero_reg); __ mov(string_length, zero_reg);
__ Addu(element, __ Addu(element,
elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ sll(elements_end, array_length, kPointerSizeLog2); __ Lsa(elements_end, element, array_length, kPointerSizeLog2);
__ Addu(elements_end, element, elements_end);
// Loop condition: while (element < elements_end). // Loop condition: while (element < elements_end).
// Live values in registers: // Live values in registers:
// elements: Fixed array of strings. // elements: Fixed array of strings.
...@@ -3876,8 +3874,7 @@ void FullCodeGenerator::EmitFastOneByteArrayJoin(CallRuntime* expr) { ...@@ -3876,8 +3874,7 @@ void FullCodeGenerator::EmitFastOneByteArrayJoin(CallRuntime* expr) {
// Prepare for looping. Set up elements_end to end of the array. Set // Prepare for looping. Set up elements_end to end of the array. Set
// result_pos to the position of the result where to write the first // result_pos to the position of the result where to write the first
// character. // character.
__ sll(elements_end, array_length, kPointerSizeLog2); __ Lsa(elements_end, element, array_length, kPointerSizeLog2);
__ Addu(elements_end, element, elements_end);
result_pos = array_length; // End of live range for array_length. result_pos = array_length; // End of live range for array_length.
array_length = no_reg; array_length = no_reg;
__ Addu(result_pos, __ Addu(result_pos,
......
...@@ -230,8 +230,7 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, ...@@ -230,8 +230,7 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver,
Operand(FixedArray::kHeaderSize - kHeapObjectTag)); Operand(FixedArray::kHeaderSize - kHeapObjectTag));
// The key is a smi. // The key is a smi.
STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
__ sll(at, key, kPointerSizeLog2 - kSmiTagSize); __ Lsa(at, scratch1, key, kPointerSizeLog2 - kSmiTagSize);
__ addu(at, at, scratch1);
__ lw(scratch2, MemOperand(at)); __ lw(scratch2, MemOperand(at));
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
...@@ -491,8 +490,7 @@ static void KeyedStoreGenerateMegamorphicHelper( ...@@ -491,8 +490,7 @@ static void KeyedStoreGenerateMegamorphicHelper(
// there may be a callback on the element. // there may be a callback on the element.
Label holecheck_passed1; Label holecheck_passed1;
__ Addu(address, elements, FixedArray::kHeaderSize - kHeapObjectTag); __ Addu(address, elements, FixedArray::kHeaderSize - kHeapObjectTag);
__ sll(at, key, kPointerSizeLog2 - kSmiTagSize); __ Lsa(address, address, key, kPointerSizeLog2 - kSmiTagSize);
__ addu(address, address, at);
__ lw(scratch, MemOperand(address)); __ lw(scratch, MemOperand(address));
__ Branch(&holecheck_passed1, ne, scratch, __ Branch(&holecheck_passed1, ne, scratch,
Operand(masm->isolate()->factory()->the_hole_value())); Operand(masm->isolate()->factory()->the_hole_value()));
...@@ -511,8 +509,7 @@ static void KeyedStoreGenerateMegamorphicHelper( ...@@ -511,8 +509,7 @@ static void KeyedStoreGenerateMegamorphicHelper(
} }
// It's irrelevant whether array is smi-only or not when writing a smi. // It's irrelevant whether array is smi-only or not when writing a smi.
__ Addu(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); __ Addu(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ sll(scratch, key, kPointerSizeLog2 - kSmiTagSize); __ Lsa(address, address, key, kPointerSizeLog2 - kSmiTagSize);
__ Addu(address, address, scratch);
__ sw(value, MemOperand(address)); __ sw(value, MemOperand(address));
__ Ret(); __ Ret();
...@@ -528,8 +525,7 @@ static void KeyedStoreGenerateMegamorphicHelper( ...@@ -528,8 +525,7 @@ static void KeyedStoreGenerateMegamorphicHelper(
__ sw(scratch, FieldMemOperand(receiver, JSArray::kLengthOffset)); __ sw(scratch, FieldMemOperand(receiver, JSArray::kLengthOffset));
} }
__ Addu(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); __ Addu(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ sll(scratch, key, kPointerSizeLog2 - kSmiTagSize); __ Lsa(address, address, key, kPointerSizeLog2 - kSmiTagSize);
__ Addu(address, address, scratch);
__ sw(value, MemOperand(address)); __ sw(value, MemOperand(address));
// Update write barrier for the elements array address. // Update write barrier for the elements array address.
__ mov(scratch, value); // Preserve the value which is returned. __ mov(scratch, value); // Preserve the value which is returned.
...@@ -550,8 +546,7 @@ static void KeyedStoreGenerateMegamorphicHelper( ...@@ -550,8 +546,7 @@ static void KeyedStoreGenerateMegamorphicHelper(
// go to the runtime. // go to the runtime.
__ Addu(address, elements, Operand(FixedDoubleArray::kHeaderSize + __ Addu(address, elements, Operand(FixedDoubleArray::kHeaderSize +
kHoleNanUpper32Offset - kHeapObjectTag)); kHoleNanUpper32Offset - kHeapObjectTag));
__ sll(at, key, kPointerSizeLog2); __ Lsa(address, address, key, kPointerSizeLog2);
__ addu(address, address, at);
__ lw(scratch, MemOperand(address)); __ lw(scratch, MemOperand(address));
__ Branch(&fast_double_without_map_check, ne, scratch, __ Branch(&fast_double_without_map_check, ne, scratch,
Operand(kHoleNanUpper32)); Operand(kHoleNanUpper32));
......
...@@ -42,13 +42,11 @@ static void ProbeTable(Isolate* isolate, MacroAssembler* masm, ...@@ -42,13 +42,11 @@ static void ProbeTable(Isolate* isolate, MacroAssembler* masm,
scratch = no_reg; scratch = no_reg;
// Multiply by 3 because there are 3 fields per entry (name, code, map). // Multiply by 3 because there are 3 fields per entry (name, code, map).
__ sll(offset_scratch, offset, 1); __ Lsa(offset_scratch, offset, offset, 1);
__ Addu(offset_scratch, offset_scratch, offset);
// Calculate the base address of the entry. // Calculate the base address of the entry.
__ li(base_addr, Operand(key_offset)); __ li(base_addr, Operand(key_offset));
__ sll(at, offset_scratch, kPointerSizeLog2); __ Lsa(base_addr, base_addr, offset_scratch, kPointerSizeLog2);
__ Addu(base_addr, base_addr, at);
// Check that the key in the entry matches the name. // Check that the key in the entry matches the name.
__ lw(at, MemOperand(base_addr, 0)); __ lw(at, MemOperand(base_addr, 0));
......
This diff is collapsed.
This diff is collapsed.
...@@ -767,8 +767,7 @@ void ElementsTransitionGenerator::GenerateSmiToDouble( ...@@ -767,8 +767,7 @@ void ElementsTransitionGenerator::GenerateSmiToDouble(
__ Addu(scratch1, elements, __ Addu(scratch1, elements,
Operand(FixedArray::kHeaderSize - kHeapObjectTag)); Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ Addu(scratch3, array, Operand(FixedDoubleArray::kHeaderSize)); __ Addu(scratch3, array, Operand(FixedDoubleArray::kHeaderSize));
__ sll(at, length, 2); __ Lsa(array_end, scratch3, length, 2);
__ Addu(array_end, scratch3, at);
// Repurpose registers no longer in use. // Repurpose registers no longer in use.
Register hole_lower = elements; Register hole_lower = elements;
...@@ -899,8 +898,7 @@ void ElementsTransitionGenerator::GenerateDoubleToObject( ...@@ -899,8 +898,7 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
FixedDoubleArray::kHeaderSize - kHeapObjectTag FixedDoubleArray::kHeaderSize - kHeapObjectTag
+ Register::kExponentOffset)); + Register::kExponentOffset));
__ Addu(dst_elements, array, Operand(FixedArray::kHeaderSize)); __ Addu(dst_elements, array, Operand(FixedArray::kHeaderSize));
__ sll(dst_end, dst_end, 1); __ Lsa(dst_end, dst_elements, dst_end, 1);
__ Addu(dst_end, dst_elements, dst_end);
// Allocating heap numbers in the loop below can fail and cause a jump to // Allocating heap numbers in the loop below can fail and cause a jump to
// gc_required. We can't leave a partly initialized FixedArray behind, // gc_required. We can't leave a partly initialized FixedArray behind,
...@@ -1082,8 +1080,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, ...@@ -1082,8 +1080,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
__ And(at, result, Operand(kStringEncodingMask)); __ And(at, result, Operand(kStringEncodingMask));
__ Branch(&one_byte, ne, at, Operand(zero_reg)); __ Branch(&one_byte, ne, at, Operand(zero_reg));
// Two-byte string. // Two-byte string.
__ sll(at, index, 1); __ Lsa(at, string, index, 1);
__ Addu(at, string, at);
__ lhu(result, MemOperand(at)); __ lhu(result, MemOperand(at));
__ jmp(&done); __ jmp(&done);
__ bind(&one_byte); __ bind(&one_byte);
...@@ -1156,8 +1153,7 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm, ...@@ -1156,8 +1153,7 @@ void MathExpGenerator::EmitMathExp(MacroAssembler* masm,
// Must not call ExpConstant() after overwriting temp3! // Must not call ExpConstant() after overwriting temp3!
__ li(temp3, Operand(ExternalReference::math_exp_log_table())); __ li(temp3, Operand(ExternalReference::math_exp_log_table()));
__ sll(at, temp2, 3); __ Lsa(temp3, temp3, temp2, 3);
__ Addu(temp3, temp3, Operand(at));
__ lw(temp2, MemOperand(temp3, Register::kMantissaOffset)); __ lw(temp2, MemOperand(temp3, Register::kMantissaOffset));
__ lw(temp3, MemOperand(temp3, Register::kExponentOffset)); __ lw(temp3, MemOperand(temp3, Register::kExponentOffset));
// The first word is loaded is the lower number register. // The first word is loaded is the lower number register.
......
...@@ -268,8 +268,7 @@ void Deoptimizer::TableEntryGenerator::Generate() { ...@@ -268,8 +268,7 @@ void Deoptimizer::TableEntryGenerator::Generate() {
// a1 = one past the last FrameDescription**. // a1 = one past the last FrameDescription**.
__ lw(a1, MemOperand(a0, Deoptimizer::output_count_offset())); __ lw(a1, MemOperand(a0, Deoptimizer::output_count_offset()));
__ lw(t0, MemOperand(a0, Deoptimizer::output_offset())); // t0 is output_. __ lw(t0, MemOperand(a0, Deoptimizer::output_offset())); // t0 is output_.
__ sll(a1, a1, kPointerSizeLog2); // Count to offset. __ Lsa(a1, t0, a1, kPointerSizeLog2);
__ addu(a1, t0, a1); // a1 = one past the last FrameDescription**.
__ BranchShort(&outer_loop_header); __ BranchShort(&outer_loop_header);
__ bind(&outer_push_loop); __ bind(&outer_push_loop);
// Inner loop state: a2 = current FrameDescription*, a3 = loop index. // Inner loop state: a2 = current FrameDescription*, a3 = loop index.
......
...@@ -499,16 +499,14 @@ void MacroAssembler::GetNumberHash(Register reg0, Register scratch) { ...@@ -499,16 +499,14 @@ void MacroAssembler::GetNumberHash(Register reg0, Register scratch) {
// //
// hash = ~hash + (hash << 15); // hash = ~hash + (hash << 15);
nor(scratch, reg0, zero_reg); nor(scratch, reg0, zero_reg);
sll(at, reg0, 15); Lsa(reg0, scratch, reg0, 15);
addu(reg0, scratch, at);
// hash = hash ^ (hash >> 12); // hash = hash ^ (hash >> 12);
srl(at, reg0, 12); srl(at, reg0, 12);
xor_(reg0, reg0, at); xor_(reg0, reg0, at);
// hash = hash + (hash << 2); // hash = hash + (hash << 2);
sll(at, reg0, 2); Lsa(reg0, reg0, reg0, 2);
addu(reg0, reg0, at);
// hash = hash ^ (hash >> 4); // hash = hash ^ (hash >> 4);
srl(at, reg0, 4); srl(at, reg0, 4);
...@@ -516,8 +514,7 @@ void MacroAssembler::GetNumberHash(Register reg0, Register scratch) { ...@@ -516,8 +514,7 @@ void MacroAssembler::GetNumberHash(Register reg0, Register scratch) {
// hash = hash * 2057; // hash = hash * 2057;
sll(scratch, reg0, 11); sll(scratch, reg0, 11);
sll(at, reg0, 3); Lsa(reg0, reg0, reg0, 3);
addu(reg0, reg0, at);
addu(reg0, reg0, scratch); addu(reg0, reg0, scratch);
// hash = hash ^ (hash >> 16); // hash = hash ^ (hash >> 16);
...@@ -577,12 +574,10 @@ void MacroAssembler::LoadFromNumberDictionary(Label* miss, ...@@ -577,12 +574,10 @@ void MacroAssembler::LoadFromNumberDictionary(Label* miss,
// Scale the index by multiplying by the element size. // Scale the index by multiplying by the element size.
DCHECK(SeededNumberDictionary::kEntrySize == 3); DCHECK(SeededNumberDictionary::kEntrySize == 3);
sll(at, reg2, 1); // 2x. Lsa(reg2, reg2, reg2, 1); // reg2 = reg2 * 3.
addu(reg2, reg2, at); // reg2 = reg2 * 3.
// Check if the key is identical to the name. // Check if the key is identical to the name.
sll(at, reg2, kPointerSizeLog2); Lsa(reg2, elements, reg2, kPointerSizeLog2);
addu(reg2, elements, at);
lw(at, FieldMemOperand(reg2, SeededNumberDictionary::kElementsStartOffset)); lw(at, FieldMemOperand(reg2, SeededNumberDictionary::kElementsStartOffset));
if (i != kNumberDictionaryProbes - 1) { if (i != kNumberDictionaryProbes - 1) {
...@@ -3412,8 +3407,7 @@ void MacroAssembler::Allocate(Register object_size, Register result, ...@@ -3412,8 +3407,7 @@ void MacroAssembler::Allocate(Register object_size, Register result,
// to calculate the new top. Object size may be in words so a shift is // to calculate the new top. Object size may be in words so a shift is
// required to get the number of bytes. // required to get the number of bytes.
if ((flags & SIZE_IN_WORDS) != 0) { if ((flags & SIZE_IN_WORDS) != 0) {
sll(result_end, object_size, kPointerSizeLog2); Lsa(result_end, result, object_size, kPointerSizeLog2);
Addu(result_end, result, result_end);
} else { } else {
Addu(result_end, result, Operand(object_size)); Addu(result_end, result, Operand(object_size));
} }
...@@ -3775,8 +3769,7 @@ void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, ...@@ -3775,8 +3769,7 @@ void MacroAssembler::StoreNumberToDoubleElements(Register value_reg,
lw(mantissa_reg, FieldMemOperand(value_reg, HeapNumber::kMantissaOffset)); lw(mantissa_reg, FieldMemOperand(value_reg, HeapNumber::kMantissaOffset));
bind(&have_double_value); bind(&have_double_value);
sll(scratch1, key_reg, kDoubleSizeLog2 - kSmiTagSize); Lsa(scratch1, elements_reg, key_reg, kDoubleSizeLog2 - kSmiTagSize);
Addu(scratch1, scratch1, elements_reg);
sw(mantissa_reg, sw(mantissa_reg,
FieldMemOperand(scratch1, FixedDoubleArray::kHeaderSize - elements_offset FieldMemOperand(scratch1, FixedDoubleArray::kHeaderSize - elements_offset
+ kHoleNanLower32Offset)); + kHoleNanLower32Offset));
...@@ -3802,8 +3795,7 @@ void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, ...@@ -3802,8 +3795,7 @@ void MacroAssembler::StoreNumberToDoubleElements(Register value_reg,
Addu(scratch1, elements_reg, Addu(scratch1, elements_reg,
Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag - Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag -
elements_offset)); elements_offset));
sll(scratch2, key_reg, kDoubleSizeLog2 - kSmiTagSize); Lsa(scratch1, scratch1, key_reg, kDoubleSizeLog2 - kSmiTagSize);
Addu(scratch1, scratch1, scratch2);
// scratch1 is now effective address of the double element // scratch1 is now effective address of the double element
Register untagged_value = scratch2; Register untagged_value = scratch2;
...@@ -4945,8 +4937,7 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count, ...@@ -4945,8 +4937,7 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, Register argument_count,
if (argument_count_is_length) { if (argument_count_is_length) {
addu(sp, sp, argument_count); addu(sp, sp, argument_count);
} else { } else {
sll(t8, argument_count, kPointerSizeLog2); Lsa(sp, sp, argument_count, kPointerSizeLog2, t8);
addu(sp, sp, t8);
} }
} }
...@@ -5473,8 +5464,7 @@ void MacroAssembler::GetMarkBits(Register addr_reg, ...@@ -5473,8 +5464,7 @@ void MacroAssembler::GetMarkBits(Register addr_reg,
Ext(mask_reg, addr_reg, kPointerSizeLog2, Bitmap::kBitsPerCellLog2); Ext(mask_reg, addr_reg, kPointerSizeLog2, Bitmap::kBitsPerCellLog2);
const int kLowBits = kPointerSizeLog2 + Bitmap::kBitsPerCellLog2; const int kLowBits = kPointerSizeLog2 + Bitmap::kBitsPerCellLog2;
Ext(t8, addr_reg, kLowBits, kPageSizeBits - kLowBits); Ext(t8, addr_reg, kLowBits, kPageSizeBits - kLowBits);
sll(t8, t8, kPointerSizeLog2); Lsa(bitmap_reg, bitmap_reg, t8, kPointerSizeLog2, t8);
Addu(bitmap_reg, bitmap_reg, t8);
li(t8, Operand(1)); li(t8, Operand(1));
sllv(mask_reg, t8, mask_reg); sllv(mask_reg, t8, mask_reg);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment