Commit 96baec27 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: Remove receiver conversion from function prologue

Port 4ab1b05d

Original commit message:
    Depends on https://codereview.chromium.org/1407373007/
    After that CL, all receiver conversion is handled by the call builtin.

R=verwaest@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, dstence@us.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#31902}
parent 44fcc2e7
......@@ -117,24 +117,6 @@ bool LCodeGen::GeneratePrologue() {
// fp: Caller's frame pointer.
// lr: Caller's pc.
// ip: Our own function entry (required by the prologue)
// Sloppy mode functions and builtins need to replace the receiver with the
// global proxy when called as functions (without an explicit receiver
// object).
if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) {
Label ok;
int receiver_offset = info_->scope()->num_parameters() * kPointerSize;
__ LoadP(r5, MemOperand(sp, receiver_offset));
__ CompareRoot(r5, Heap::kUndefinedValueRootIndex);
__ bne(&ok);
__ LoadP(r5, GlobalObjectOperand());
__ LoadP(r5, FieldMemOperand(r5, JSGlobalObject::kGlobalProxyOffset));
__ StoreP(r5, MemOperand(sp, receiver_offset));
__ bind(&ok);
}
}
int prologue_offset = masm_->pc_offset();
......
......@@ -113,22 +113,12 @@ void FullCodeGenerator::Generate() {
}
#endif
// Sloppy mode functions and builtins need to replace the receiver with the
// global proxy when called as functions (without an explicit receiver
// object).
if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) {
Label ok;
if (FLAG_debug_code && info->ExpectsJSReceiverAsReceiver()) {
int receiver_offset = info->scope()->num_parameters() * kPointerSize;
__ LoadP(r5, MemOperand(sp, receiver_offset), r0);
__ CompareRoot(r5, Heap::kUndefinedValueRootIndex);
__ bne(&ok);
__ LoadP(r5, GlobalObjectOperand());
__ LoadP(r5, FieldMemOperand(r5, JSGlobalObject::kGlobalProxyOffset));
__ StoreP(r5, MemOperand(sp, receiver_offset), r0);
__ bind(&ok);
__ AssertNotSmi(r5);
__ CompareObjectType(r5, r5, no_reg, FIRST_SPEC_OBJECT_TYPE);
__ Assert(ge, kSloppyFunctionExpectsJSReceiverReceiver);
}
// Open a frame scope to indicate that there is a frame on the stack. The
......
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