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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 } | 2271 } |
2272 // Update profiling counters before the tail call since we will | 2272 // Update profiling counters before the tail call since we will |
2273 // not return to this function. | 2273 // not return to this function. |
2274 EmitProfilingCounterHandlingForReturnSequence(true); | 2274 EmitProfilingCounterHandlingForReturnSequence(true); |
2275 } | 2275 } |
2276 Handle<Code> code = | 2276 Handle<Code> code = |
2277 CodeFactory::CallIC(isolate(), mode, expr->tail_call_mode()).code(); | 2277 CodeFactory::CallIC(isolate(), mode, expr->tail_call_mode()).code(); |
2278 __ Move(rdx, SmiFromSlot(expr->CallFeedbackICSlot())); | 2278 __ Move(rdx, SmiFromSlot(expr->CallFeedbackICSlot())); |
2279 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize)); | 2279 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize)); |
2280 __ Set(rax, arg_count); | 2280 __ Set(rax, arg_count); |
2281 __ call(code, RelocInfo::CODE_TARGET); | 2281 CallIC(code); |
2282 OperandStackDepthDecrement(arg_count + 1); | 2282 OperandStackDepthDecrement(arg_count + 1); |
2283 | 2283 |
2284 RecordJSReturnSite(expr); | 2284 RecordJSReturnSite(expr); |
2285 RestoreContext(); | 2285 RestoreContext(); |
2286 // Discard the function left on TOS. | 2286 // Discard the function left on TOS. |
2287 context()->DropAndPlug(1, rax); | 2287 context()->DropAndPlug(1, rax); |
2288 } | 2288 } |
2289 | 2289 |
2290 void FullCodeGenerator::EmitResolvePossiblyDirectEval(Call* expr) { | 2290 void FullCodeGenerator::EmitResolvePossiblyDirectEval(Call* expr) { |
2291 int arg_count = expr->arguments()->length(); | 2291 int arg_count = expr->arguments()->length(); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2417 | 2417 |
2418 // Load function and argument count into rdi and rax. | 2418 // Load function and argument count into rdi and rax. |
2419 __ Set(rax, arg_count); | 2419 __ Set(rax, arg_count); |
2420 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); | 2420 __ movp(rdi, Operand(rsp, arg_count * kPointerSize)); |
2421 | 2421 |
2422 // Record call targets in unoptimized code, but not in the snapshot. | 2422 // Record call targets in unoptimized code, but not in the snapshot. |
2423 __ EmitLoadTypeFeedbackVector(rbx); | 2423 __ EmitLoadTypeFeedbackVector(rbx); |
2424 __ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot())); | 2424 __ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot())); |
2425 | 2425 |
2426 CallConstructStub stub(isolate()); | 2426 CallConstructStub stub(isolate()); |
2427 __ Call(stub.GetCode(), RelocInfo::CODE_TARGET); | 2427 CallIC(stub.GetCode()); |
2428 OperandStackDepthDecrement(arg_count + 1); | 2428 OperandStackDepthDecrement(arg_count + 1); |
2429 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); | 2429 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); |
2430 RestoreContext(); | 2430 RestoreContext(); |
2431 context()->Plug(rax); | 2431 context()->Plug(rax); |
2432 } | 2432 } |
2433 | 2433 |
2434 | 2434 |
2435 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | 2435 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
2436 SuperCallReference* super_call_ref = | 2436 SuperCallReference* super_call_ref = |
2437 expr->expression()->AsSuperCallReference(); | 2437 expr->expression()->AsSuperCallReference(); |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3516 DCHECK_EQ( | 3516 DCHECK_EQ( |
3517 isolate->builtins()->OnStackReplacement()->entry(), | 3517 isolate->builtins()->OnStackReplacement()->entry(), |
3518 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3518 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3519 return ON_STACK_REPLACEMENT; | 3519 return ON_STACK_REPLACEMENT; |
3520 } | 3520 } |
3521 | 3521 |
3522 } // namespace internal | 3522 } // namespace internal |
3523 } // namespace v8 | 3523 } // namespace v8 |
3524 | 3524 |
3525 #endif // V8_TARGET_ARCH_X64 | 3525 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |