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/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/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 3090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3101 | 3101 |
3102 // Call the construct call builtin that handles allocation and | 3102 // Call the construct call builtin that handles allocation and |
3103 // constructor invocation. | 3103 // constructor invocation. |
3104 SetConstructCallPosition(expr); | 3104 SetConstructCallPosition(expr); |
3105 | 3105 |
3106 // Load function and argument count into rdi and rax. | 3106 // Load function and argument count into rdi and rax. |
3107 __ Set(rax, arg_count); | 3107 __ Set(rax, arg_count); |
3108 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); | 3108 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); |
3109 | 3109 |
3110 // Record call targets in unoptimized code, but not in the snapshot. | 3110 // Record call targets in unoptimized code, but not in the snapshot. |
3111 if (FLAG_pretenuring_call_new) { | |
3112 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); | |
3113 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == | |
3114 expr->CallNewFeedbackSlot().ToInt() + 1); | |
3115 } | |
3116 | |
3117 __ Move(rbx, FeedbackVector()); | 3111 __ Move(rbx, FeedbackVector()); |
3118 __ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot())); | 3112 __ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot())); |
3119 | 3113 |
3120 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3114 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
3121 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3115 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3122 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3116 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
3123 // Restore context register. | 3117 // Restore context register. |
3124 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 3118 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
3125 context()->Plug(rax); | 3119 context()->Plug(rax); |
3126 } | 3120 } |
(...skipping 20 matching lines...) Expand all Loading... |
3147 | 3141 |
3148 // Load original constructor into rcx. | 3142 // Load original constructor into rcx. |
3149 VisitForAccumulatorValue(super_call_ref->new_target_var()); | 3143 VisitForAccumulatorValue(super_call_ref->new_target_var()); |
3150 __ movp(rcx, result_register()); | 3144 __ movp(rcx, result_register()); |
3151 | 3145 |
3152 // Load function and argument count into rdi and rax. | 3146 // Load function and argument count into rdi and rax. |
3153 __ Set(rax, arg_count); | 3147 __ Set(rax, arg_count); |
3154 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); | 3148 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); |
3155 | 3149 |
3156 // Record call targets in unoptimized code. | 3150 // Record call targets in unoptimized code. |
3157 if (FLAG_pretenuring_call_new) { | |
3158 UNREACHABLE(); | |
3159 /* TODO(dslomov): support pretenuring. | |
3160 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); | |
3161 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == | |
3162 expr->CallNewFeedbackSlot().ToInt() + 1); | |
3163 */ | |
3164 } | |
3165 | |
3166 __ Move(rbx, FeedbackVector()); | 3151 __ Move(rbx, FeedbackVector()); |
3167 __ Move(rdx, SmiFromSlot(expr->CallFeedbackSlot())); | 3152 __ Move(rdx, SmiFromSlot(expr->CallFeedbackSlot())); |
3168 | 3153 |
3169 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); | 3154 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); |
3170 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3155 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3171 | 3156 |
3172 RecordJSReturnSite(expr); | 3157 RecordJSReturnSite(expr); |
3173 | 3158 |
3174 // Restore context register. | 3159 // Restore context register. |
3175 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 3160 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
(...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5204 Assembler::target_address_at(call_target_address, | 5189 Assembler::target_address_at(call_target_address, |
5205 unoptimized_code)); | 5190 unoptimized_code)); |
5206 return OSR_AFTER_STACK_CHECK; | 5191 return OSR_AFTER_STACK_CHECK; |
5207 } | 5192 } |
5208 | 5193 |
5209 | 5194 |
5210 } // namespace internal | 5195 } // namespace internal |
5211 } // namespace v8 | 5196 } // namespace v8 |
5212 | 5197 |
5213 #endif // V8_TARGET_ARCH_X64 | 5198 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |