Commit 30d6a4de authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

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

  port 14ec485c (r32044)

  original commit message:

BUG=

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

Cr-Commit-Position: refs/heads/master@{#32073}
parent 3e882ff1
...@@ -2936,7 +2936,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { ...@@ -2936,7 +2936,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
// Call the construct call builtin that handles allocation and // Call the construct call builtin that handles allocation and
// constructor invocation. // constructor invocation.
SetConstructCallPosition(expr); SetConstructCallPosition(expr, arg_count);
// Load function and argument count into edi and eax. // Load function and argument count into edi and eax.
__ Move(eax, Immediate(arg_count)); __ Move(eax, Immediate(arg_count));
...@@ -2972,7 +2972,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { ...@@ -2972,7 +2972,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
// Call the construct call builtin that handles allocation and // Call the construct call builtin that handles allocation and
// constructor invocation. // constructor invocation.
SetConstructCallPosition(expr); SetConstructCallPosition(expr, arg_count);
// Load new target into ecx. // Load new target into ecx.
VisitForAccumulatorValue(super_call_ref->new_target_var()); VisitForAccumulatorValue(super_call_ref->new_target_var());
...@@ -3713,6 +3713,10 @@ void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { ...@@ -3713,6 +3713,10 @@ void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) {
VisitForStackValue(args->at(0)); VisitForStackValue(args->at(0));
VisitForStackValue(args->at(1)); 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. // Check if the calling frame is an arguments adaptor frame.
Label adaptor_frame, args_set_up, runtime; Label adaptor_frame, args_set_up, runtime;
__ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
......
...@@ -146,11 +146,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, ...@@ -146,11 +146,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// the preconditions is not met, the code bails out to the runtime call. // the preconditions is not met, the code bails out to the runtime call.
Label rt_call, allocated; Label rt_call, allocated;
if (FLAG_inline_new) { 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. // Verify that the new target is a JSFunction.
__ CmpObjectType(edx, JS_FUNCTION_TYPE, ebx); __ CmpObjectType(edx, JS_FUNCTION_TYPE, ebx);
__ j(not_equal, &rt_call); __ j(not_equal, &rt_call);
...@@ -429,22 +424,6 @@ void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) { ...@@ -429,22 +424,6 @@ void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) {
__ dec(ecx); __ dec(ecx);
__ j(greater_equal, &loop); __ 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. // Invoke function.
ParameterCount actual(eax); ParameterCount actual(eax);
__ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper()); __ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper());
......
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