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 |
11 // on a MIPS HW platform. | 11 // on a MIPS HW platform. |
12 | 12 |
13 #ifndef V8_MIPS_SIMULATOR_MIPS_H_ | 13 #ifndef V8_MIPS_SIMULATOR_MIPS_H_ |
14 #define V8_MIPS_SIMULATOR_MIPS_H_ | 14 #define V8_MIPS_SIMULATOR_MIPS_H_ |
15 | 15 |
16 #include "allocation.h" | 16 #include "src/allocation.h" |
17 #include "constants-mips.h" | 17 #include "src/mips/constants-mips.h" |
18 | 18 |
19 #if !defined(USE_SIMULATOR) | 19 #if !defined(USE_SIMULATOR) |
20 // Running without a simulator on a native mips platform. | 20 // Running without a simulator on a native mips platform. |
21 | 21 |
22 namespace v8 { | 22 namespace v8 { |
23 namespace internal { | 23 namespace internal { |
24 | 24 |
25 // When running without a simulator we call the entry directly. | 25 // When running without a simulator we call the entry directly. |
26 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 26 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
27 entry(p0, p1, p2, p3, p4) | 27 entry(p0, p1, p2, p3, p4) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // calculates the stack limit based on that value. | 63 // calculates the stack limit based on that value. |
64 // NOTE: The check for overflow is not safe as there is no guarantee that the | 64 // 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. | 65 // running thread has its stack in all memory up to address 0x00000000. |
66 #define GENERATED_CODE_STACK_LIMIT(limit) \ | 66 #define GENERATED_CODE_STACK_LIMIT(limit) \ |
67 (reinterpret_cast<uintptr_t>(this) >= limit ? \ | 67 (reinterpret_cast<uintptr_t>(this) >= limit ? \ |
68 reinterpret_cast<uintptr_t>(this) - limit : 0) | 68 reinterpret_cast<uintptr_t>(this) - limit : 0) |
69 | 69 |
70 #else // !defined(USE_SIMULATOR) | 70 #else // !defined(USE_SIMULATOR) |
71 // Running with a simulator. | 71 // Running with a simulator. |
72 | 72 |
73 #include "hashmap.h" | 73 #include "src/hashmap.h" |
74 #include "assembler.h" | 74 #include "src/assembler.h" |
75 | 75 |
76 namespace v8 { | 76 namespace v8 { |
77 namespace internal { | 77 namespace internal { |
78 | 78 |
79 // ----------------------------------------------------------------------------- | 79 // ----------------------------------------------------------------------------- |
80 // Utility functions | 80 // Utility functions |
81 | 81 |
82 class CachePage { | 82 class CachePage { |
83 public: | 83 public: |
84 static const int LINE_VALID = 0; | 84 static const int LINE_VALID = 0; |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 407 |
408 static inline void UnregisterCTryCatch() { | 408 static inline void UnregisterCTryCatch() { |
409 Simulator::current(Isolate::Current())->PopAddress(); | 409 Simulator::current(Isolate::Current())->PopAddress(); |
410 } | 410 } |
411 }; | 411 }; |
412 | 412 |
413 } } // namespace v8::internal | 413 } } // namespace v8::internal |
414 | 414 |
415 #endif // !defined(USE_SIMULATOR) | 415 #endif // !defined(USE_SIMULATOR) |
416 #endif // V8_MIPS_SIMULATOR_MIPS_H_ | 416 #endif // V8_MIPS_SIMULATOR_MIPS_H_ |
OLD | NEW |