OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/mips/assembler-mips.h" | 10 #include "src/mips/assembler-mips.h" |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 // Call a runtime routine. | 1238 // Call a runtime routine. |
1239 void CallRuntime(const Runtime::Function* f, int num_arguments, | 1239 void CallRuntime(const Runtime::Function* f, int num_arguments, |
1240 SaveFPRegsMode save_doubles = kDontSaveFPRegs, | 1240 SaveFPRegsMode save_doubles = kDontSaveFPRegs, |
1241 BranchDelaySlot bd = PROTECT); | 1241 BranchDelaySlot bd = PROTECT); |
1242 void CallRuntimeSaveDoubles(Runtime::FunctionId id) { | 1242 void CallRuntimeSaveDoubles(Runtime::FunctionId id) { |
1243 const Runtime::Function* function = Runtime::FunctionForId(id); | 1243 const Runtime::Function* function = Runtime::FunctionForId(id); |
1244 CallRuntime(function, function->nargs, kSaveFPRegs); | 1244 CallRuntime(function, function->nargs, kSaveFPRegs); |
1245 } | 1245 } |
1246 | 1246 |
1247 // Convenience function: Same as above, but takes the fid instead. | 1247 // Convenience function: Same as above, but takes the fid instead. |
| 1248 void CallRuntime(Runtime::FunctionId fid, |
| 1249 SaveFPRegsMode save_doubles = kDontSaveFPRegs, |
| 1250 BranchDelaySlot bd = PROTECT) { |
| 1251 const Runtime::Function* function = Runtime::FunctionForId(fid); |
| 1252 CallRuntime(function, function->nargs, save_doubles, bd); |
| 1253 } |
| 1254 |
| 1255 // Convenience function: Same as above, but takes the fid instead. |
1248 void CallRuntime(Runtime::FunctionId id, int num_arguments, | 1256 void CallRuntime(Runtime::FunctionId id, int num_arguments, |
1249 SaveFPRegsMode save_doubles = kDontSaveFPRegs, | 1257 SaveFPRegsMode save_doubles = kDontSaveFPRegs, |
1250 BranchDelaySlot bd = PROTECT) { | 1258 BranchDelaySlot bd = PROTECT) { |
1251 CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles, bd); | 1259 CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles, bd); |
1252 } | 1260 } |
1253 | 1261 |
1254 // Convenience function: call an external reference. | 1262 // Convenience function: call an external reference. |
1255 void CallExternalReference(const ExternalReference& ext, | 1263 void CallExternalReference(const ExternalReference& ext, |
1256 int num_arguments, | 1264 int num_arguments, |
1257 BranchDelaySlot bd = PROTECT); | 1265 BranchDelaySlot bd = PROTECT); |
1258 | 1266 |
1259 // Tail call of a runtime routine (jump). | |
1260 // Like JumpToExternalReference, but also takes care of passing the number | |
1261 // of parameters. | |
1262 void TailCallExternalReference(const ExternalReference& ext, | |
1263 int num_arguments); | |
1264 | 1267 |
1265 // Convenience function: tail call a runtime routine (jump). | 1268 // Convenience function: tail call a runtime routine (jump). |
1266 void TailCallRuntime(Runtime::FunctionId fid, int num_arguments); | 1269 void TailCallRuntime(Runtime::FunctionId fid); |
1267 | 1270 |
1268 int CalculateStackPassedWords(int num_reg_arguments, | 1271 int CalculateStackPassedWords(int num_reg_arguments, |
1269 int num_double_arguments); | 1272 int num_double_arguments); |
1270 | 1273 |
1271 // Before calling a C-function from generated code, align arguments on stack | 1274 // Before calling a C-function from generated code, align arguments on stack |
1272 // and add space for the four mips argument slots. | 1275 // and add space for the four mips argument slots. |
1273 // After aligning the frame, non-register arguments must be stored on the | 1276 // After aligning the frame, non-register arguments must be stored on the |
1274 // stack, after the argument-slots using helper: CFunctionArgumentOperand(). | 1277 // stack, after the argument-slots using helper: CFunctionArgumentOperand(). |
1275 // The argument count assumes all arguments are word sized. | 1278 // The argument count assumes all arguments are word sized. |
1276 // Some compilers/platforms require the stack to be aligned when calling | 1279 // Some compilers/platforms require the stack to be aligned when calling |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1748 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1746 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1749 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1747 #else | 1750 #else |
1748 #define ACCESS_MASM(masm) masm-> | 1751 #define ACCESS_MASM(masm) masm-> |
1749 #endif | 1752 #endif |
1750 | 1753 |
1751 } // namespace internal | 1754 } // namespace internal |
1752 } // namespace v8 | 1755 } // namespace v8 |
1753 | 1756 |
1754 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1757 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |