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 2252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2263 PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); | 2263 PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); |
2264 SetCallPosition(expr, expr->tail_call_mode()); | 2264 SetCallPosition(expr, expr->tail_call_mode()); |
2265 if (expr->tail_call_mode() == TailCallMode::kAllow) { | 2265 if (expr->tail_call_mode() == TailCallMode::kAllow) { |
2266 if (FLAG_trace) { | 2266 if (FLAG_trace) { |
2267 __ CallRuntime(Runtime::kTraceTailCall); | 2267 __ CallRuntime(Runtime::kTraceTailCall); |
2268 } | 2268 } |
2269 // Update profiling counters before the tail call since we will | 2269 // Update profiling counters before the tail call since we will |
2270 // not return to this function. | 2270 // not return to this function. |
2271 EmitProfilingCounterHandlingForReturnSequence(true); | 2271 EmitProfilingCounterHandlingForReturnSequence(true); |
2272 } | 2272 } |
2273 Handle<Code> ic = | 2273 Handle<Code> code = |
2274 CodeFactory::CallIC(isolate(), arg_count, mode, expr->tail_call_mode()) | 2274 CodeFactory::CallIC(isolate(), arg_count, mode, expr->tail_call_mode()) |
2275 .code(); | 2275 .code(); |
2276 __ Move(rdx, SmiFromSlot(expr->CallFeedbackICSlot())); | 2276 __ Move(rdx, SmiFromSlot(expr->CallFeedbackICSlot())); |
2277 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize)); | 2277 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize)); |
2278 // Don't assign a type feedback id to the IC, since type feedback is provided | 2278 __ call(code, RelocInfo::CODE_TARGET); |
2279 // by the vector above. | |
2280 CallIC(ic); | |
2281 OperandStackDepthDecrement(arg_count + 1); | 2279 OperandStackDepthDecrement(arg_count + 1); |
2282 | 2280 |
2283 RecordJSReturnSite(expr); | 2281 RecordJSReturnSite(expr); |
2284 RestoreContext(); | 2282 RestoreContext(); |
2285 // Discard the function left on TOS. | 2283 // Discard the function left on TOS. |
2286 context()->DropAndPlug(1, rax); | 2284 context()->DropAndPlug(1, rax); |
2287 } | 2285 } |
2288 | 2286 |
2289 void FullCodeGenerator::EmitResolvePossiblyDirectEval(Call* expr) { | 2287 void FullCodeGenerator::EmitResolvePossiblyDirectEval(Call* expr) { |
2290 int arg_count = expr->arguments()->length(); | 2288 int arg_count = expr->arguments()->length(); |
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3550 DCHECK_EQ( | 3548 DCHECK_EQ( |
3551 isolate->builtins()->OnStackReplacement()->entry(), | 3549 isolate->builtins()->OnStackReplacement()->entry(), |
3552 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3550 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3553 return ON_STACK_REPLACEMENT; | 3551 return ON_STACK_REPLACEMENT; |
3554 } | 3552 } |
3555 | 3553 |
3556 } // namespace internal | 3554 } // namespace internal |
3557 } // namespace v8 | 3555 } // namespace v8 |
3558 | 3556 |
3559 #endif // V8_TARGET_ARCH_X64 | 3557 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |