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/mips64/assembler-mips64.h" | 10 #include "src/mips64/assembler-mips64.h" |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 void TailCallStub(CodeStub* stub, COND_ARGS); | 1348 void TailCallStub(CodeStub* stub, COND_ARGS); |
1349 | 1349 |
1350 #undef COND_ARGS | 1350 #undef COND_ARGS |
1351 | 1351 |
1352 void CallJSExitStub(CodeStub* stub); | 1352 void CallJSExitStub(CodeStub* stub); |
1353 | 1353 |
1354 // Call a runtime routine. | 1354 // Call a runtime routine. |
1355 void CallRuntime(const Runtime::Function* f, int num_arguments, | 1355 void CallRuntime(const Runtime::Function* f, int num_arguments, |
1356 SaveFPRegsMode save_doubles = kDontSaveFPRegs, | 1356 SaveFPRegsMode save_doubles = kDontSaveFPRegs, |
1357 BranchDelaySlot bd = PROTECT); | 1357 BranchDelaySlot bd = PROTECT); |
1358 void CallRuntimeSaveDoubles(Runtime::FunctionId id) { | 1358 void CallRuntimeSaveDoubles(Runtime::FunctionId fid) { |
1359 const Runtime::Function* function = Runtime::FunctionForId(id); | 1359 const Runtime::Function* function = Runtime::FunctionForId(fid); |
1360 CallRuntime(function, function->nargs, kSaveFPRegs); | 1360 CallRuntime(function, function->nargs, kSaveFPRegs); |
1361 } | 1361 } |
1362 | 1362 |
1363 // Convenience function: Same as above, but takes the fid instead. | 1363 // Convenience function: Same as above, but takes the fid instead. |
1364 void CallRuntime(Runtime::FunctionId id, int num_arguments, | 1364 void CallRuntime(Runtime::FunctionId fid, |
1365 SaveFPRegsMode save_doubles = kDontSaveFPRegs, | 1365 SaveFPRegsMode save_doubles = kDontSaveFPRegs, |
1366 BranchDelaySlot bd = PROTECT) { | 1366 BranchDelaySlot bd = PROTECT) { |
1367 CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles, bd); | 1367 const Runtime::Function* function = Runtime::FunctionForId(fid); |
| 1368 CallRuntime(function, function->nargs, save_doubles, bd); |
| 1369 } |
| 1370 |
| 1371 // Convenience function: Same as above, but takes the fid instead. |
| 1372 void CallRuntime(Runtime::FunctionId fid, int num_arguments, |
| 1373 SaveFPRegsMode save_doubles = kDontSaveFPRegs, |
| 1374 BranchDelaySlot bd = PROTECT) { |
| 1375 CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles, bd); |
1368 } | 1376 } |
1369 | 1377 |
1370 // Convenience function: call an external reference. | 1378 // Convenience function: call an external reference. |
1371 void CallExternalReference(const ExternalReference& ext, | 1379 void CallExternalReference(const ExternalReference& ext, |
1372 int num_arguments, | 1380 int num_arguments, |
1373 BranchDelaySlot bd = PROTECT); | 1381 BranchDelaySlot bd = PROTECT); |
1374 | 1382 |
1375 // Tail call of a runtime routine (jump). | |
1376 // Like JumpToExternalReference, but also takes care of passing the number | |
1377 // of parameters. | |
1378 void TailCallExternalReference(const ExternalReference& ext, | |
1379 int num_arguments); | |
1380 | |
1381 // Convenience function: tail call a runtime routine (jump). | 1383 // Convenience function: tail call a runtime routine (jump). |
1382 void TailCallRuntime(Runtime::FunctionId fid, int num_arguments); | 1384 void TailCallRuntime(Runtime::FunctionId fid); |
1383 | 1385 |
1384 int CalculateStackPassedWords(int num_reg_arguments, | 1386 int CalculateStackPassedWords(int num_reg_arguments, |
1385 int num_double_arguments); | 1387 int num_double_arguments); |
1386 | 1388 |
1387 // Before calling a C-function from generated code, align arguments on stack | 1389 // Before calling a C-function from generated code, align arguments on stack |
1388 // and add space for the four mips argument slots. | 1390 // and add space for the four mips argument slots. |
1389 // After aligning the frame, non-register arguments must be stored on the | 1391 // After aligning the frame, non-register arguments must be stored on the |
1390 // stack, after the argument-slots using helper: CFunctionArgumentOperand(). | 1392 // stack, after the argument-slots using helper: CFunctionArgumentOperand(). |
1391 // The argument count assumes all arguments are word sized. | 1393 // The argument count assumes all arguments are word sized. |
1392 // Some compilers/platforms require the stack to be aligned when calling | 1394 // Some compilers/platforms require the stack to be aligned when calling |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1877 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1876 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1878 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1877 #else | 1879 #else |
1878 #define ACCESS_MASM(masm) masm-> | 1880 #define ACCESS_MASM(masm) masm-> |
1879 #endif | 1881 #endif |
1880 | 1882 |
1881 } // namespace internal | 1883 } // namespace internal |
1882 } // namespace v8 | 1884 } // namespace v8 |
1883 | 1885 |
1884 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1886 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |