| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 WasmFrame(const WasmFunction* function, int pc, int fp, int sp) | 95 WasmFrame(const WasmFunction* function, int pc, int fp, int sp) |
| 96 : function_(function), pc_(pc), fp_(fp), sp_(sp) {} | 96 : function_(function), pc_(pc), fp_(fp), sp_(sp) {} |
| 97 | 97 |
| 98 const WasmFunction* function_; | 98 const WasmFunction* function_; |
| 99 int pc_; | 99 int pc_; |
| 100 int fp_; | 100 int fp_; |
| 101 int sp_; | 101 int sp_; |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // An interpreter capable of executing WASM. | 104 // An interpreter capable of executing WASM. |
| 105 class WasmInterpreter { | 105 class V8_EXPORT_PRIVATE WasmInterpreter { |
| 106 public: | 106 public: |
| 107 // State machine for a Thread: | 107 // State machine for a Thread: |
| 108 // +---------------Run()-----------+ | 108 // +---------------Run()-----------+ |
| 109 // V | | 109 // V | |
| 110 // STOPPED ---Run()--> RUNNING ------Pause()-----+-> PAUSED <------+ | 110 // STOPPED ---Run()--> RUNNING ------Pause()-----+-> PAUSED <------+ |
| 111 // | | | / | | | 111 // | | | / | | |
| 112 // | | +---- Breakpoint ---+ +-- Step() --+ | 112 // | | +---- Breakpoint ---+ +-- Step() --+ |
| 113 // | | | 113 // | | |
| 114 // | +------------ Trap --------------> TRAPPED | 114 // | +------------ Trap --------------> TRAPPED |
| 115 // +------------- Finish -------------> FINISHED | 115 // +------------- Finish -------------> FINISHED |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 private: | 199 private: |
| 200 Zone zone_; | 200 Zone zone_; |
| 201 WasmInterpreterInternals* internals_; | 201 WasmInterpreterInternals* internals_; |
| 202 }; | 202 }; |
| 203 | 203 |
| 204 } // namespace wasm | 204 } // namespace wasm |
| 205 } // namespace internal | 205 } // namespace internal |
| 206 } // namespace v8 | 206 } // namespace v8 |
| 207 | 207 |
| 208 #endif // V8_WASM_INTERPRETER_H_ | 208 #endif // V8_WASM_INTERPRETER_H_ |
| OLD | NEW |