| 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_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 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 4637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4648 | 4648 |
| 4649 // Push the target function under the receiver. | 4649 // Push the target function under the receiver. |
| 4650 __ push(Operand(esp, 0)); | 4650 __ push(Operand(esp, 0)); |
| 4651 __ mov(Operand(esp, kPointerSize), eax); | 4651 __ mov(Operand(esp, kPointerSize), eax); |
| 4652 | 4652 |
| 4653 // Push the arguments ("left-to-right"). | 4653 // Push the arguments ("left-to-right"). |
| 4654 for (int i = 0; i < arg_count; i++) { | 4654 for (int i = 0; i < arg_count; i++) { |
| 4655 VisitForStackValue(args->at(i)); | 4655 VisitForStackValue(args->at(i)); |
| 4656 } | 4656 } |
| 4657 | 4657 |
| 4658 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
| 4658 EmitCallJSRuntimeFunction(expr); | 4659 EmitCallJSRuntimeFunction(expr); |
| 4659 | 4660 |
| 4660 // Restore context register. | 4661 // Restore context register. |
| 4661 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 4662 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 4662 context()->DropAndPlug(1, eax); | 4663 context()->DropAndPlug(1, eax); |
| 4663 | 4664 |
| 4664 } else { | 4665 } else { |
| 4665 const Runtime::Function* function = expr->function(); | 4666 const Runtime::Function* function = expr->function(); |
| 4666 switch (function->function_id) { | 4667 switch (function->function_id) { |
| 4667 #define CALL_INTRINSIC_GENERATOR(Name) \ | 4668 #define CALL_INTRINSIC_GENERATOR(Name) \ |
| 4668 case Runtime::kInline##Name: { \ | 4669 case Runtime::kInline##Name: { \ |
| 4669 Comment cmnt(masm_, "[ Inline" #Name); \ | 4670 Comment cmnt(masm_, "[ Inline" #Name); \ |
| 4670 return Emit##Name(expr); \ | 4671 return Emit##Name(expr); \ |
| 4671 } | 4672 } |
| 4672 FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR) | 4673 FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR) |
| 4673 #undef CALL_INTRINSIC_GENERATOR | 4674 #undef CALL_INTRINSIC_GENERATOR |
| 4674 default: { | 4675 default: { |
| 4675 Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic"); | 4676 Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic"); |
| 4676 // Push the arguments ("left-to-right"). | 4677 // Push the arguments ("left-to-right"). |
| 4677 for (int i = 0; i < arg_count; i++) { | 4678 for (int i = 0; i < arg_count; i++) { |
| 4678 VisitForStackValue(args->at(i)); | 4679 VisitForStackValue(args->at(i)); |
| 4679 } | 4680 } |
| 4680 | 4681 |
| 4681 // Call the C runtime function. | 4682 // Call the C runtime function. |
| 4683 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
| 4682 __ CallRuntime(expr->function(), arg_count); | 4684 __ CallRuntime(expr->function(), arg_count); |
| 4683 context()->Plug(eax); | 4685 context()->Plug(eax); |
| 4684 } | 4686 } |
| 4685 } | 4687 } |
| 4686 } | 4688 } |
| 4687 } | 4689 } |
| 4688 | 4690 |
| 4689 | 4691 |
| 4690 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 4692 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 4691 switch (expr->op()) { | 4693 switch (expr->op()) { |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5465 Assembler::target_address_at(call_target_address, | 5467 Assembler::target_address_at(call_target_address, |
| 5466 unoptimized_code)); | 5468 unoptimized_code)); |
| 5467 return OSR_AFTER_STACK_CHECK; | 5469 return OSR_AFTER_STACK_CHECK; |
| 5468 } | 5470 } |
| 5469 | 5471 |
| 5470 | 5472 |
| 5471 } // namespace internal | 5473 } // namespace internal |
| 5472 } // namespace v8 | 5474 } // namespace v8 |
| 5473 | 5475 |
| 5474 #endif // V8_TARGET_ARCH_X87 | 5476 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |