| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 4678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4689 | 4689 |
| 4690 // Push the target function under the receiver. | 4690 // Push the target function under the receiver. |
| 4691 __ Push(Operand(rsp, 0)); | 4691 __ Push(Operand(rsp, 0)); |
| 4692 __ movp(Operand(rsp, kPointerSize), rax); | 4692 __ movp(Operand(rsp, kPointerSize), rax); |
| 4693 | 4693 |
| 4694 // Push the arguments ("left-to-right"). | 4694 // Push the arguments ("left-to-right"). |
| 4695 for (int i = 0; i < arg_count; i++) { | 4695 for (int i = 0; i < arg_count; i++) { |
| 4696 VisitForStackValue(args->at(i)); | 4696 VisitForStackValue(args->at(i)); |
| 4697 } | 4697 } |
| 4698 | 4698 |
| 4699 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
| 4699 EmitCallJSRuntimeFunction(expr); | 4700 EmitCallJSRuntimeFunction(expr); |
| 4700 | 4701 |
| 4701 // Restore context register. | 4702 // Restore context register. |
| 4702 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 4703 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
| 4703 context()->DropAndPlug(1, rax); | 4704 context()->DropAndPlug(1, rax); |
| 4704 | 4705 |
| 4705 } else { | 4706 } else { |
| 4706 const Runtime::Function* function = expr->function(); | 4707 const Runtime::Function* function = expr->function(); |
| 4707 switch (function->function_id) { | 4708 switch (function->function_id) { |
| 4708 #define CALL_INTRINSIC_GENERATOR(Name) \ | 4709 #define CALL_INTRINSIC_GENERATOR(Name) \ |
| 4709 case Runtime::kInline##Name: { \ | 4710 case Runtime::kInline##Name: { \ |
| 4710 Comment cmnt(masm_, "[ Inline" #Name); \ | 4711 Comment cmnt(masm_, "[ Inline" #Name); \ |
| 4711 return Emit##Name(expr); \ | 4712 return Emit##Name(expr); \ |
| 4712 } | 4713 } |
| 4713 FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR) | 4714 FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR) |
| 4714 #undef CALL_INTRINSIC_GENERATOR | 4715 #undef CALL_INTRINSIC_GENERATOR |
| 4715 default: { | 4716 default: { |
| 4716 Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic"); | 4717 Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic"); |
| 4717 // Push the arguments ("left-to-right"). | 4718 // Push the arguments ("left-to-right"). |
| 4718 for (int i = 0; i < arg_count; i++) { | 4719 for (int i = 0; i < arg_count; i++) { |
| 4719 VisitForStackValue(args->at(i)); | 4720 VisitForStackValue(args->at(i)); |
| 4720 } | 4721 } |
| 4721 | 4722 |
| 4722 // Call the C runtime. | 4723 // Call the C runtime. |
| 4724 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
| 4723 __ CallRuntime(function, arg_count); | 4725 __ CallRuntime(function, arg_count); |
| 4724 context()->Plug(rax); | 4726 context()->Plug(rax); |
| 4725 } | 4727 } |
| 4726 } | 4728 } |
| 4727 } | 4729 } |
| 4728 } | 4730 } |
| 4729 | 4731 |
| 4730 | 4732 |
| 4731 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 4733 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 4732 switch (expr->op()) { | 4734 switch (expr->op()) { |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5503 Assembler::target_address_at(call_target_address, | 5505 Assembler::target_address_at(call_target_address, |
| 5504 unoptimized_code)); | 5506 unoptimized_code)); |
| 5505 return OSR_AFTER_STACK_CHECK; | 5507 return OSR_AFTER_STACK_CHECK; |
| 5506 } | 5508 } |
| 5507 | 5509 |
| 5508 | 5510 |
| 5509 } // namespace internal | 5511 } // namespace internal |
| 5510 } // namespace v8 | 5512 } // namespace v8 |
| 5511 | 5513 |
| 5512 #endif // V8_TARGET_ARCH_X64 | 5514 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |