X87: Handle StepIn for constructors through PrepareStep just like for regular calls.

port 14ec485c3a (r32044)

  original commit message:

BUG=

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

Cr-Commit-Position: refs/heads/master@{#32073}
This commit is contained in:
zhengxing.li 2015-11-18 00:32:08 -08:00 committed by Commit bot
parent 3e882ff1ea
commit 30d6a4deb2
2 changed files with 6 additions and 23 deletions

View File

@ -2936,7 +2936,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
SetConstructCallPosition(expr, arg_count);
// Load function and argument count into edi and eax.
__ Move(eax, Immediate(arg_count));
@ -2972,7 +2972,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
SetConstructCallPosition(expr, arg_count);
// Load new target into ecx.
VisitForAccumulatorValue(super_call_ref->new_target_var());
@ -3713,6 +3713,10 @@ void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) {
VisitForStackValue(args->at(0));
VisitForStackValue(args->at(1));
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr, 0);
// Check if the calling frame is an arguments adaptor frame.
Label adaptor_frame, args_set_up, runtime;
__ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));

View File

@ -146,11 +146,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// the preconditions is not met, the code bails out to the runtime call.
Label rt_call, allocated;
if (FLAG_inline_new) {
ExternalReference debug_step_in_fp =
ExternalReference::debug_step_in_fp_address(masm->isolate());
__ cmp(Operand::StaticVariable(debug_step_in_fp), Immediate(0));
__ j(not_equal, &rt_call);
// Verify that the new target is a JSFunction.
__ CmpObjectType(edx, JS_FUNCTION_TYPE, ebx);
__ j(not_equal, &rt_call);
@ -429,22 +424,6 @@ void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) {
__ dec(ecx);
__ j(greater_equal, &loop);
// Handle step in.
Label skip_step_in;
ExternalReference debug_step_in_fp =
ExternalReference::debug_step_in_fp_address(masm->isolate());
__ cmp(Operand::StaticVariable(debug_step_in_fp), Immediate(0));
__ j(equal, &skip_step_in);
__ push(eax);
__ push(edi);
__ push(edi);
__ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1);
__ pop(edi);
__ pop(eax);
__ bind(&skip_step_in);
// Invoke function.
ParameterCount actual(eax);
__ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper());