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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2888 | 2888 |
2889 // Load function and argument count into rdi and rax. | 2889 // Load function and argument count into rdi and rax. |
2890 __ Set(rax, arg_count); | 2890 __ Set(rax, arg_count); |
2891 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); | 2891 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); |
2892 | 2892 |
2893 // Record call targets in unoptimized code, but not in the snapshot. | 2893 // Record call targets in unoptimized code, but not in the snapshot. |
2894 __ EmitLoadTypeFeedbackVector(rbx); | 2894 __ EmitLoadTypeFeedbackVector(rbx); |
2895 __ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot())); | 2895 __ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot())); |
2896 | 2896 |
2897 CallConstructStub stub(isolate()); | 2897 CallConstructStub stub(isolate()); |
2898 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 2898 __ Call(stub.GetCode(), RelocInfo::CODE_TARGET); |
2899 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 2899 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
2900 // Restore context register. | 2900 // Restore context register. |
2901 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 2901 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
2902 context()->Plug(rax); | 2902 context()->Plug(rax); |
2903 } | 2903 } |
2904 | 2904 |
2905 | 2905 |
2906 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | 2906 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
2907 SuperCallReference* super_call_ref = | 2907 SuperCallReference* super_call_ref = |
2908 expr->expression()->AsSuperCallReference(); | 2908 expr->expression()->AsSuperCallReference(); |
(...skipping 14 matching lines...) Expand all Loading... |
2923 SetConstructCallPosition(expr, arg_count); | 2923 SetConstructCallPosition(expr, arg_count); |
2924 | 2924 |
2925 // Load new target into rdx. | 2925 // Load new target into rdx. |
2926 VisitForAccumulatorValue(super_call_ref->new_target_var()); | 2926 VisitForAccumulatorValue(super_call_ref->new_target_var()); |
2927 __ movp(rdx, result_register()); | 2927 __ movp(rdx, result_register()); |
2928 | 2928 |
2929 // Load function and argument count into rdi and rax. | 2929 // Load function and argument count into rdi and rax. |
2930 __ Set(rax, arg_count); | 2930 __ Set(rax, arg_count); |
2931 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); | 2931 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); |
2932 | 2932 |
2933 __ Call(isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | 2933 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
2934 | 2934 |
2935 RecordJSReturnSite(expr); | 2935 RecordJSReturnSite(expr); |
2936 | 2936 |
2937 // Restore context register. | 2937 // Restore context register. |
2938 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 2938 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
2939 | 2939 |
2940 context()->Plug(rax); | 2940 context()->Plug(rax); |
2941 } | 2941 } |
2942 | 2942 |
2943 | 2943 |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3688 __ bind(&loop); | 3688 __ bind(&loop); |
3689 __ Push(Operand(rdx, -1 * kPointerSize)); | 3689 __ Push(Operand(rdx, -1 * kPointerSize)); |
3690 __ subp(rdx, Immediate(kPointerSize)); | 3690 __ subp(rdx, Immediate(kPointerSize)); |
3691 __ decp(rbx); | 3691 __ decp(rbx); |
3692 __ j(not_zero, &loop); | 3692 __ j(not_zero, &loop); |
3693 } | 3693 } |
3694 | 3694 |
3695 __ bind(&args_set_up); | 3695 __ bind(&args_set_up); |
3696 __ movp(rdx, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize)); | 3696 __ movp(rdx, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize)); |
3697 __ movp(rdi, Operand(rsp, rax, times_pointer_size, 0 * kPointerSize)); | 3697 __ movp(rdi, Operand(rsp, rax, times_pointer_size, 0 * kPointerSize)); |
3698 __ Call(isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | 3698 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
3699 | 3699 |
3700 // Restore context register. | 3700 // Restore context register. |
3701 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 3701 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
3702 | 3702 |
3703 context()->DropAndPlug(1, rax); | 3703 context()->DropAndPlug(1, rax); |
3704 } | 3704 } |
3705 | 3705 |
3706 | 3706 |
3707 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | 3707 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { |
3708 ZoneList<Expression*>* args = expr->arguments(); | 3708 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4881 Assembler::target_address_at(call_target_address, | 4881 Assembler::target_address_at(call_target_address, |
4882 unoptimized_code)); | 4882 unoptimized_code)); |
4883 return OSR_AFTER_STACK_CHECK; | 4883 return OSR_AFTER_STACK_CHECK; |
4884 } | 4884 } |
4885 | 4885 |
4886 | 4886 |
4887 } // namespace internal | 4887 } // namespace internal |
4888 } // namespace v8 | 4888 } // namespace v8 |
4889 | 4889 |
4890 #endif // V8_TARGET_ARCH_X64 | 4890 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |