Commit 01009640 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: Fix "Fix receiver when calling eval() bound by with scope"

R=wingo@igalia.com, dstence@us.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#29300}
parent 87fd4366
......@@ -1397,7 +1397,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
// 5b. Get the code to call from the function and check that the number of
// expected arguments matches what we're providing. If so, jump
// (tail-call) to the code in register edx without checking arguments.
// (tail-call) to the code in register ip without checking arguments.
// r3: actual number of arguments
// r4: function
__ LoadP(r6, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
......
......@@ -3148,34 +3148,35 @@ void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) {
EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done);
}
__ bind(&slow);
// Call the runtime to find the function to call (returned in rax) and
// the object holding it (returned in rdx).
__ Push(context_register());
__ Push(callee->name());
// Call the runtime to find the function to call (returned in r3) and
// the object holding it (returned in r4).
DCHECK(!context_register().is(r5));
__ mov(r5, Operand(callee->name()));
__ Push(context_register(), r5);
__ CallRuntime(Runtime::kLoadLookupSlot, 2);
__ Push(rax); // Function.
__ Push(rdx); // Receiver.
__ Push(r3, r4); // Function, receiver.
PrepareForBailoutForId(expr->LookupId(), NO_REGISTERS);
// If fast case code has been generated, emit code to push the function
// and receiver and have the slow path jump around this code.
if (done.is_linked()) {
Label call;
__ jmp(&call, Label::kNear);
__ b(&call);
__ bind(&done);
// Push function.
__ Push(rax);
__ push(r3);
// Pass undefined as the receiver, which is the WithBaseObject of a
// non-object environment record. If the callee is sloppy, it will patch
// it up to be the global receiver.
__ PushRoot(Heap::kUndefinedValueRootIndex);
__ LoadRoot(r4, Heap::kUndefinedValueRootIndex);
__ push(r4);
__ bind(&call);
}
} else {
VisitForStackValue(callee);
// refEnv.WithBaseObject()
__ LoadRoot(r5, Heap::kUndefinedValueRootIndex);
__ push(r5);
__ push(r5); // Reserved receiver slot.
}
}
......@@ -3796,7 +3797,7 @@ void FullCodeGenerator::EmitArguments(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
// ArgumentsAccessStub expects the key in edx and the formal
// ArgumentsAccessStub expects the key in r4 and the formal
// parameter count in r3.
VisitForAccumulatorValue(args->at(0));
__ mr(r4, r3);
......
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