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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 struct StopCountAndDesc { | 429 struct StopCountAndDesc { |
430 uint32_t count; | 430 uint32_t count; |
431 char* desc; | 431 char* desc; |
432 }; | 432 }; |
433 StopCountAndDesc watched_stops_[kMaxStopCode + 1]; | 433 StopCountAndDesc watched_stops_[kMaxStopCode + 1]; |
434 }; | 434 }; |
435 | 435 |
436 | 436 |
437 // When running with the simulator transition into simulated execution at this | 437 // When running with the simulator transition into simulated execution at this |
438 // point. | 438 // point. |
439 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 439 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
440 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ | 440 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ |
441 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) | 441 FUNCTION_ADDR(entry), 5, reinterpret_cast<int64_t*>(p0), \ |
| 442 reinterpret_cast<int64_t*>(p1), reinterpret_cast<int64_t*>(p2), \ |
| 443 reinterpret_cast<int64_t*>(p3), reinterpret_cast<int64_t*>(p4))) |
| 444 |
442 | 445 |
443 #ifdef MIPS_ABI_N64 | 446 #ifdef MIPS_ABI_N64 |
444 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ | 447 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
445 Simulator::current(Isolate::Current())->Call( \ | 448 Simulator::current(Isolate::Current())->Call( \ |
446 entry, 10, p0, p1, p2, p3, p4, p5, p6, p7, NULL, p8) | 449 entry, 10, p0, p1, p2, p3, p4, p5, p6, p7, NULL, p8) |
447 #else // Must be O32 Abi. | 450 #else // Must be O32 Abi. |
448 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ | 451 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
449 Simulator::current(Isolate::Current())->Call( \ | 452 Simulator::current(Isolate::Current())->Call( \ |
450 entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8) | 453 entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8) |
451 #endif // MIPS_ABI_N64 | 454 #endif // MIPS_ABI_N64 |
(...skipping 18 matching lines...) Expand all Loading... |
470 | 473 |
471 static inline void UnregisterCTryCatch() { | 474 static inline void UnregisterCTryCatch() { |
472 Simulator::current(Isolate::Current())->PopAddress(); | 475 Simulator::current(Isolate::Current())->PopAddress(); |
473 } | 476 } |
474 }; | 477 }; |
475 | 478 |
476 } } // namespace v8::internal | 479 } } // namespace v8::internal |
477 | 480 |
478 #endif // !defined(USE_SIMULATOR) | 481 #endif // !defined(USE_SIMULATOR) |
479 #endif // V8_MIPS_SIMULATOR_MIPS_H_ | 482 #endif // V8_MIPS_SIMULATOR_MIPS_H_ |
OLD | NEW |