OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_SIMULATOR_DBC_H_ | 5 #ifndef VM_SIMULATOR_DBC_H_ |
6 #define VM_SIMULATOR_DBC_H_ | 6 #define VM_SIMULATOR_DBC_H_ |
7 | 7 |
8 #ifndef VM_SIMULATOR_H_ | 8 #ifndef VM_SIMULATOR_H_ |
9 #error Do not include simulator_dbc.h directly; use simulator.h. | 9 #error Do not include simulator_dbc.h directly; use simulator.h. |
10 #endif | 10 #endif |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ~Simulator(); | 43 ~Simulator(); |
44 | 44 |
45 // The currently executing Simulator instance, which is associated to the | 45 // The currently executing Simulator instance, which is associated to the |
46 // current isolate | 46 // current isolate |
47 static Simulator* Current(); | 47 static Simulator* Current(); |
48 | 48 |
49 // Accessors to the internal simulator stack base and top. | 49 // Accessors to the internal simulator stack base and top. |
50 uword StackBase() const { return reinterpret_cast<uword>(stack_); } | 50 uword StackBase() const { return reinterpret_cast<uword>(stack_); } |
51 uword StackTop() const; | 51 uword StackTop() const; |
52 | 52 |
53 // The isolate's top_exit_frame_info refers to a Dart frame in the simulator | 53 // The thread's top_exit_frame_info refers to a Dart frame in the simulator |
54 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the | 54 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the |
55 // native stack. | 55 // native stack. |
56 uword top_exit_frame_info() const { return top_exit_frame_info_; } | 56 uword top_exit_frame_info() const { return top_exit_frame_info_; } |
57 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } | 57 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } |
58 | 58 |
59 // Call on program start. | 59 // Call on program start. |
60 static void InitOnce(); | 60 static void InitOnce(); |
61 | 61 |
62 RawObject* Call(const Code& code, | 62 RawObject* Call(const Code& code, |
63 const Array& arguments_descriptor, | 63 const Array& arguments_descriptor, |
64 const Array& arguments, | 64 const Array& arguments, |
65 Thread* thread); | 65 Thread* thread); |
66 | 66 |
67 void Longjmp(uword pc, | 67 void Longjmp(uword pc, |
68 uword sp, | 68 uword sp, |
69 uword fp, | 69 uword fp, |
70 RawObject* raw_exception, | 70 RawObject* raw_exception, |
71 RawObject* raw_stacktrace, | 71 RawObject* raw_stacktrace, |
72 Thread* thread); | 72 Thread* thread); |
73 | 73 |
74 uword get_sp() const { | 74 uword get_sp() const { return reinterpret_cast<uword>(sp_); } |
75 return reinterpret_cast<uword>(sp_); | 75 uword get_fp() const { return reinterpret_cast<uword>(fp_); } |
76 } | 76 uword get_pc() const { return reinterpret_cast<uword>(pc_); } |
77 | 77 |
78 enum IntrinsicId { | 78 enum IntrinsicId { |
79 #define V(test_class_name, test_function_name, enum_name, type, fp) \ | 79 #define V(test_class_name, test_function_name, enum_name, type, fp) \ |
80 k##enum_name##Intrinsic, | 80 k##enum_name##Intrinsic, |
81 ALL_INTRINSICS_LIST(V) | 81 ALL_INTRINSICS_LIST(V) |
82 GRAPH_INTRINSICS_LIST(V) | 82 GRAPH_INTRINSICS_LIST(V) |
83 #undef V | 83 #undef V |
84 kIntrinsicCount, | 84 kIntrinsicCount, |
85 }; | 85 }; |
86 | 86 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 last_setjmp_buffer_ = buffer; | 166 last_setjmp_buffer_ = buffer; |
167 } | 167 } |
168 | 168 |
169 friend class SimulatorSetjmpBuffer; | 169 friend class SimulatorSetjmpBuffer; |
170 DISALLOW_COPY_AND_ASSIGN(Simulator); | 170 DISALLOW_COPY_AND_ASSIGN(Simulator); |
171 }; | 171 }; |
172 | 172 |
173 } // namespace dart | 173 } // namespace dart |
174 | 174 |
175 #endif // VM_SIMULATOR_DBC_H_ | 175 #endif // VM_SIMULATOR_DBC_H_ |
OLD | NEW |