OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 | 5 |
6 // Declares a Simulator for MIPS instructions if we are not generating a native | 6 // Declares a Simulator for MIPS instructions if we are not generating a native |
7 // MIPS binary. This Simulator allows us to run and debug MIPS code generation | 7 // MIPS binary. This Simulator allows us to run and debug MIPS code generation |
8 // on regular desktop machines. | 8 // on regular desktop machines. |
9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, | 9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, |
10 // which will start execution in the Simulator or forwards to the real entry | 10 // which will start execution in the Simulator or forwards to the real entry |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 // point. | 486 // point. |
487 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 487 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
488 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ | 488 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ |
489 FUNCTION_ADDR(entry), 5, reinterpret_cast<int64_t*>(p0), \ | 489 FUNCTION_ADDR(entry), 5, reinterpret_cast<int64_t*>(p0), \ |
490 reinterpret_cast<int64_t*>(p1), reinterpret_cast<int64_t*>(p2), \ | 490 reinterpret_cast<int64_t*>(p1), reinterpret_cast<int64_t*>(p2), \ |
491 reinterpret_cast<int64_t*>(p3), reinterpret_cast<int64_t*>(p4))) | 491 reinterpret_cast<int64_t*>(p3), reinterpret_cast<int64_t*>(p4))) |
492 | 492 |
493 | 493 |
494 #ifdef MIPS_ABI_N64 | 494 #ifdef MIPS_ABI_N64 |
495 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ | 495 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
496 static_cast<int>( \ | 496 static_cast<int>(Simulator::current(Isolate::Current()) \ |
497 Simulator::current(Isolate::Current()) \ | 497 ->Call(entry, 10, p0, p1, p2, p3, p4, \ |
498 ->Call(entry, 10, p0, p1, p2, p3, p4, p5, p6, p7, NULL, p8)) | 498 reinterpret_cast<int64_t*>(p5), p6, p7, NULL, \ |
| 499 p8)) |
499 #else // Must be O32 Abi. | 500 #else // Must be O32 Abi. |
500 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ | 501 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
501 static_cast<int>( \ | 502 static_cast<int>( \ |
502 Simulator::current(Isolate::Current()) \ | 503 Simulator::current(Isolate::Current()) \ |
503 ->Call(entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8)) | 504 ->Call(entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8)) |
504 #endif // MIPS_ABI_N64 | 505 #endif // MIPS_ABI_N64 |
505 | 506 |
506 | 507 |
507 // The simulator has its own stack. Thus it has a different stack limit from | 508 // The simulator has its own stack. Thus it has a different stack limit from |
508 // the C-based native code. The JS-based limit normally points near the end of | 509 // the C-based native code. The JS-based limit normally points near the end of |
(...skipping 13 matching lines...) Expand all Loading... |
522 | 523 |
523 static inline void UnregisterCTryCatch() { | 524 static inline void UnregisterCTryCatch() { |
524 Simulator::current(Isolate::Current())->PopAddress(); | 525 Simulator::current(Isolate::Current())->PopAddress(); |
525 } | 526 } |
526 }; | 527 }; |
527 | 528 |
528 } } // namespace v8::internal | 529 } } // namespace v8::internal |
529 | 530 |
530 #endif // !defined(USE_SIMULATOR) | 531 #endif // !defined(USE_SIMULATOR) |
531 #endif // V8_MIPS_SIMULATOR_MIPS_H_ | 532 #endif // V8_MIPS_SIMULATOR_MIPS_H_ |
OLD | NEW |