OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 void CallExternalReference(const ExternalReference& ext, | 806 void CallExternalReference(const ExternalReference& ext, |
807 int num_arguments); | 807 int num_arguments); |
808 | 808 |
809 // Tail call of a runtime routine (jump). | 809 // Tail call of a runtime routine (jump). |
810 // Like JumpToExternalReference, but also takes care of passing the number | 810 // Like JumpToExternalReference, but also takes care of passing the number |
811 // of parameters. | 811 // of parameters. |
812 void TailCallExternalReference(const ExternalReference& ext, | 812 void TailCallExternalReference(const ExternalReference& ext, |
813 int num_arguments, | 813 int num_arguments, |
814 int result_size); | 814 int result_size); |
815 | 815 |
| 816 MUST_USE_RESULT MaybeObject* TryTailCallExternalReference( |
| 817 const ExternalReference& ext, int num_arguments, int result_size); |
| 818 |
816 // Convenience function: tail call a runtime routine (jump). | 819 // Convenience function: tail call a runtime routine (jump). |
817 void TailCallRuntime(Runtime::FunctionId fid, | 820 void TailCallRuntime(Runtime::FunctionId fid, |
818 int num_arguments, | 821 int num_arguments, |
819 int result_size); | 822 int result_size); |
820 | 823 |
| 824 MUST_USE_RESULT MaybeObject* TryTailCallRuntime(Runtime::FunctionId fid, |
| 825 int num_arguments, |
| 826 int result_size); |
| 827 |
821 // Jump to a runtime routine. | 828 // Jump to a runtime routine. |
822 void JumpToExternalReference(const ExternalReference& ext, int result_size); | 829 void JumpToExternalReference(const ExternalReference& ext, int result_size); |
823 | 830 |
| 831 // Jump to a runtime routine. |
| 832 MaybeObject* TryJumpToExternalReference(const ExternalReference& ext, |
| 833 int result_size); |
| 834 |
824 // Prepares stack to put arguments (aligns and so on). | 835 // Prepares stack to put arguments (aligns and so on). |
825 // Uses calle-saved esi to restore stack state after call. | 836 // Uses callee-saved rsi to restore stack state after call. WIN64 calling |
826 void PrepareCallApiFunction(int stack_space); | 837 // convention requires the pointer to the return value slot into rcx |
| 838 // (rcx must be preserverd until TryCallApiFunctionAndReturn). argc is number |
| 839 // of arguments to be passed in C-function. stack_space * kPointerSize bytes |
| 840 // will be removed from stack after the call. Saves context (rsi). |
| 841 void PrepareCallApiFunction(int stack_space, int argc); |
827 | 842 |
828 // Tail call an API function (jump). Allocates HandleScope, extracts | 843 // Calls an API function. Allocates HandleScope, extracts |
829 // returned value from handle and propogates exceptions. | 844 // returned value from handle and propagates exceptions. |
830 // Clobbers ebx, edi and caller-save registers. | 845 // Clobbers r12, r14, rbx and caller-save registers. Restores context. |
831 void CallApiFunctionAndReturn(ApiFunction* function); | 846 MUST_USE_RESULT MaybeObject* TryCallApiFunctionAndReturn( |
| 847 ApiFunction* function); |
832 | 848 |
833 // Before calling a C-function from generated code, align arguments on stack. | 849 // Before calling a C-function from generated code, align arguments on stack. |
834 // After aligning the frame, arguments must be stored in esp[0], esp[4], | 850 // After aligning the frame, arguments must be stored in esp[0], esp[4], |
835 // etc., not pushed. The argument count assumes all arguments are word sized. | 851 // etc., not pushed. The argument count assumes all arguments are word sized. |
836 // The number of slots reserved for arguments depends on platform. On Windows | 852 // The number of slots reserved for arguments depends on platform. On Windows |
837 // stack slots are reserved for the arguments passed in registers. On other | 853 // stack slots are reserved for the arguments passed in registers. On other |
838 // platforms stack slots are only reserved for the arguments actually passed | 854 // platforms stack slots are only reserved for the arguments actually passed |
839 // on the stack. | 855 // on the stack. |
840 void PrepareCallCFunction(int num_arguments); | 856 void PrepareCallCFunction(int num_arguments); |
841 | 857 |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 Jump(adaptor, RelocInfo::CODE_TARGET); | 1718 Jump(adaptor, RelocInfo::CODE_TARGET); |
1703 } | 1719 } |
1704 bind(&invoke); | 1720 bind(&invoke); |
1705 } | 1721 } |
1706 } | 1722 } |
1707 | 1723 |
1708 | 1724 |
1709 } } // namespace v8::internal | 1725 } } // namespace v8::internal |
1710 | 1726 |
1711 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1727 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |