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

Side by Side Diff: src/wasm/wasm-interpreter.h

Issue 2540133002: [wasm] Remove raw byte pointers from WasmModule (Closed)
Patch Set: Address comments 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 | « src/wasm/module-decoder.cc ('k') | src/wasm/wasm-interpreter.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 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
11 namespace v8 { 11 namespace v8 {
12 namespace base { 12 namespace base {
13 class AccountingAllocator; 13 class AccountingAllocator;
14 } 14 }
15 15
16 namespace internal { 16 namespace internal {
17 namespace wasm { 17 namespace wasm {
18 18
19 // forward declarations. 19 // forward declarations.
20 struct ModuleBytesEnv;
20 struct WasmFunction; 21 struct WasmFunction;
21 struct WasmInstance;
22 class WasmInterpreterInternals; 22 class WasmInterpreterInternals;
23 23
24 typedef size_t pc_t; 24 typedef size_t pc_t;
25 typedef size_t sp_t; 25 typedef size_t sp_t;
26 typedef int32_t pcdiff_t; 26 typedef int32_t pcdiff_t;
27 typedef uint32_t spdiff_t; 27 typedef uint32_t spdiff_t;
28 28
29 const pc_t kInvalidPc = 0x80000000; 29 const pc_t kInvalidPc = 0x80000000;
30 30
31 typedef ZoneMap<pc_t, pcdiff_t> ControlTransferMap; 31 typedef ZoneMap<pc_t, pcdiff_t> ControlTransferMap;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Returns true if the thread executed an instruction which may produce 128 // Returns true if the thread executed an instruction which may produce
129 // nondeterministic results, e.g. float div, float sqrt, and float mul, 129 // nondeterministic results, e.g. float div, float sqrt, and float mul,
130 // where the sign bit of a NaN is nondeterministic. 130 // where the sign bit of a NaN is nondeterministic.
131 virtual bool PossibleNondeterminism() = 0; 131 virtual bool PossibleNondeterminism() = 0;
132 132
133 // Thread-specific breakpoints. 133 // Thread-specific breakpoints.
134 bool SetBreakpoint(const WasmFunction* function, int pc, bool enabled); 134 bool SetBreakpoint(const WasmFunction* function, int pc, bool enabled);
135 bool GetBreakpoint(const WasmFunction* function, int pc); 135 bool GetBreakpoint(const WasmFunction* function, int pc);
136 }; 136 };
137 137
138 WasmInterpreter(WasmInstance* instance, AccountingAllocator* allocator); 138 WasmInterpreter(const ModuleBytesEnv& env, AccountingAllocator* allocator);
139 ~WasmInterpreter(); 139 ~WasmInterpreter();
140 140
141 //========================================================================== 141 //==========================================================================
142 // Execution controls. 142 // Execution controls.
143 //========================================================================== 143 //==========================================================================
144 void Run(); 144 void Run();
145 void Pause(); 145 void Pause();
146 146
147 // Set a breakpoint at {pc} in {function} to be {enabled}. Returns the 147 // Set a breakpoint at {pc} in {function} to be {enabled}. Returns the
148 // previous state of the breakpoint at {pc}. 148 // previous state of the breakpoint at {pc}.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 private: 194 private:
195 Zone zone_; 195 Zone zone_;
196 WasmInterpreterInternals* internals_; 196 WasmInterpreterInternals* internals_;
197 }; 197 };
198 198
199 } // namespace wasm 199 } // namespace wasm
200 } // namespace internal 200 } // namespace internal
201 } // namespace v8 201 } // namespace v8
202 202
203 #endif // V8_WASM_INTERPRETER_H_ 203 #endif // V8_WASM_INTERPRETER_H_
OLDNEW
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | src/wasm/wasm-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698