Commit 543ae601 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: VectorICs: built-in function apply should use an IC.

Port 83a0af55

Original commit message:
Handled a TODO that sent builtin function apply to the runtime on property get.

R=mvstanton@chromium.org, dstence@us.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28178}
parent 2cc2ee0c
...@@ -1420,35 +1420,37 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1420,35 +1420,37 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
const int argumentsOffset, const int argumentsOffset,
const int indexOffset, const int indexOffset,
const int limitOffset) { const int limitOffset) {
Register receiver = LoadDescriptor::ReceiverRegister();
Register key = LoadDescriptor::NameRegister();
// Copy all arguments from the array to the stack.
Label entry, loop; Label entry, loop;
__ LoadP(r3, MemOperand(fp, indexOffset)); __ LoadP(key, MemOperand(fp, indexOffset));
__ b(&entry); __ b(&entry);
// Load the current argument from the arguments array and push it to the
// stack.
// r3: current argument index
__ bind(&loop); __ bind(&loop);
__ LoadP(r4, MemOperand(fp, argumentsOffset)); __ LoadP(receiver, MemOperand(fp, argumentsOffset));
__ Push(r4, r3);
// Use inline caching to speed up access to arguments.
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic();
__ Call(ic, RelocInfo::CODE_TARGET);
// Call the runtime to access the property in the arguments array. // Push the nth argument.
__ CallRuntime(Runtime::kGetProperty, 2);
__ push(r3); __ push(r3);
// Use inline caching to access the arguments. // Update the index on the stack and in register key.
__ LoadP(r3, MemOperand(fp, indexOffset)); __ LoadP(key, MemOperand(fp, indexOffset));
__ AddSmiLiteral(r3, r3, Smi::FromInt(1), r0); __ AddSmiLiteral(key, key, Smi::FromInt(1), r0);
__ StoreP(r3, MemOperand(fp, indexOffset)); __ StoreP(key, MemOperand(fp, indexOffset));
// Test if the copy loop has finished copying all the elements from the // Test if the copy loop has finished copying all the elements from the
// arguments object. // arguments object.
__ bind(&entry); __ bind(&entry);
__ LoadP(r4, MemOperand(fp, limitOffset)); __ LoadP(r0, MemOperand(fp, limitOffset));
__ cmp(r3, r4); __ cmp(key, r0);
__ bne(&loop); __ bne(&loop);
// On exit, the pushed arguments count is in r0, untagged // On exit, the pushed arguments count is in r3, untagged
__ SmiUntag(r3); __ SmiUntag(r3, key);
} }
......
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