| OLD | NEW |
| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 2873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2884 | 2884 |
| 2885 // Push the arguments ("left-to-right") on the stack. | 2885 // Push the arguments ("left-to-right") on the stack. |
| 2886 ZoneList<Expression*>* args = expr->arguments(); | 2886 ZoneList<Expression*>* args = expr->arguments(); |
| 2887 int arg_count = args->length(); | 2887 int arg_count = args->length(); |
| 2888 for (int i = 0; i < arg_count; i++) { | 2888 for (int i = 0; i < arg_count; i++) { |
| 2889 VisitForStackValue(args->at(i)); | 2889 VisitForStackValue(args->at(i)); |
| 2890 } | 2890 } |
| 2891 | 2891 |
| 2892 // Call the construct call builtin that handles allocation and | 2892 // Call the construct call builtin that handles allocation and |
| 2893 // constructor invocation. | 2893 // constructor invocation. |
| 2894 SetConstructCallPosition(expr, arg_count); | 2894 SetConstructCallPosition(expr); |
| 2895 | 2895 |
| 2896 // Load function and argument count into edi and eax. | 2896 // Load function and argument count into edi and eax. |
| 2897 __ Move(eax, Immediate(arg_count)); | 2897 __ Move(eax, Immediate(arg_count)); |
| 2898 __ mov(edi, Operand(esp, arg_count * kPointerSize)); | 2898 __ mov(edi, Operand(esp, arg_count * kPointerSize)); |
| 2899 | 2899 |
| 2900 // Record call targets in unoptimized code. | 2900 // Record call targets in unoptimized code. |
| 2901 __ EmitLoadTypeFeedbackVector(ebx); | 2901 __ EmitLoadTypeFeedbackVector(ebx); |
| 2902 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); | 2902 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); |
| 2903 | 2903 |
| 2904 Handle<Code> code = CodeFactory::ConstructIC(isolate()).code(); | 2904 Handle<Code> code = CodeFactory::ConstructIC(isolate()).code(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2920 | 2920 |
| 2921 // Push the arguments ("left-to-right") on the stack. | 2921 // Push the arguments ("left-to-right") on the stack. |
| 2922 ZoneList<Expression*>* args = expr->arguments(); | 2922 ZoneList<Expression*>* args = expr->arguments(); |
| 2923 int arg_count = args->length(); | 2923 int arg_count = args->length(); |
| 2924 for (int i = 0; i < arg_count; i++) { | 2924 for (int i = 0; i < arg_count; i++) { |
| 2925 VisitForStackValue(args->at(i)); | 2925 VisitForStackValue(args->at(i)); |
| 2926 } | 2926 } |
| 2927 | 2927 |
| 2928 // Call the construct call builtin that handles allocation and | 2928 // Call the construct call builtin that handles allocation and |
| 2929 // constructor invocation. | 2929 // constructor invocation. |
| 2930 SetConstructCallPosition(expr, arg_count); | 2930 SetConstructCallPosition(expr); |
| 2931 | 2931 |
| 2932 // Load new target into edx. | 2932 // Load new target into edx. |
| 2933 VisitForAccumulatorValue(super_call_ref->new_target_var()); | 2933 VisitForAccumulatorValue(super_call_ref->new_target_var()); |
| 2934 __ mov(edx, result_register()); | 2934 __ mov(edx, result_register()); |
| 2935 | 2935 |
| 2936 // Load function and argument count into edi and eax. | 2936 // Load function and argument count into edi and eax. |
| 2937 __ Move(eax, Immediate(arg_count)); | 2937 __ Move(eax, Immediate(arg_count)); |
| 2938 __ mov(edi, Operand(esp, arg_count * kPointerSize)); | 2938 __ mov(edi, Operand(esp, arg_count * kPointerSize)); |
| 2939 | 2939 |
| 2940 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 2940 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3627 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { | 3627 void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { |
| 3628 ZoneList<Expression*>* args = expr->arguments(); | 3628 ZoneList<Expression*>* args = expr->arguments(); |
| 3629 DCHECK(args->length() == 2); | 3629 DCHECK(args->length() == 2); |
| 3630 | 3630 |
| 3631 // Evaluate new.target and super constructor. | 3631 // Evaluate new.target and super constructor. |
| 3632 VisitForStackValue(args->at(0)); | 3632 VisitForStackValue(args->at(0)); |
| 3633 VisitForStackValue(args->at(1)); | 3633 VisitForStackValue(args->at(1)); |
| 3634 | 3634 |
| 3635 // Call the construct call builtin that handles allocation and | 3635 // Call the construct call builtin that handles allocation and |
| 3636 // constructor invocation. | 3636 // constructor invocation. |
| 3637 SetConstructCallPosition(expr, 0); | 3637 SetConstructCallPosition(expr); |
| 3638 | 3638 |
| 3639 // Check if the calling frame is an arguments adaptor frame. | 3639 // Check if the calling frame is an arguments adaptor frame. |
| 3640 Label adaptor_frame, args_set_up, runtime; | 3640 Label adaptor_frame, args_set_up, runtime; |
| 3641 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 3641 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 3642 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset)); | 3642 __ mov(ebx, Operand(edx, StandardFrameConstants::kContextOffset)); |
| 3643 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 3643 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 3644 __ j(equal, &adaptor_frame); | 3644 __ j(equal, &adaptor_frame); |
| 3645 // default constructor has no arguments, so no adaptor frame means no args. | 3645 // default constructor has no arguments, so no adaptor frame means no args. |
| 3646 __ mov(eax, Immediate(0)); | 3646 __ mov(eax, Immediate(0)); |
| 3647 __ jmp(&args_set_up); | 3647 __ jmp(&args_set_up); |
| (...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4833 Assembler::target_address_at(call_target_address, | 4833 Assembler::target_address_at(call_target_address, |
| 4834 unoptimized_code)); | 4834 unoptimized_code)); |
| 4835 return OSR_AFTER_STACK_CHECK; | 4835 return OSR_AFTER_STACK_CHECK; |
| 4836 } | 4836 } |
| 4837 | 4837 |
| 4838 | 4838 |
| 4839 } // namespace internal | 4839 } // namespace internal |
| 4840 } // namespace v8 | 4840 } // namespace v8 |
| 4841 | 4841 |
| 4842 #endif // V8_TARGET_ARCH_X87 | 4842 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |