| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // V | | 106 // V | |
| 107 // STOPPED ---Run()--> RUNNING ------Pause()-----+-> PAUSED <------+ | 107 // STOPPED ---Run()--> RUNNING ------Pause()-----+-> PAUSED <------+ |
| 108 // | | | / | | | 108 // | | | / | | |
| 109 // | | +---- Breakpoint ---+ +-- Step() --+ | 109 // | | +---- Breakpoint ---+ +-- Step() --+ |
| 110 // | | | 110 // | | |
| 111 // | +------------ Trap --------------> TRAPPED | 111 // | +------------ Trap --------------> TRAPPED |
| 112 // +------------- Finish -------------> FINISHED | 112 // +------------- Finish -------------> FINISHED |
| 113 enum State { STOPPED, RUNNING, PAUSED, FINISHED, TRAPPED }; | 113 enum State { STOPPED, RUNNING, PAUSED, FINISHED, TRAPPED }; |
| 114 | 114 |
| 115 // Representation of a thread in the interpreter. | 115 // Representation of a thread in the interpreter. |
| 116 class ThreadImpl; | |
| 117 class V8_EXPORT_PRIVATE Thread { | 116 class V8_EXPORT_PRIVATE Thread { |
| 118 ThreadImpl* impl_; | 117 // Don't instante Threads; they will be allocated as ThreadImpl in the |
| 118 // interpreter implementation. |
| 119 Thread() = delete; |
| 119 | 120 |
| 120 public: | 121 public: |
| 121 explicit Thread(ThreadImpl*); | |
| 122 | |
| 123 // Execution control. | 122 // Execution control. |
| 124 State state(); | 123 State state(); |
| 125 void PushFrame(const WasmFunction* function, WasmVal* args); | 124 void PushFrame(const WasmFunction* function, WasmVal* args); |
| 126 State Run(); | 125 State Run(); |
| 127 State Step(); | 126 State Step(); |
| 128 void Pause(); | 127 void Pause(); |
| 129 void Reset(); | 128 void Reset(); |
| 130 | 129 |
| 131 // Stack inspection and modification. | 130 // Stack inspection and modification. |
| 132 pc_t GetBreakpointPc(); | 131 pc_t GetBreakpointPc(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 private: | 203 private: |
| 205 Zone zone_; | 204 Zone zone_; |
| 206 WasmInterpreterInternals* internals_; | 205 WasmInterpreterInternals* internals_; |
| 207 }; | 206 }; |
| 208 | 207 |
| 209 } // namespace wasm | 208 } // namespace wasm |
| 210 } // namespace internal | 209 } // namespace internal |
| 211 } // namespace v8 | 210 } // namespace v8 |
| 212 | 211 |
| 213 #endif // V8_WASM_INTERPRETER_H_ | 212 #endif // V8_WASM_INTERPRETER_H_ |
| OLD | NEW |