| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 | 690 |
| 691 // rcx must be used to pass the pointer to the return value slot. | 691 // rcx must be used to pass the pointer to the return value slot. |
| 692 lea(rcx, StackSpaceOperand(arg_stack_space)); | 692 lea(rcx, StackSpaceOperand(arg_stack_space)); |
| 693 #else | 693 #else |
| 694 EnterApiExitFrame(arg_stack_space); | 694 EnterApiExitFrame(arg_stack_space); |
| 695 #endif | 695 #endif |
| 696 } | 696 } |
| 697 | 697 |
| 698 | 698 |
| 699 void MacroAssembler::CallApiFunctionAndReturn(Address function_address, | 699 void MacroAssembler::CallApiFunctionAndReturn(Address function_address, |
| 700 Address thunk_address, | |
| 701 Register thunk_last_arg, | |
| 702 int stack_space, | 700 int stack_space, |
| 703 bool returns_handle, | 701 bool returns_handle, |
| 704 int return_value_offset) { | 702 int return_value_offset) { |
| 705 Label prologue; | 703 Label prologue; |
| 706 Label promote_scheduled_exception; | 704 Label promote_scheduled_exception; |
| 707 Label delete_allocated_handles; | 705 Label delete_allocated_handles; |
| 708 Label leave_exit_frame; | 706 Label leave_exit_frame; |
| 709 Label write_back; | 707 Label write_back; |
| 710 | 708 |
| 711 Factory* factory = isolate()->factory(); | 709 Factory* factory = isolate()->factory(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 732 | 730 |
| 733 if (FLAG_log_timer_events) { | 731 if (FLAG_log_timer_events) { |
| 734 FrameScope frame(this, StackFrame::MANUAL); | 732 FrameScope frame(this, StackFrame::MANUAL); |
| 735 PushSafepointRegisters(); | 733 PushSafepointRegisters(); |
| 736 PrepareCallCFunction(1); | 734 PrepareCallCFunction(1); |
| 737 LoadAddress(arg_reg_1, ExternalReference::isolate_address(isolate())); | 735 LoadAddress(arg_reg_1, ExternalReference::isolate_address(isolate())); |
| 738 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); | 736 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); |
| 739 PopSafepointRegisters(); | 737 PopSafepointRegisters(); |
| 740 } | 738 } |
| 741 | 739 |
| 742 | |
| 743 Label profiler_disabled; | |
| 744 Label end_profiler_check; | |
| 745 bool* is_profiling_flag = | |
| 746 isolate()->cpu_profiler()->is_profiling_address(); | |
| 747 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1); | |
| 748 movq(rax, is_profiling_flag, RelocInfo::EXTERNAL_REFERENCE); | |
| 749 cmpb(Operand(rax, 0), Immediate(0)); | |
| 750 j(zero, &profiler_disabled); | |
| 751 | |
| 752 // Third parameter is the address of the actual getter function. | |
| 753 movq(thunk_last_arg, function_address, RelocInfo::EXTERNAL_REFERENCE); | |
| 754 movq(rax, thunk_address, RelocInfo::EXTERNAL_REFERENCE); | |
| 755 jmp(&end_profiler_check); | |
| 756 | |
| 757 bind(&profiler_disabled); | |
| 758 // Call the api function! | 740 // Call the api function! |
| 759 movq(rax, reinterpret_cast<int64_t>(function_address), | 741 movq(rax, reinterpret_cast<int64_t>(function_address), |
| 760 RelocInfo::EXTERNAL_REFERENCE); | 742 RelocInfo::EXTERNAL_REFERENCE); |
| 761 | |
| 762 bind(&end_profiler_check); | |
| 763 | |
| 764 // Call the api function! | |
| 765 call(rax); | 743 call(rax); |
| 766 | 744 |
| 767 if (FLAG_log_timer_events) { | 745 if (FLAG_log_timer_events) { |
| 768 FrameScope frame(this, StackFrame::MANUAL); | 746 FrameScope frame(this, StackFrame::MANUAL); |
| 769 PushSafepointRegisters(); | 747 PushSafepointRegisters(); |
| 770 PrepareCallCFunction(1); | 748 PrepareCallCFunction(1); |
| 771 LoadAddress(arg_reg_1, ExternalReference::isolate_address(isolate())); | 749 LoadAddress(arg_reg_1, ExternalReference::isolate_address(isolate())); |
| 772 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); | 750 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); |
| 773 PopSafepointRegisters(); | 751 PopSafepointRegisters(); |
| 774 } | 752 } |
| (...skipping 3925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4700 j(greater, &no_info_available); | 4678 j(greater, &no_info_available); |
| 4701 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 4679 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
| 4702 Heap::kAllocationSiteInfoMapRootIndex); | 4680 Heap::kAllocationSiteInfoMapRootIndex); |
| 4703 bind(&no_info_available); | 4681 bind(&no_info_available); |
| 4704 } | 4682 } |
| 4705 | 4683 |
| 4706 | 4684 |
| 4707 } } // namespace v8::internal | 4685 } } // namespace v8::internal |
| 4708 | 4686 |
| 4709 #endif // V8_TARGET_ARCH_X64 | 4687 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |