Commit da72ba0b authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: Remove receiver conversion from function prologue.

  port 4ab1b05d (r31826).

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

BUG=

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

Cr-Commit-Position: refs/heads/master@{#31849}
parent 018ecfd1
......@@ -107,26 +107,6 @@ bool LCodeGen::GeneratePrologue() {
}
#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;
// +1 for return address.
int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize;
__ mov(ecx, Operand(esp, receiver_offset));
__ cmp(ecx, isolate()->factory()->undefined_value());
__ j(not_equal, &ok, Label::kNear);
__ mov(ecx, GlobalObjectOperand());
__ mov(ecx, FieldOperand(ecx, JSGlobalObject::kGlobalProxyOffset));
__ mov(Operand(esp, receiver_offset), ecx);
__ bind(&ok);
}
if (support_aligned_spilled_doubles_ && dynamic_frame_alignment_) {
// Move state of dynamic frame alignment into edx.
__ Move(edx, Immediate(kNoAlignmentPadding));
......
......@@ -105,24 +105,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;
// +1 for return address.
if (FLAG_debug_code && info->ExpectsJSReceiverAsReceiver()) {
int receiver_offset = (info->scope()->num_parameters() + 1) * kPointerSize;
__ mov(ecx, Operand(esp, receiver_offset));
__ cmp(ecx, isolate()->factory()->undefined_value());
__ j(not_equal, &ok, Label::kNear);
__ mov(ecx, GlobalObjectOperand());
__ mov(ecx, FieldOperand(ecx, JSGlobalObject::kGlobalProxyOffset));
__ mov(Operand(esp, receiver_offset), ecx);
__ bind(&ok);
__ AssertNotSmi(ecx);
__ CmpObjectType(ecx, FIRST_SPEC_OBJECT_TYPE, ecx);
__ Assert(above_equal, 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