Index: src/mips64/builtins-mips64.cc |
diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc |
index df499c161d6e513c03ffda51d01bb65c05f0a3c7..0480d3334dd740efbe10a863e16b9f9c46b25e33 100644 |
--- a/src/mips64/builtins-mips64.cc |
+++ b/src/mips64/builtins-mips64.cc |
@@ -1250,6 +1250,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) { |
@@ -1267,13 +1268,9 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, |
__ ld(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))); |
+ __ ld(vector, MemOperand(fp, vectorOffset)); |
Handle<Code> ic = |
KeyedLoadICStub(masm->isolate(), LoadICState(kNoExtraICState)).GetCode(); |
__ Call(ic, RelocInfo::CODE_TARGET); |
@@ -1307,6 +1304,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. |
+ __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
+ __ ld(a1, FieldMemOperand(a1, SharedFunctionInfo::kFeedbackVectorOffset)); |
+ __ Push(a1); |
__ ld(a0, MemOperand(fp, kFunctionOffset)); // Get the function. |
__ ld(a1, MemOperand(fp, kArgumentsOffset)); // Get the args array. |
@@ -1324,17 +1328,15 @@ 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); |
__ ld(a2, MemOperand(fp, kReceiverOffset)); |
__ Push(v0, a1, a2); // limit, initial index and receiver. |
// Copy all arguments from the array to the stack. |
- Generate_PushAppliedArguments(masm, kArgumentsOffset, kIndexOffset, |
- kLimitOffset); |
+ Generate_PushAppliedArguments(masm, kVectorOffset, kArgumentsOffset, |
+ kIndexOffset, kLimitOffset); |
// Call the callable. |
// TODO(bmeurer): This should be a tail call according to ES6. |
@@ -1358,6 +1360,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. |
+ __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
+ __ ld(a1, FieldMemOperand(a1, SharedFunctionInfo::kFeedbackVectorOffset)); |
+ __ Push(a1); |
// If newTarget is not supplied, set it to constructor |
Label validate_arguments; |
@@ -1383,10 +1392,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); |
@@ -1395,8 +1402,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); |