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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 return c_limit; | 48 return c_limit; |
49 } | 49 } |
50 | 50 |
51 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { | 51 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { |
52 return try_catch_address; | 52 return try_catch_address; |
53 } | 53 } |
54 | 54 |
55 static inline void UnregisterCTryCatch() { } | 55 static inline void UnregisterCTryCatch() { } |
56 }; | 56 }; |
57 | 57 |
58 } } // namespace v8::internal | 58 } // namespace internal |
| 59 } // namespace v8 |
59 | 60 |
60 // Calculated the stack limit beyond which we will throw stack overflow errors. | 61 // Calculated the stack limit beyond which we will throw stack overflow errors. |
61 // This macro must be called from a C++ method. It relies on being able to take | 62 // This macro must be called from a C++ method. It relies on being able to take |
62 // the address of "this" to get a value on the current execution stack and then | 63 // the address of "this" to get a value on the current execution stack and then |
63 // calculates the stack limit based on that value. | 64 // calculates the stack limit based on that value. |
64 // NOTE: The check for overflow is not safe as there is no guarantee that the | 65 // NOTE: The check for overflow is not safe as there is no guarantee that the |
65 // running thread has its stack in all memory up to address 0x00000000. | 66 // running thread has its stack in all memory up to address 0x00000000. |
66 #define GENERATED_CODE_STACK_LIMIT(limit) \ | 67 #define GENERATED_CODE_STACK_LIMIT(limit) \ |
67 (reinterpret_cast<uintptr_t>(this) >= limit ? \ | 68 (reinterpret_cast<uintptr_t>(this) >= limit ? \ |
68 reinterpret_cast<uintptr_t>(this) - limit : 0) | 69 reinterpret_cast<uintptr_t>(this) - limit : 0) |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { | 474 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { |
474 Simulator* sim = Simulator::current(Isolate::Current()); | 475 Simulator* sim = Simulator::current(Isolate::Current()); |
475 return sim->PushAddress(try_catch_address); | 476 return sim->PushAddress(try_catch_address); |
476 } | 477 } |
477 | 478 |
478 static inline void UnregisterCTryCatch() { | 479 static inline void UnregisterCTryCatch() { |
479 Simulator::current(Isolate::Current())->PopAddress(); | 480 Simulator::current(Isolate::Current())->PopAddress(); |
480 } | 481 } |
481 }; | 482 }; |
482 | 483 |
483 } } // namespace v8::internal | 484 } // namespace internal |
| 485 } // namespace v8 |
484 | 486 |
485 #endif // !defined(USE_SIMULATOR) | 487 #endif // !defined(USE_SIMULATOR) |
486 #endif // V8_MIPS_SIMULATOR_MIPS_H_ | 488 #endif // V8_MIPS_SIMULATOR_MIPS_H_ |
OLD | NEW |