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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return c_limit; | 77 return c_limit; |
78 } | 78 } |
79 | 79 |
80 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { | 80 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { |
81 return try_catch_address; | 81 return try_catch_address; |
82 } | 82 } |
83 | 83 |
84 static inline void UnregisterCTryCatch() { } | 84 static inline void UnregisterCTryCatch() { } |
85 }; | 85 }; |
86 | 86 |
87 } } // namespace v8::internal | 87 } // namespace internal |
| 88 } // namespace v8 |
88 | 89 |
89 // Calculated the stack limit beyond which we will throw stack overflow errors. | 90 // Calculated the stack limit beyond which we will throw stack overflow errors. |
90 // This macro must be called from a C++ method. It relies on being able to take | 91 // This macro must be called from a C++ method. It relies on being able to take |
91 // the address of "this" to get a value on the current execution stack and then | 92 // the address of "this" to get a value on the current execution stack and then |
92 // calculates the stack limit based on that value. | 93 // calculates the stack limit based on that value. |
93 // NOTE: The check for overflow is not safe as there is no guarantee that the | 94 // NOTE: The check for overflow is not safe as there is no guarantee that the |
94 // running thread has its stack in all memory up to address 0x00000000. | 95 // running thread has its stack in all memory up to address 0x00000000. |
95 #define GENERATED_CODE_STACK_LIMIT(limit) \ | 96 #define GENERATED_CODE_STACK_LIMIT(limit) \ |
96 (reinterpret_cast<uintptr_t>(this) >= limit ? \ | 97 (reinterpret_cast<uintptr_t>(this) >= limit ? \ |
97 reinterpret_cast<uintptr_t>(this) - limit : 0) | 98 reinterpret_cast<uintptr_t>(this) - limit : 0) |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { | 520 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { |
520 Simulator* sim = Simulator::current(Isolate::Current()); | 521 Simulator* sim = Simulator::current(Isolate::Current()); |
521 return sim->PushAddress(try_catch_address); | 522 return sim->PushAddress(try_catch_address); |
522 } | 523 } |
523 | 524 |
524 static inline void UnregisterCTryCatch() { | 525 static inline void UnregisterCTryCatch() { |
525 Simulator::current(Isolate::Current())->PopAddress(); | 526 Simulator::current(Isolate::Current())->PopAddress(); |
526 } | 527 } |
527 }; | 528 }; |
528 | 529 |
529 } } // namespace v8::internal | 530 } // namespace internal |
| 531 } // namespace v8 |
530 | 532 |
531 #endif // !defined(USE_SIMULATOR) | 533 #endif // !defined(USE_SIMULATOR) |
532 #endif // V8_MIPS_SIMULATOR_MIPS_H_ | 534 #endif // V8_MIPS_SIMULATOR_MIPS_H_ |
OLD | NEW |