OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_X64_SIMULATOR_X64_H_ | 5 #ifndef V8_X64_SIMULATOR_X64_H_ |
6 #define V8_X64_SIMULATOR_X64_H_ | 6 #define V8_X64_SIMULATOR_X64_H_ |
7 | 7 |
8 #include "allocation.h" | 8 #include "allocation.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 // Since there is no simulator for the x64 architecture the only thing we can | 13 // Since there is no simulator for the x64 architecture the only thing we can |
14 // do is to call the entry directly. | 14 // do is to call the entry directly. |
15 // TODO(X64): Don't pass p0, since it isn't used? | 15 // TODO(X64): Don't pass p0, since it isn't used? |
16 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 16 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
17 (entry(p0, p1, p2, p3, p4)) | 17 (entry(p0, p1, p2, p3, p4)) |
18 | 18 |
19 typedef int (*regexp_matcher)(String*, int, const byte*, | 19 typedef int (*regexp_matcher)(String*, int, const byte*, |
20 const byte*, int*, int, Address, int, Isolate*); | 20 const byte*, int*, int, Address, int, Isolate*); |
21 | 21 |
22 // Call the generated regexp code directly. The code at the entry address should | 22 // Call the generated regexp code directly. The code at the entry address should |
23 // expect eight int/pointer sized arguments and return an int. | 23 // expect eight int/pointer sized arguments and return an int. |
24 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ | 24 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
25 (FUNCTION_CAST<regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, p8)) | 25 (FUNCTION_CAST<regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, p8)) |
26 | 26 |
27 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | |
28 (reinterpret_cast<TryCatch*>(try_catch_address)) | |
29 | |
30 // The stack limit beyond which we will throw stack overflow errors in | 27 // The stack limit beyond which we will throw stack overflow errors in |
31 // generated code. Because generated code on x64 uses the C stack, we | 28 // generated code. Because generated code on x64 uses the C stack, we |
32 // just use the C stack limit. | 29 // just use the C stack limit. |
33 class SimulatorStack : public v8::internal::AllStatic { | 30 class SimulatorStack : public v8::internal::AllStatic { |
34 public: | 31 public: |
35 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, | 32 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, |
36 uintptr_t c_limit) { | 33 uintptr_t c_limit) { |
37 return c_limit; | 34 return c_limit; |
38 } | 35 } |
39 | 36 |
40 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { | 37 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { |
41 return try_catch_address; | 38 return try_catch_address; |
42 } | 39 } |
43 | 40 |
44 static inline void UnregisterCTryCatch() { } | 41 static inline void UnregisterCTryCatch() { } |
45 }; | 42 }; |
46 | 43 |
47 } } // namespace v8::internal | 44 } } // namespace v8::internal |
48 | 45 |
49 #endif // V8_X64_SIMULATOR_X64_H_ | 46 #endif // V8_X64_SIMULATOR_X64_H_ |
OLD | NEW |