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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 | 766 |
767 // --------------------------------------------------------------------------- | 767 // --------------------------------------------------------------------------- |
768 // Runtime calls | 768 // Runtime calls |
769 | 769 |
770 // Call a code stub. | 770 // Call a code stub. |
771 void CallStub(CodeStub* stub); | 771 void CallStub(CodeStub* stub); |
772 | 772 |
773 // Call a code stub and return the code object called. Try to generate | 773 // Call a code stub and return the code object called. Try to generate |
774 // the code if necessary. Do not perform a GC but instead return a retry | 774 // the code if necessary. Do not perform a GC but instead return a retry |
775 // after GC failure. | 775 // after GC failure. |
776 Object* TryCallStub(CodeStub* stub); | 776 MUST_USE_RESULT MaybeObject* TryCallStub(CodeStub* stub); |
777 | 777 |
778 // Tail call a code stub (jump). | 778 // Tail call a code stub (jump). |
779 void TailCallStub(CodeStub* stub); | 779 void TailCallStub(CodeStub* stub); |
780 | 780 |
781 // Tail call a code stub (jump) and return the code object called. Try to | 781 // Tail call a code stub (jump) and return the code object called. Try to |
782 // generate the code if necessary. Do not perform a GC but instead return | 782 // generate the code if necessary. Do not perform a GC but instead return |
783 // a retry after GC failure. | 783 // a retry after GC failure. |
784 Object* TryTailCallStub(CodeStub* stub); | 784 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub); |
785 | 785 |
786 // Return from a code stub after popping its arguments. | 786 // Return from a code stub after popping its arguments. |
787 void StubReturn(int argc); | 787 void StubReturn(int argc); |
788 | 788 |
789 // Call a runtime routine. | 789 // Call a runtime routine. |
790 void CallRuntime(Runtime::Function* f, int num_arguments); | 790 void CallRuntime(Runtime::Function* f, int num_arguments); |
791 | 791 |
792 // Call a runtime function, returning the CodeStub object called. | 792 // Call a runtime function, returning the CodeStub object called. |
793 // Try to generate the stub code if necessary. Do not perform a GC | 793 // Try to generate the stub code if necessary. Do not perform a GC |
794 // but instead return a retry after GC failure. | 794 // but instead return a retry after GC failure. |
795 Object* TryCallRuntime(Runtime::Function* f, int num_arguments); | 795 MUST_USE_RESULT MaybeObject* TryCallRuntime(Runtime::Function* f, |
| 796 int num_arguments); |
796 | 797 |
797 // Convenience function: Same as above, but takes the fid instead. | 798 // Convenience function: Same as above, but takes the fid instead. |
798 void CallRuntime(Runtime::FunctionId id, int num_arguments); | 799 void CallRuntime(Runtime::FunctionId id, int num_arguments); |
799 | 800 |
800 // Convenience function: Same as above, but takes the fid instead. | 801 // Convenience function: Same as above, but takes the fid instead. |
801 Object* TryCallRuntime(Runtime::FunctionId id, int num_arguments); | 802 MUST_USE_RESULT MaybeObject* TryCallRuntime(Runtime::FunctionId id, |
| 803 int num_arguments); |
802 | 804 |
803 // Convenience function: call an external reference. | 805 // Convenience function: call an external reference. |
804 void CallExternalReference(const ExternalReference& ext, | 806 void CallExternalReference(const ExternalReference& ext, |
805 int num_arguments); | 807 int num_arguments); |
806 | 808 |
807 // Tail call of a runtime routine (jump). | 809 // Tail call of a runtime routine (jump). |
808 // Like JumpToExternalReference, but also takes care of passing the number | 810 // Like JumpToExternalReference, but also takes care of passing the number |
809 // of parameters. | 811 // of parameters. |
810 void TailCallExternalReference(const ExternalReference& ext, | 812 void TailCallExternalReference(const ExternalReference& ext, |
811 int num_arguments, | 813 int num_arguments, |
812 int result_size); | 814 int result_size); |
813 | 815 |
814 // Convenience function: tail call a runtime routine (jump). | 816 // Convenience function: tail call a runtime routine (jump). |
815 void TailCallRuntime(Runtime::FunctionId fid, | 817 void TailCallRuntime(Runtime::FunctionId fid, |
816 int num_arguments, | 818 int num_arguments, |
817 int result_size); | 819 int result_size); |
818 | 820 |
819 void PushHandleScope(Register scratch); | |
820 | |
821 // Pops a handle scope using the specified scratch register and | |
822 // ensuring that saved register is left unchanged. | |
823 void PopHandleScope(Register saved, Register scratch); | |
824 | |
825 // As PopHandleScope, but does not perform a GC. Instead, returns a | |
826 // retry after GC failure object if GC is necessary. | |
827 Object* TryPopHandleScope(Register saved, Register scratch); | |
828 | |
829 // Jump to a runtime routine. | 821 // Jump to a runtime routine. |
830 void JumpToExternalReference(const ExternalReference& ext, int result_size); | 822 void JumpToExternalReference(const ExternalReference& ext, int result_size); |
831 | 823 |
| 824 // Prepares stack to put arguments (aligns and so on). |
| 825 // Uses calle-saved esi to restore stack state after call. |
| 826 void PrepareCallApiFunction(int stack_space); |
| 827 |
| 828 // Tail call an API function (jump). Allocates HandleScope, extracts |
| 829 // returned value from handle and propogates exceptions. |
| 830 // Clobbers ebx, edi and caller-save registers. |
| 831 void CallApiFunctionAndReturn(ApiFunction* function); |
| 832 |
832 // Before calling a C-function from generated code, align arguments on stack. | 833 // Before calling a C-function from generated code, align arguments on stack. |
833 // After aligning the frame, arguments must be stored in esp[0], esp[4], | 834 // After aligning the frame, arguments must be stored in esp[0], esp[4], |
834 // etc., not pushed. The argument count assumes all arguments are word sized. | 835 // etc., not pushed. The argument count assumes all arguments are word sized. |
835 // The number of slots reserved for arguments depends on platform. On Windows | 836 // The number of slots reserved for arguments depends on platform. On Windows |
836 // stack slots are reserved for the arguments passed in registers. On other | 837 // stack slots are reserved for the arguments passed in registers. On other |
837 // platforms stack slots are only reserved for the arguments actually passed | 838 // platforms stack slots are only reserved for the arguments actually passed |
838 // on the stack. | 839 // on the stack. |
839 void PrepareCallCFunction(int num_arguments); | 840 void PrepareCallCFunction(int num_arguments); |
840 | 841 |
841 // Calls a C function and cleans up the space for arguments allocated | 842 // Calls a C function and cleans up the space for arguments allocated |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 Jump(adaptor, RelocInfo::CODE_TARGET); | 1691 Jump(adaptor, RelocInfo::CODE_TARGET); |
1691 } | 1692 } |
1692 bind(&invoke); | 1693 bind(&invoke); |
1693 } | 1694 } |
1694 } | 1695 } |
1695 | 1696 |
1696 | 1697 |
1697 } } // namespace v8::internal | 1698 } } // namespace v8::internal |
1698 | 1699 |
1699 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1700 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |