OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 // Call a code stub. | 701 // Call a code stub. |
702 void TailCallStub(CodeStub* stub, Condition cond = al); | 702 void TailCallStub(CodeStub* stub, Condition cond = al); |
703 | 703 |
704 // Tail call a code stub (jump) and return the code object called. Try to | 704 // Tail call a code stub (jump) and return the code object called. Try to |
705 // generate the code if necessary. Do not perform a GC but instead return | 705 // generate the code if necessary. Do not perform a GC but instead return |
706 // a retry after GC failure. | 706 // a retry after GC failure. |
707 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub, | 707 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub, |
708 Condition cond = al); | 708 Condition cond = al); |
709 | 709 |
710 // Call a runtime routine. | 710 // Call a runtime routine. |
711 void CallRuntime(Runtime::Function* f, int num_arguments); | 711 void CallRuntime(const Runtime::Function* f, int num_arguments); |
712 void CallRuntimeSaveDoubles(Runtime::FunctionId id); | 712 void CallRuntimeSaveDoubles(Runtime::FunctionId id); |
713 | 713 |
714 // Convenience function: Same as above, but takes the fid instead. | 714 // Convenience function: Same as above, but takes the fid instead. |
715 void CallRuntime(Runtime::FunctionId fid, int num_arguments); | 715 void CallRuntime(Runtime::FunctionId fid, int num_arguments); |
716 | 716 |
717 // Convenience function: call an external reference. | 717 // Convenience function: call an external reference. |
718 void CallExternalReference(const ExternalReference& ext, | 718 void CallExternalReference(const ExternalReference& ext, |
719 int num_arguments); | 719 int num_arguments); |
720 | 720 |
721 // Tail call of a runtime routine (jump). | 721 // Tail call of a runtime routine (jump). |
(...skipping 23 matching lines...) Expand all Loading... |
745 // Needs a scratch register to do some arithmetic. This register will be | 745 // Needs a scratch register to do some arithmetic. This register will be |
746 // trashed. | 746 // trashed. |
747 void PrepareCallCFunction(int num_arguments, Register scratch); | 747 void PrepareCallCFunction(int num_arguments, Register scratch); |
748 | 748 |
749 // Calls a C function and cleans up the space for arguments allocated | 749 // Calls a C function and cleans up the space for arguments allocated |
750 // by PrepareCallCFunction. The called function is not allowed to trigger a | 750 // by PrepareCallCFunction. The called function is not allowed to trigger a |
751 // garbage collection, since that might move the code and invalidate the | 751 // garbage collection, since that might move the code and invalidate the |
752 // return address (unless this is somehow accounted for by the called | 752 // return address (unless this is somehow accounted for by the called |
753 // function). | 753 // function). |
754 void CallCFunction(ExternalReference function, int num_arguments); | 754 void CallCFunction(ExternalReference function, int num_arguments); |
755 void CallCFunction(Register function, int num_arguments); | 755 void CallCFunction(Register function, Register scratch, int num_arguments); |
756 | 756 |
757 void GetCFunctionDoubleResult(const DoubleRegister dst); | 757 void GetCFunctionDoubleResult(const DoubleRegister dst); |
758 | 758 |
759 // Calls an API function. Allocates HandleScope, extracts returned value | 759 // Calls an API function. Allocates HandleScope, extracts returned value |
760 // from handle and propagates exceptions. Restores context. | 760 // from handle and propagates exceptions. Restores context. |
761 // stack_space - space to be unwound on exit (includes the call js | 761 // stack_space - space to be unwound on exit (includes the call js |
762 // arguments space and the additional space allocated for the fast call). | 762 // arguments space and the additional space allocated for the fast call). |
763 MaybeObject* TryCallApiFunctionAndReturn(ExternalReference function, | 763 MaybeObject* TryCallApiFunctionAndReturn(ExternalReference function, |
764 int stack_space); | 764 int stack_space); |
765 | 765 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 // --------------------------------------------------------------------------- | 927 // --------------------------------------------------------------------------- |
928 // Patching helpers. | 928 // Patching helpers. |
929 | 929 |
930 // Get the location of a relocated constant (its address in the constant pool) | 930 // Get the location of a relocated constant (its address in the constant pool) |
931 // from its load site. | 931 // from its load site. |
932 void GetRelocatedValueLocation(Register ldr_location, | 932 void GetRelocatedValueLocation(Register ldr_location, |
933 Register result); | 933 Register result); |
934 | 934 |
935 | 935 |
936 private: | 936 private: |
| 937 void CallCFunctionHelper(Register function, |
| 938 ExternalReference function_reference, |
| 939 Register scratch, |
| 940 int num_arguments); |
| 941 |
937 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); | 942 void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); |
938 int CallSize(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); | 943 int CallSize(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); |
939 void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); | 944 void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); |
940 | 945 |
941 // Helper functions for generating invokes. | 946 // Helper functions for generating invokes. |
942 void InvokePrologue(const ParameterCount& expected, | 947 void InvokePrologue(const ParameterCount& expected, |
943 const ParameterCount& actual, | 948 const ParameterCount& actual, |
944 Handle<Code> code_constant, | 949 Handle<Code> code_constant, |
945 Register code_reg, | 950 Register code_reg, |
946 Label* done, | 951 Label* done, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1045 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1041 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1046 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1042 #else | 1047 #else |
1043 #define ACCESS_MASM(masm) masm-> | 1048 #define ACCESS_MASM(masm) masm-> |
1044 #endif | 1049 #endif |
1045 | 1050 |
1046 | 1051 |
1047 } } // namespace v8::internal | 1052 } } // namespace v8::internal |
1048 | 1053 |
1049 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1054 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |