| Index: src/mips/builtins-mips.cc
|
| diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
|
| index 44acfb99a1ca9a8b95ea48f2719fed59979b08bd..b9607e05c49fde689881f81832fa81179bd929f3 100644
|
| --- a/src/mips/builtins-mips.cc
|
| +++ b/src/mips/builtins-mips.cc
|
| @@ -1432,6 +1432,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
|
|
|
|
|
| static void Generate_PushAppliedArguments(MacroAssembler* masm,
|
| + const int vectorOffset,
|
| const int argumentsOffset,
|
| const int indexOffset,
|
| const int limitOffset) {
|
| @@ -1449,13 +1450,9 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
|
| __ lw(receiver, MemOperand(fp, argumentsOffset));
|
|
|
| // Use inline caching to speed up access to arguments.
|
| - Code::Kind kinds[] = {Code::KEYED_LOAD_IC};
|
| - FeedbackVectorSpec spec(0, 1, kinds);
|
| - Handle<TypeFeedbackVector> feedback_vector =
|
| - masm->isolate()->factory()->NewTypeFeedbackVector(&spec);
|
| - int index = feedback_vector->GetIndex(FeedbackVectorICSlot(0));
|
| - __ li(slot, Operand(Smi::FromInt(index)));
|
| - __ li(vector, feedback_vector);
|
| + int slot_index = TypeFeedbackVector::PushAppliedArgumentsIndex();
|
| + __ li(slot, Operand(Smi::FromInt(slot_index)));
|
| + __ lw(vector, MemOperand(fp, vectorOffset));
|
| Handle<Code> ic =
|
| KeyedLoadICStub(masm->isolate(), LoadICState(kNoExtraICState)).GetCode();
|
| __ Call(ic, RelocInfo::CODE_TARGET);
|
| @@ -1489,6 +1486,13 @@ static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) {
|
| const int kArgumentsOffset = kFPOnStackSize + kPCOnStackSize;
|
| const int kReceiverOffset = kArgumentsOffset + kPointerSize;
|
| const int kFunctionOffset = kReceiverOffset + kPointerSize;
|
| + const int kVectorOffset =
|
| + InternalFrameConstants::kCodeOffset - 1 * kPointerSize;
|
| +
|
| + // Push the vector.
|
| + __ lw(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
|
| + __ lw(a1, FieldMemOperand(a1, SharedFunctionInfo::kFeedbackVectorOffset));
|
| + __ Push(a1);
|
|
|
| __ lw(a0, MemOperand(fp, kFunctionOffset)); // Get the function.
|
| __ push(a0);
|
| @@ -1505,10 +1509,8 @@ static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) {
|
| Generate_CheckStackOverflow(masm, kFunctionOffset, v0, kArgcIsSmiTagged);
|
|
|
| // Push current limit and index.
|
| - const int kIndexOffset =
|
| - StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize);
|
| - const int kLimitOffset =
|
| - StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize);
|
| + const int kIndexOffset = kVectorOffset - (2 * kPointerSize);
|
| + const int kLimitOffset = kVectorOffset - (1 * kPointerSize);
|
| __ mov(a1, zero_reg);
|
| __ Push(v0, a1); // Limit and initial index.
|
|
|
| @@ -1569,8 +1571,8 @@ static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) {
|
| __ push(a0);
|
|
|
| // Copy all arguments from the array to the stack.
|
| - Generate_PushAppliedArguments(
|
| - masm, kArgumentsOffset, kIndexOffset, kLimitOffset);
|
| + Generate_PushAppliedArguments(masm, kVectorOffset, kArgumentsOffset,
|
| + kIndexOffset, kLimitOffset);
|
|
|
| // Call the function.
|
| Label call_proxy;
|
| @@ -1610,6 +1612,13 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
|
| const int kNewTargetOffset = kFPOnStackSize + kPCOnStackSize;
|
| const int kArgumentsOffset = kNewTargetOffset + kPointerSize;
|
| const int kFunctionOffset = kArgumentsOffset + kPointerSize;
|
| + const int kVectorOffset =
|
| + InternalFrameConstants::kCodeOffset - 1 * kPointerSize;
|
| +
|
| + // Push the vector.
|
| + __ lw(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
|
| + __ lw(a1, FieldMemOperand(a1, SharedFunctionInfo::kFeedbackVectorOffset));
|
| + __ Push(a1);
|
|
|
| // If newTarget is not supplied, set it to constructor
|
| Label validate_arguments;
|
| @@ -1634,10 +1643,8 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
|
| Generate_CheckStackOverflow(masm, kFunctionOffset, v0, kArgcIsSmiTagged);
|
|
|
| // Push current limit and index.
|
| - const int kIndexOffset =
|
| - StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize);
|
| - const int kLimitOffset =
|
| - StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize);
|
| + const int kIndexOffset = kVectorOffset - (2 * kPointerSize);
|
| + const int kLimitOffset = kVectorOffset - (1 * kPointerSize);
|
| __ push(v0); // limit
|
| __ mov(a1, zero_reg); // initial index
|
| __ push(a1);
|
| @@ -1646,8 +1653,8 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
|
| __ push(a0);
|
|
|
| // Copy all arguments from the array to the stack.
|
| - Generate_PushAppliedArguments(
|
| - masm, kArgumentsOffset, kIndexOffset, kLimitOffset);
|
| + Generate_PushAppliedArguments(masm, kVectorOffset, kArgumentsOffset,
|
| + kIndexOffset, kLimitOffset);
|
|
|
| // Use undefined feedback vector
|
| __ LoadRoot(a2, Heap::kUndefinedValueRootIndex);
|
|
|