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

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

Issue 1457673003: X87: Handle StepIn for constructors through PrepareStep just like for regular calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | src/x87/builtins-x87.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_X87 5 #if V8_TARGET_ARCH_X87
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 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after
2929 2929
2930 // Push the arguments ("left-to-right") on the stack. 2930 // Push the arguments ("left-to-right") on the stack.
2931 ZoneList<Expression*>* args = expr->arguments(); 2931 ZoneList<Expression*>* args = expr->arguments();
2932 int arg_count = args->length(); 2932 int arg_count = args->length();
2933 for (int i = 0; i < arg_count; i++) { 2933 for (int i = 0; i < arg_count; i++) {
2934 VisitForStackValue(args->at(i)); 2934 VisitForStackValue(args->at(i));
2935 } 2935 }
2936 2936
2937 // Call the construct call builtin that handles allocation and 2937 // Call the construct call builtin that handles allocation and
2938 // constructor invocation. 2938 // constructor invocation.
2939 SetConstructCallPosition(expr); 2939 SetConstructCallPosition(expr, arg_count);
2940 2940
2941 // Load function and argument count into edi and eax. 2941 // Load function and argument count into edi and eax.
2942 __ Move(eax, Immediate(arg_count)); 2942 __ Move(eax, Immediate(arg_count));
2943 __ mov(edi, Operand(esp, arg_count * kPointerSize)); 2943 __ mov(edi, Operand(esp, arg_count * kPointerSize));
2944 2944
2945 // Record call targets in unoptimized code. 2945 // Record call targets in unoptimized code.
2946 __ EmitLoadTypeFeedbackVector(ebx); 2946 __ EmitLoadTypeFeedbackVector(ebx);
2947 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); 2947 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot())));
2948 2948
2949 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); 2949 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
(...skipping 15 matching lines...) Expand all
2965 2965
2966 // Push the arguments ("left-to-right") on the stack. 2966 // Push the arguments ("left-to-right") on the stack.
2967 ZoneList<Expression*>* args = expr->arguments(); 2967 ZoneList<Expression*>* args = expr->arguments();
2968 int arg_count = args->length(); 2968 int arg_count = args->length();
2969 for (int i = 0; i < arg_count; i++) { 2969 for (int i = 0; i < arg_count; i++) {
2970 VisitForStackValue(args->at(i)); 2970 VisitForStackValue(args->at(i));
2971 } 2971 }
2972 2972
2973 // Call the construct call builtin that handles allocation and 2973 // Call the construct call builtin that handles allocation and
2974 // constructor invocation. 2974 // constructor invocation.
2975 SetConstructCallPosition(expr); 2975 SetConstructCallPosition(expr, arg_count);
2976 2976
2977 // Load new target into ecx. 2977 // Load new target into ecx.
2978 VisitForAccumulatorValue(super_call_ref->new_target_var()); 2978 VisitForAccumulatorValue(super_call_ref->new_target_var());
2979 __ mov(ecx, result_register()); 2979 __ mov(ecx, result_register());
2980 2980
2981 // Load function and argument count into edi and eax. 2981 // Load function and argument count into edi and eax.
2982 __ Move(eax, Immediate(arg_count)); 2982 __ Move(eax, Immediate(arg_count));
2983 __ mov(edi, Operand(esp, arg_count * kPointerSize)); 2983 __ mov(edi, Operand(esp, arg_count * kPointerSize));
2984 2984
2985 // Record call targets in unoptimized code. 2985 // Record call targets in unoptimized code.
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
3706 3706
3707 3707
3708 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { 3708 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) {
3709 ZoneList<Expression*>* args = expr->arguments(); 3709 ZoneList<Expression*>* args = expr->arguments();
3710 DCHECK(args->length() == 2); 3710 DCHECK(args->length() == 2);
3711 3711
3712 // Evaluate new.target and super constructor. 3712 // Evaluate new.target and super constructor.
3713 VisitForStackValue(args->at(0)); 3713 VisitForStackValue(args->at(0));
3714 VisitForStackValue(args->at(1)); 3714 VisitForStackValue(args->at(1));
3715 3715
3716 // Call the construct call builtin that handles allocation and
3717 // constructor invocation.
3718 SetConstructCallPosition(expr, 0);
3719
3716 // Check if the calling frame is an arguments adaptor frame. 3720 // Check if the calling frame is an arguments adaptor frame.
3717 Label adaptor_frame, args_set_up, runtime; 3721 Label adaptor_frame, args_set_up, runtime;
3718 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); 3722 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
3719 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset)); 3723 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset));
3720 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 3724 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
3721 __ j(equal, &adaptor_frame); 3725 __ j(equal, &adaptor_frame);
3722 // default constructor has no arguments, so no adaptor frame means no args. 3726 // default constructor has no arguments, so no adaptor frame means no args.
3723 __ mov(eax, Immediate(0)); 3727 __ mov(eax, Immediate(0));
3724 __ jmp(&args_set_up); 3728 __ jmp(&args_set_up);
3725 3729
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
4912 Assembler::target_address_at(call_target_address, 4916 Assembler::target_address_at(call_target_address,
4913 unoptimized_code)); 4917 unoptimized_code));
4914 return OSR_AFTER_STACK_CHECK; 4918 return OSR_AFTER_STACK_CHECK;
4915 } 4919 }
4916 4920
4917 4921
4918 } // namespace internal 4922 } // namespace internal
4919 } // namespace v8 4923 } // namespace v8
4920 4924
4921 #endif // V8_TARGET_ARCH_X87 4925 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698