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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 // of parameters. | 809 // of parameters. |
810 void TailCallExternalReference(const ExternalReference& ext, | 810 void TailCallExternalReference(const ExternalReference& ext, |
811 int num_arguments, | 811 int num_arguments, |
812 int result_size); | 812 int result_size); |
813 | 813 |
814 // Convenience function: tail call a runtime routine (jump). | 814 // Convenience function: tail call a runtime routine (jump). |
815 void TailCallRuntime(Runtime::FunctionId fid, | 815 void TailCallRuntime(Runtime::FunctionId fid, |
816 int num_arguments, | 816 int num_arguments, |
817 int result_size); | 817 int result_size); |
818 | 818 |
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. | 819 // Jump to a runtime routine. |
830 void JumpToExternalReference(const ExternalReference& ext, int result_size); | 820 void JumpToExternalReference(const ExternalReference& ext, int result_size); |
831 | 821 |
| 822 // Prepares stack to put arguments (aligns and so on). |
| 823 // Uses calle-saved esi to restore stack state after call. |
| 824 void PrepareCallApiFunction(int stack_space); |
| 825 |
| 826 // Tail call an API function (jump). Allocates HandleScope, extracts |
| 827 // returned value from handle and propogates exceptions. |
| 828 // Clobbers ebx, edi and caller-save registers. |
| 829 void CallApiFunctionAndReturn(ApiFunction* function); |
| 830 |
832 // Before calling a C-function from generated code, align arguments on stack. | 831 // 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], | 832 // 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. | 833 // 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 | 834 // 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 | 835 // stack slots are reserved for the arguments passed in registers. On other |
837 // platforms stack slots are only reserved for the arguments actually passed | 836 // platforms stack slots are only reserved for the arguments actually passed |
838 // on the stack. | 837 // on the stack. |
839 void PrepareCallCFunction(int num_arguments); | 838 void PrepareCallCFunction(int num_arguments); |
840 | 839 |
841 // Calls a C function and cleans up the space for arguments allocated | 840 // 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); | 1689 Jump(adaptor, RelocInfo::CODE_TARGET); |
1691 } | 1690 } |
1692 bind(&invoke); | 1691 bind(&invoke); |
1693 } | 1692 } |
1694 } | 1693 } |
1695 | 1694 |
1696 | 1695 |
1697 } } // namespace v8::internal | 1696 } } // namespace v8::internal |
1698 | 1697 |
1699 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1698 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |