Commit b44bea94 authored by akos.palfi's avatar akos.palfi Committed by Commit bot

MIPS: Fix '[runtime] Optimize and unify rest parameters.'

Fixes a register-clobbering problem. The Branch() instruction can overwrite the 'at' register, so it can't be used as scratch in Allocate(). Added DCHECK to avoid this in the future.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33912}
parent d12dbab4
......@@ -5242,7 +5242,7 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) {
Label allocate, done_allocate;
__ li(a1, Operand(JSArray::kSize + FixedArray::kHeaderSize));
__ Lsa(a1, a1, a0, kPointerSizeLog2 - 1);
__ Allocate(a1, v0, a3, at, &allocate, TAG_OBJECT);
__ Allocate(a1, v0, a3, t0, &allocate, TAG_OBJECT);
__ bind(&done_allocate);
// Setup the elements array in v0.
......
......@@ -3333,7 +3333,7 @@ void MacroAssembler::Allocate(int object_size,
return;
}
DCHECK(!AreAliased(result, scratch1, scratch2, t9));
DCHECK(!AreAliased(result, scratch1, scratch2, t9, at));
// Make object size into bytes.
if ((flags & SIZE_IN_WORDS) != 0) {
......@@ -3419,8 +3419,8 @@ void MacroAssembler::Allocate(Register object_size, Register result,
// |object_size| and |result_end| may overlap if the DOUBLE_ALIGNMENT flag
// is not specified. Other registers must not overlap.
DCHECK(!AreAliased(object_size, result, scratch, t9));
DCHECK(!AreAliased(result_end, result, scratch, t9));
DCHECK(!AreAliased(object_size, result, scratch, t9, at));
DCHECK(!AreAliased(result_end, result, scratch, t9, at));
DCHECK((flags & DOUBLE_ALIGNMENT) == 0 || !object_size.is(result_end));
// Check relative positions of allocation top and limit addresses.
......
......@@ -5258,7 +5258,7 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) {
Label allocate, done_allocate;
__ li(a1, Operand(JSArray::kSize + FixedArray::kHeaderSize));
__ Dlsa(a1, a1, a0, kPointerSizeLog2);
__ Allocate(a1, v0, a3, at, &allocate, TAG_OBJECT);
__ Allocate(a1, v0, a3, a4, &allocate, TAG_OBJECT);
__ bind(&done_allocate);
// Compute arguments.length in a4.
......
......@@ -3770,7 +3770,7 @@ void MacroAssembler::Allocate(int object_size,
return;
}
DCHECK(!AreAliased(result, scratch1, scratch2, t9));
DCHECK(!AreAliased(result, scratch1, scratch2, t9, at));
// Make object size into bytes.
if ((flags & SIZE_IN_WORDS) != 0) {
......@@ -3848,8 +3848,8 @@ void MacroAssembler::Allocate(Register object_size, Register result,
}
// |object_size| and |result_end| may overlap, other registers must not.
DCHECK(!AreAliased(object_size, result, scratch, t9));
DCHECK(!AreAliased(result_end, result, scratch, t9));
DCHECK(!AreAliased(object_size, result, scratch, t9, at));
DCHECK(!AreAliased(result_end, result, scratch, t9, at));
// Check relative positions of allocation top and limit addresses.
// ARM adds additional checks to make sure the ldm instruction can be
......
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