Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: runtime/vm/simulator_dbc.h

Issue 2570103003: VM: [DBC] Remove sp_ field from the DBC simulator (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 RUNTIME_VM_SIMULATOR_DBC_H_ 5 #ifndef RUNTIME_VM_SIMULATOR_DBC_H_
6 #define RUNTIME_VM_SIMULATOR_DBC_H_ 6 #define RUNTIME_VM_SIMULATOR_DBC_H_
7 7
8 #ifndef RUNTIME_VM_SIMULATOR_H_ 8 #ifndef RUNTIME_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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 JumpToFrame(uword pc, uword sp, uword fp, Thread* thread); 67 void JumpToFrame(uword pc, uword sp, uword fp, Thread* thread);
68 68
69 uword get_sp() const { return reinterpret_cast<uword>(sp_); } 69 uword get_sp() const { return reinterpret_cast<uword>(fp_); }
70 uword get_fp() const { return reinterpret_cast<uword>(fp_); } 70 uword get_fp() const { return reinterpret_cast<uword>(fp_); }
71 uword get_pc() const { return reinterpret_cast<uword>(pc_); } 71 uword get_pc() const { return reinterpret_cast<uword>(pc_); }
72 72
73 enum IntrinsicId { 73 enum IntrinsicId {
74 #define V(test_class_name, test_function_name, enum_name, type, fp) \ 74 #define V(test_class_name, test_function_name, enum_name, type, fp) \
75 k##enum_name##Intrinsic, 75 k##enum_name##Intrinsic,
76 ALL_INTRINSICS_LIST(V) GRAPH_INTRINSICS_LIST(V) 76 ALL_INTRINSICS_LIST(V) GRAPH_INTRINSICS_LIST(V)
77 #undef V 77 #undef V
78 kIntrinsicCount, 78 kIntrinsicCount,
79 }; 79 };
80 80
81 static bool IsSupportedIntrinsic(IntrinsicId id) { 81 static bool IsSupportedIntrinsic(IntrinsicId id) {
82 return intrinsics_[id] != NULL; 82 return intrinsics_[id] != NULL;
83 } 83 }
84 84
85 enum SpecialIndex { 85 enum SpecialIndex {
86 kExceptionSpecialIndex, 86 kExceptionSpecialIndex,
87 kStackTraceSpecialIndex, 87 kStackTraceSpecialIndex,
88 kSpecialIndexCount 88 kSpecialIndexCount
89 }; 89 };
90 90
91 private: 91 private:
92 uintptr_t* stack_; 92 uintptr_t* stack_;
93 93
94 RawObject** fp_; 94 RawObject** fp_;
95 RawObject** sp_;
96 uword pc_; 95 uword pc_;
97 96
98 SimulatorSetjmpBuffer* last_setjmp_buffer_; 97 SimulatorSetjmpBuffer* last_setjmp_buffer_;
99 uword top_exit_frame_info_; 98 uword top_exit_frame_info_;
100 99
101 RawObject* special_[kSpecialIndexCount]; 100 RawObject* special_[kSpecialIndexCount];
102 101
103 static IntrinsicHandler intrinsics_[kIntrinsicCount]; 102 static IntrinsicHandler intrinsics_[kIntrinsicCount];
104 103
105 void Exit(Thread* thread, 104 void Exit(Thread* thread,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 last_setjmp_buffer_ = buffer; 160 last_setjmp_buffer_ = buffer;
162 } 161 }
163 162
164 friend class SimulatorSetjmpBuffer; 163 friend class SimulatorSetjmpBuffer;
165 DISALLOW_COPY_AND_ASSIGN(Simulator); 164 DISALLOW_COPY_AND_ASSIGN(Simulator);
166 }; 165 };
167 166
168 } // namespace dart 167 } // namespace dart
169 168
170 #endif // RUNTIME_VM_SIMULATOR_DBC_H_ 169 #endif // RUNTIME_VM_SIMULATOR_DBC_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698