MIPS: Improve 'Always include js-getter as separate field in AccessorInfo'.

Port 89606003af

Improve stack handling (optimize push() calls) on MIPS.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35791}
This commit is contained in:
balazs.kilvady 2016-04-26 04:59:12 -07:00 committed by Commit bot
parent 4ffdce65dd
commit b77953b0a8
2 changed files with 38 additions and 20 deletions

View File

@ -5708,21 +5708,30 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) {
Register holder = ApiGetterDescriptor::HolderRegister();
Register callback = ApiGetterDescriptor::CallbackRegister();
Register scratch = t0;
Register scratch2 = t1;
Register scratch3 = t2;
DCHECK(!AreAliased(receiver, holder, callback, scratch, scratch2, scratch3));
DCHECK(!AreAliased(receiver, holder, callback, scratch));
Register api_function_address = a2;
__ Push(receiver);
// Push data from AccessorInfo.
// Here and below +1 is for name() pushed after the args_ array.
typedef PropertyCallbackArguments PCA;
__ Subu(sp, sp, (PCA::kArgsLength + 1) * kPointerSize);
__ sw(receiver, MemOperand(sp, (PCA::kThisIndex + 1) * kPointerSize));
__ lw(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));
__ sw(scratch, MemOperand(sp, (PCA::kDataIndex + 1) * kPointerSize));
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
__ li(scratch2, Operand(ExternalReference::isolate_address(isolate())));
__ lw(scratch3, FieldMemOperand(callback, AccessorInfo::kDataOffset));
__ Push(scratch3, scratch, scratch, scratch2, holder);
__ Push(Smi::FromInt(0)); // should_throw_on_error -> false
__ sw(scratch, MemOperand(sp, (PCA::kReturnValueOffset + 1) * kPointerSize));
__ sw(scratch, MemOperand(sp, (PCA::kReturnValueDefaultValueIndex + 1) *
kPointerSize));
__ li(scratch, Operand(ExternalReference::isolate_address(isolate())));
__ sw(scratch, MemOperand(sp, (PCA::kIsolateIndex + 1) * kPointerSize));
__ sw(holder, MemOperand(sp, (PCA::kHolderIndex + 1) * kPointerSize));
// should_throw_on_error -> false
DCHECK(Smi::FromInt(0) == nullptr);
__ sw(zero_reg,
MemOperand(sp, (PCA::kShouldThrowOnErrorIndex + 1) * kPointerSize));
__ lw(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
__ push(scratch);
__ sw(scratch, MemOperand(sp, 0 * kPointerSize));
// v8::PropertyCallbackInfo::args_ array and name handle.
const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;

View File

@ -5739,21 +5739,30 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) {
Register holder = ApiGetterDescriptor::HolderRegister();
Register callback = ApiGetterDescriptor::CallbackRegister();
Register scratch = a4;
Register scratch2 = a5;
Register scratch3 = a6;
DCHECK(!AreAliased(receiver, holder, callback, scratch, scratch2, scratch3));
DCHECK(!AreAliased(receiver, holder, callback, scratch));
Register api_function_address = a2;
__ Push(receiver);
// Push data from AccessorInfo.
// Here and below +1 is for name() pushed after the args_ array.
typedef PropertyCallbackArguments PCA;
__ Dsubu(sp, sp, (PCA::kArgsLength + 1) * kPointerSize);
__ sd(receiver, MemOperand(sp, (PCA::kThisIndex + 1) * kPointerSize));
__ ld(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));
__ sd(scratch, MemOperand(sp, (PCA::kDataIndex + 1) * kPointerSize));
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
__ li(scratch2, Operand(ExternalReference::isolate_address(isolate())));
__ ld(scratch3, FieldMemOperand(callback, AccessorInfo::kDataOffset));
__ Push(scratch3, scratch, scratch, scratch2, holder);
__ Push(Smi::FromInt(0)); // should_throw_on_error -> false
__ sd(scratch, MemOperand(sp, (PCA::kReturnValueOffset + 1) * kPointerSize));
__ sd(scratch, MemOperand(sp, (PCA::kReturnValueDefaultValueIndex + 1) *
kPointerSize));
__ li(scratch, Operand(ExternalReference::isolate_address(isolate())));
__ sd(scratch, MemOperand(sp, (PCA::kIsolateIndex + 1) * kPointerSize));
__ sd(holder, MemOperand(sp, (PCA::kHolderIndex + 1) * kPointerSize));
// should_throw_on_error -> false
DCHECK(Smi::FromInt(0) == nullptr);
__ sd(zero_reg,
MemOperand(sp, (PCA::kShouldThrowOnErrorIndex + 1) * kPointerSize));
__ ld(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
__ Push(scratch);
__ sd(scratch, MemOperand(sp, 0 * kPointerSize));
// v8::PropertyCallbackInfo::args_ array and name handle.
const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;