OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_WASM_INTERPRETER_H_ | 5 #ifndef V8_WASM_INTERPRETER_H_ |
6 #define V8_WASM_INTERPRETER_H_ | 6 #define V8_WASM_INTERPRETER_H_ |
7 | 7 |
8 #include "src/wasm/wasm-opcodes.h" | 8 #include "src/wasm/wasm-opcodes.h" |
9 #include "src/zone/zone-containers.h" | 9 #include "src/zone/zone-containers.h" |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 State Step(); | 141 State Step(); |
142 void Pause(); | 142 void Pause(); |
143 void Reset(); | 143 void Reset(); |
144 | 144 |
145 // Stack inspection and modification. | 145 // Stack inspection and modification. |
146 pc_t GetBreakpointPc(); | 146 pc_t GetBreakpointPc(); |
147 int GetFrameCount(); | 147 int GetFrameCount(); |
148 const InterpretedFrame GetFrame(int index); | 148 const InterpretedFrame GetFrame(int index); |
149 InterpretedFrame GetMutableFrame(int index); | 149 InterpretedFrame GetMutableFrame(int index); |
150 WasmVal GetReturnValue(int index = 0); | 150 WasmVal GetReturnValue(int index = 0); |
| 151 |
151 // Returns true if the thread executed an instruction which may produce | 152 // Returns true if the thread executed an instruction which may produce |
152 // nondeterministic results, e.g. float div, float sqrt, and float mul, | 153 // nondeterministic results, e.g. float div, float sqrt, and float mul, |
153 // where the sign bit of a NaN is nondeterministic. | 154 // where the sign bit of a NaN is nondeterministic. |
154 bool PossibleNondeterminism(); | 155 bool PossibleNondeterminism(); |
155 | 156 |
| 157 // Returns the number of calls / function frames executed on this thread. |
| 158 uint64_t NumInterpretedCalls(); |
| 159 |
156 // Thread-specific breakpoints. | 160 // Thread-specific breakpoints. |
157 // TODO(wasm): Implement this once we support multiple threads. | 161 // TODO(wasm): Implement this once we support multiple threads. |
158 // bool SetBreakpoint(const WasmFunction* function, int pc, bool enabled); | 162 // bool SetBreakpoint(const WasmFunction* function, int pc, bool enabled); |
159 // bool GetBreakpoint(const WasmFunction* function, int pc); | 163 // bool GetBreakpoint(const WasmFunction* function, int pc); |
160 | 164 |
161 void AddBreakFlags(uint8_t flags); | 165 void AddBreakFlags(uint8_t flags); |
162 void ClearBreakFlags(); | 166 void ClearBreakFlags(); |
163 }; | 167 }; |
164 | 168 |
165 WasmInterpreter(const ModuleBytesEnv& env, AccountingAllocator* allocator); | 169 WasmInterpreter(const ModuleBytesEnv& env, AccountingAllocator* allocator); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 private: | 217 private: |
214 Zone zone_; | 218 Zone zone_; |
215 WasmInterpreterInternals* internals_; | 219 WasmInterpreterInternals* internals_; |
216 }; | 220 }; |
217 | 221 |
218 } // namespace wasm | 222 } // namespace wasm |
219 } // namespace internal | 223 } // namespace internal |
220 } // namespace v8 | 224 } // namespace v8 |
221 | 225 |
222 #endif // V8_WASM_INTERPRETER_H_ | 226 #endif // V8_WASM_INTERPRETER_H_ |
OLD | NEW |