Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: src/ppc/builtins-ppc.cc

Issue 1363883002: Version 4.6.85.21 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.6
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index e002df89ec6fb0dfca8f026e86410ca8336e46d2..6ecfcea2f6ad75b122f86263daf28c9682d79a6d 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -1466,6 +1466,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) {
@@ -1482,13 +1483,9 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
__ LoadP(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));
- __ LoadSmiLiteral(slot, Smi::FromInt(index));
- __ Move(vector, feedback_vector);
+ int slot_index = TypeFeedbackVector::PushAppliedArgumentsIndex();
+ __ LoadSmiLiteral(slot, Smi::FromInt(slot_index));
+ __ LoadP(vector, MemOperand(fp, vectorOffset));
Handle<Code> ic =
KeyedLoadICStub(masm->isolate(), LoadICState(kNoExtraICState)).GetCode();
__ Call(ic, RelocInfo::CODE_TARGET);
@@ -1523,6 +1520,14 @@ 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.
+ __ LoadP(r4, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
+ __ LoadP(r4,
+ FieldMemOperand(r4, SharedFunctionInfo::kFeedbackVectorOffset));
+ __ push(r4);
__ LoadP(r3, MemOperand(fp, kFunctionOffset)); // get the function
__ push(r3);
@@ -1537,10 +1542,8 @@ static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) {
Generate_CheckStackOverflow(masm, kFunctionOffset, r3, 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);
__ li(r4, Operand::Zero());
__ Push(r3, r4); // limit and initial index.
@@ -1613,8 +1616,8 @@ static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) {
__ push(r3);
// 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;
@@ -1652,6 +1655,14 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
const int kNewTargetOffset = kFPOnStackSize + kPCOnStackSize;
const int kArgumentsOffset = kNewTargetOffset + kPointerSize;
const int kFunctionOffset = kArgumentsOffset + kPointerSize;
+ static const int kVectorOffset =
+ InternalFrameConstants::kCodeOffset - 1 * kPointerSize;
+
+ // Push the vector.
+ __ LoadP(r4, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
+ __ LoadP(r4,
+ FieldMemOperand(r4, SharedFunctionInfo::kFeedbackVectorOffset));
+ __ push(r4);
// If newTarget is not supplied, set it to constructor
Label validate_arguments;
@@ -1674,10 +1685,8 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
Generate_CheckStackOverflow(masm, kFunctionOffset, r3, 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);
__ li(r4, Operand::Zero());
__ Push(r3, r4); // limit and initial index.
// Push the constructor function as callee
@@ -1685,8 +1694,8 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
__ push(r3);
// 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(r5, Heap::kUndefinedValueRootIndex);
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698