Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.cc

Issue 1453113002: Handle StepIn for constructors through PrepareStep just like for regular calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add ports Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/debug/debug.h" 10 #include "src/debug/debug.h"
(...skipping 2957 matching lines...) Expand 10 before | Expand all | Expand 10 after
2968 2968
2969 // Push the arguments ("left-to-right") on the stack. 2969 // Push the arguments ("left-to-right") on the stack.
2970 ZoneList<Expression*>* args = expr->arguments(); 2970 ZoneList<Expression*>* args = expr->arguments();
2971 int arg_count = args->length(); 2971 int arg_count = args->length();
2972 for (int i = 0; i < arg_count; i++) { 2972 for (int i = 0; i < arg_count; i++) {
2973 VisitForStackValue(args->at(i)); 2973 VisitForStackValue(args->at(i));
2974 } 2974 }
2975 2975
2976 // Call the construct call builtin that handles allocation and 2976 // Call the construct call builtin that handles allocation and
2977 // constructor invocation. 2977 // constructor invocation.
2978 SetConstructCallPosition(expr); 2978 SetConstructCallPosition(expr, arg_count);
2979 2979
2980 // Load function and argument count into edi and eax. 2980 // Load function and argument count into edi and eax.
2981 __ Move(eax, Immediate(arg_count)); 2981 __ Move(eax, Immediate(arg_count));
2982 __ mov(edi, Operand(esp, arg_count * kPointerSize)); 2982 __ mov(edi, Operand(esp, arg_count * kPointerSize));
2983 2983
2984 // Record call targets in unoptimized code. 2984 // Record call targets in unoptimized code.
2985 __ EmitLoadTypeFeedbackVector(ebx); 2985 __ EmitLoadTypeFeedbackVector(ebx);
2986 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); 2986 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot())));
2987 2987
2988 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); 2988 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
(...skipping 15 matching lines...) Expand all
3004 3004
3005 // Push the arguments ("left-to-right") on the stack. 3005 // Push the arguments ("left-to-right") on the stack.
3006 ZoneList<Expression*>* args = expr->arguments(); 3006 ZoneList<Expression*>* args = expr->arguments();
3007 int arg_count = args->length(); 3007 int arg_count = args->length();
3008 for (int i = 0; i < arg_count; i++) { 3008 for (int i = 0; i < arg_count; i++) {
3009 VisitForStackValue(args->at(i)); 3009 VisitForStackValue(args->at(i));
3010 } 3010 }
3011 3011
3012 // Call the construct call builtin that handles allocation and 3012 // Call the construct call builtin that handles allocation and
3013 // constructor invocation. 3013 // constructor invocation.
3014 SetConstructCallPosition(expr); 3014 SetConstructCallPosition(expr, arg_count);
3015 3015
3016 // Load new target into ecx. 3016 // Load new target into ecx.
3017 VisitForAccumulatorValue(super_call_ref->new_target_var()); 3017 VisitForAccumulatorValue(super_call_ref->new_target_var());
3018 __ mov(ecx, result_register()); 3018 __ mov(ecx, result_register());
3019 3019
3020 // Load function and argument count into edi and eax. 3020 // Load function and argument count into edi and eax.
3021 __ Move(eax, Immediate(arg_count)); 3021 __ Move(eax, Immediate(arg_count));
3022 __ mov(edi, Operand(esp, arg_count * kPointerSize)); 3022 __ mov(edi, Operand(esp, arg_count * kPointerSize));
3023 3023
3024 // Record call targets in unoptimized code. 3024 // Record call targets in unoptimized code.
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
3745 3745
3746 3746
3747 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { 3747 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) {
3748 ZoneList<Expression*>* args = expr->arguments(); 3748 ZoneList<Expression*>* args = expr->arguments();
3749 DCHECK(args->length() == 2); 3749 DCHECK(args->length() == 2);
3750 3750
3751 // Evaluate new.target and super constructor. 3751 // Evaluate new.target and super constructor.
3752 VisitForStackValue(args->at(0)); 3752 VisitForStackValue(args->at(0));
3753 VisitForStackValue(args->at(1)); 3753 VisitForStackValue(args->at(1));
3754 3754
3755 // Call the construct call builtin that handles allocation and
3756 // constructor invocation.
3757 SetConstructCallPosition(expr, 0);
3758
3755 // Check if the calling frame is an arguments adaptor frame. 3759 // Check if the calling frame is an arguments adaptor frame.
3756 Label adaptor_frame, args_set_up, runtime; 3760 Label adaptor_frame, args_set_up, runtime;
3757 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); 3761 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
3758 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset)); 3762 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset));
3759 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 3763 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
3760 __ j(equal, &adaptor_frame); 3764 __ j(equal, &adaptor_frame);
3761 // default constructor has no arguments, so no adaptor frame means no args. 3765 // default constructor has no arguments, so no adaptor frame means no args.
3762 __ mov(eax, Immediate(0)); 3766 __ mov(eax, Immediate(0));
3763 __ jmp(&args_set_up); 3767 __ jmp(&args_set_up);
3764 3768
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
4959 Assembler::target_address_at(call_target_address, 4963 Assembler::target_address_at(call_target_address,
4960 unoptimized_code)); 4964 unoptimized_code));
4961 return OSR_AFTER_STACK_CHECK; 4965 return OSR_AFTER_STACK_CHECK;
4962 } 4966 }
4963 4967
4964 4968
4965 } // namespace internal 4969 } // namespace internal
4966 } // namespace v8 4970 } // namespace v8
4967 4971
4968 #endif // V8_TARGET_ARCH_IA32 4972 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698