| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 CallKind call_kind); | 805 CallKind call_kind); |
| 806 | 806 |
| 807 // Invoke the JavaScript function in the given register. Changes the | 807 // Invoke the JavaScript function in the given register. Changes the |
| 808 // current context to the context in the function before invoking. | 808 // current context to the context in the function before invoking. |
| 809 void InvokeFunction(Register function, | 809 void InvokeFunction(Register function, |
| 810 const ParameterCount& actual, | 810 const ParameterCount& actual, |
| 811 InvokeFlag flag, | 811 InvokeFlag flag, |
| 812 const CallWrapper& call_wrapper, | 812 const CallWrapper& call_wrapper, |
| 813 CallKind call_kind); | 813 CallKind call_kind); |
| 814 | 814 |
| 815 void InvokeFunction(JSFunction* function, | 815 void InvokeFunction(Handle<JSFunction> function, |
| 816 const ParameterCount& actual, | 816 const ParameterCount& actual, |
| 817 InvokeFlag flag, | 817 InvokeFlag flag, |
| 818 CallKind call_kind); | 818 CallKind call_kind); |
| 819 | 819 |
| 820 | 820 |
| 821 void IsObjectJSObjectType(Register heap_object, | 821 void IsObjectJSObjectType(Register heap_object, |
| 822 Register map, | 822 Register map, |
| 823 Register scratch, | 823 Register scratch, |
| 824 Label* fail); | 824 Label* fail); |
| 825 | 825 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 Ret(ge, overflow_check, Operand(zero_reg), bd); | 1035 Ret(ge, overflow_check, Operand(zero_reg), bd); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 // ------------------------------------------------------------------------- | 1038 // ------------------------------------------------------------------------- |
| 1039 // Runtime calls. | 1039 // Runtime calls. |
| 1040 | 1040 |
| 1041 // Call a code stub. | 1041 // Call a code stub. |
| 1042 void CallStub(CodeStub* stub, Condition cond = cc_always, | 1042 void CallStub(CodeStub* stub, Condition cond = cc_always, |
| 1043 Register r1 = zero_reg, const Operand& r2 = Operand(zero_reg)); | 1043 Register r1 = zero_reg, const Operand& r2 = Operand(zero_reg)); |
| 1044 | 1044 |
| 1045 // Call a code stub and return the code object called. Try to generate | |
| 1046 // the code if necessary. Do not perform a GC but instead return a retry | |
| 1047 // after GC failure. | |
| 1048 MUST_USE_RESULT MaybeObject* TryCallStub(CodeStub* stub, | |
| 1049 Condition cond = cc_always, | |
| 1050 Register r1 = zero_reg, | |
| 1051 const Operand& r2 = | |
| 1052 Operand(zero_reg)); | |
| 1053 | |
| 1054 // Tail call a code stub (jump). | 1045 // Tail call a code stub (jump). |
| 1055 void TailCallStub(CodeStub* stub); | 1046 void TailCallStub(CodeStub* stub); |
| 1056 | 1047 |
| 1057 // Tail call a code stub (jump) and return the code object called. Try to | |
| 1058 // generate the code if necessary. Do not perform a GC but instead return | |
| 1059 // a retry after GC failure. | |
| 1060 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub, | |
| 1061 Condition cond = cc_always, | |
| 1062 Register r1 = zero_reg, | |
| 1063 const Operand& r2 = | |
| 1064 Operand(zero_reg)); | |
| 1065 | |
| 1066 void CallJSExitStub(CodeStub* stub); | 1048 void CallJSExitStub(CodeStub* stub); |
| 1067 | 1049 |
| 1068 // Call a runtime routine. | 1050 // Call a runtime routine. |
| 1069 void CallRuntime(const Runtime::Function* f, int num_arguments); | 1051 void CallRuntime(const Runtime::Function* f, int num_arguments); |
| 1070 void CallRuntimeSaveDoubles(Runtime::FunctionId id); | 1052 void CallRuntimeSaveDoubles(Runtime::FunctionId id); |
| 1071 | 1053 |
| 1072 // Convenience function: Same as above, but takes the fid instead. | 1054 // Convenience function: Same as above, but takes the fid instead. |
| 1073 void CallRuntime(Runtime::FunctionId fid, int num_arguments); | 1055 void CallRuntime(Runtime::FunctionId fid, int num_arguments); |
| 1074 | 1056 |
| 1075 // Convenience function: call an external reference. | 1057 // Convenience function: call an external reference. |
| 1076 void CallExternalReference(const ExternalReference& ext, | 1058 void CallExternalReference(const ExternalReference& ext, |
| 1077 int num_arguments); | 1059 int num_arguments); |
| 1078 | 1060 |
| 1079 // Tail call of a runtime routine (jump). | 1061 // Tail call of a runtime routine (jump). |
| 1080 // Like JumpToExternalReference, but also takes care of passing the number | 1062 // Like JumpToExternalReference, but also takes care of passing the number |
| 1081 // of parameters. | 1063 // of parameters. |
| 1082 void TailCallExternalReference(const ExternalReference& ext, | 1064 void TailCallExternalReference(const ExternalReference& ext, |
| 1083 int num_arguments, | 1065 int num_arguments, |
| 1084 int result_size); | 1066 int result_size); |
| 1085 | 1067 |
| 1086 // Tail call of a runtime routine (jump). Try to generate the code if | |
| 1087 // necessary. Do not perform a GC but instead return a retry after GC | |
| 1088 // failure. | |
| 1089 MUST_USE_RESULT MaybeObject* TryTailCallExternalReference( | |
| 1090 const ExternalReference& ext, int num_arguments, int result_size); | |
| 1091 | |
| 1092 // Convenience function: tail call a runtime routine (jump). | 1068 // Convenience function: tail call a runtime routine (jump). |
| 1093 void TailCallRuntime(Runtime::FunctionId fid, | 1069 void TailCallRuntime(Runtime::FunctionId fid, |
| 1094 int num_arguments, | 1070 int num_arguments, |
| 1095 int result_size); | 1071 int result_size); |
| 1096 | 1072 |
| 1097 int CalculateStackPassedWords(int num_reg_arguments, | 1073 int CalculateStackPassedWords(int num_reg_arguments, |
| 1098 int num_double_arguments); | 1074 int num_double_arguments); |
| 1099 | 1075 |
| 1100 // Before calling a C-function from generated code, align arguments on stack | 1076 // Before calling a C-function from generated code, align arguments on stack |
| 1101 // and add space for the four mips argument slots. | 1077 // and add space for the four mips argument slots. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1132 void GetCFunctionDoubleResult(const DoubleRegister dst); | 1108 void GetCFunctionDoubleResult(const DoubleRegister dst); |
| 1133 | 1109 |
| 1134 // There are two ways of passing double arguments on MIPS, depending on | 1110 // There are two ways of passing double arguments on MIPS, depending on |
| 1135 // whether soft or hard floating point ABI is used. These functions | 1111 // whether soft or hard floating point ABI is used. These functions |
| 1136 // abstract parameter passing for the three different ways we call | 1112 // abstract parameter passing for the three different ways we call |
| 1137 // C functions from generated code. | 1113 // C functions from generated code. |
| 1138 void SetCallCDoubleArguments(DoubleRegister dreg); | 1114 void SetCallCDoubleArguments(DoubleRegister dreg); |
| 1139 void SetCallCDoubleArguments(DoubleRegister dreg1, DoubleRegister dreg2); | 1115 void SetCallCDoubleArguments(DoubleRegister dreg1, DoubleRegister dreg2); |
| 1140 void SetCallCDoubleArguments(DoubleRegister dreg, Register reg); | 1116 void SetCallCDoubleArguments(DoubleRegister dreg, Register reg); |
| 1141 | 1117 |
| 1142 // Calls an API function. Allocates HandleScope, extracts returned value | 1118 // Calls an API function. Allocates HandleScope, extracts returned value |
| 1143 // from handle and propagates exceptions. Restores context. | 1119 // from handle and propagates exceptions. Restores context. stack_space |
| 1144 MaybeObject* TryCallApiFunctionAndReturn(ExternalReference function, | 1120 // - space to be unwound on exit (includes the call js arguments space and |
| 1145 int stack_space); | 1121 // the additional space allocated for the fast call). |
| 1122 void CallApiFunctionAndReturn(ExternalReference function, int stack_space); |
| 1146 | 1123 |
| 1147 // Jump to the builtin routine. | 1124 // Jump to the builtin routine. |
| 1148 void JumpToExternalReference(const ExternalReference& builtin); | 1125 void JumpToExternalReference(const ExternalReference& builtin); |
| 1149 | 1126 |
| 1150 MaybeObject* TryJumpToExternalReference(const ExternalReference& ext); | |
| 1151 | |
| 1152 // Invoke specified builtin JavaScript function. Adds an entry to | 1127 // Invoke specified builtin JavaScript function. Adds an entry to |
| 1153 // the unresolved list if the name does not resolve. | 1128 // the unresolved list if the name does not resolve. |
| 1154 void InvokeBuiltin(Builtins::JavaScript id, | 1129 void InvokeBuiltin(Builtins::JavaScript id, |
| 1155 InvokeFlag flag, | 1130 InvokeFlag flag, |
| 1156 const CallWrapper& call_wrapper = NullCallWrapper()); | 1131 const CallWrapper& call_wrapper = NullCallWrapper()); |
| 1157 | 1132 |
| 1158 // Store the code object for the given builtin in the target register and | 1133 // Store the code object for the given builtin in the target register and |
| 1159 // setup the function in a1. | 1134 // setup the function in a1. |
| 1160 void GetBuiltinEntry(Register target, Builtins::JavaScript id); | 1135 void GetBuiltinEntry(Register target, Builtins::JavaScript id); |
| 1161 | 1136 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1435 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
| 1461 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1436 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 1462 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1437 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 1463 #else | 1438 #else |
| 1464 #define ACCESS_MASM(masm) masm-> | 1439 #define ACCESS_MASM(masm) masm-> |
| 1465 #endif | 1440 #endif |
| 1466 | 1441 |
| 1467 } } // namespace v8::internal | 1442 } } // namespace v8::internal |
| 1468 | 1443 |
| 1469 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1444 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
| OLD | NEW |