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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 inline T to() const { | 83 inline T to() const { |
84 UNREACHABLE(); | 84 UNREACHABLE(); |
85 } | 85 } |
86 | 86 |
87 template <typename T> | 87 template <typename T> |
88 inline T to_unchecked() const { | 88 inline T to_unchecked() const { |
89 UNREACHABLE(); | 89 UNREACHABLE(); |
90 } | 90 } |
91 }; | 91 }; |
92 | 92 |
93 #define DECLARE_CAST(field, localtype, ctype) \ | 93 #define DECLARE_CASTS(field, localtype, ctype) \ |
94 template <> \ | 94 template <> \ |
95 inline ctype WasmVal::to_unchecked() const { \ | 95 inline ctype WasmVal::to_unchecked() const { \ |
96 return val.field; \ | 96 return val.field; \ |
97 } \ | 97 } \ |
98 template <> \ | 98 template <> \ |
99 inline ctype WasmVal::to() const { \ | 99 inline ctype WasmVal::to() const { \ |
100 CHECK_EQ(localtype, type); \ | 100 CHECK_EQ(localtype, type); \ |
101 return val.field; \ | 101 return val.field; \ |
102 } | 102 } |
103 FOREACH_UNION_MEMBER(DECLARE_CAST) | 103 FOREACH_UNION_MEMBER(DECLARE_CASTS) |
104 #undef DECLARE_CAST | 104 #undef DECLARE_CAST |
105 | 105 |
106 // Representation of frames within the interpreter. | 106 // Representation of frames within the interpreter. |
107 // | 107 // |
108 // Layout of a frame: | 108 // Layout of a frame: |
109 // ----------------- | 109 // ----------------- |
110 // stack slot #N ‾\. | 110 // stack slot #N ‾\. |
111 // ... | stack entries: GetStackHeight(); GetStackValue() | 111 // ... | stack entries: GetStackHeight(); GetStackValue() |
112 // stack slot #0 _/· | 112 // stack slot #0 _/· |
113 // local #L ‾\. | 113 // local #L ‾\. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 private: | 276 private: |
277 Zone zone_; | 277 Zone zone_; |
278 WasmInterpreterInternals* internals_; | 278 WasmInterpreterInternals* internals_; |
279 }; | 279 }; |
280 | 280 |
281 } // namespace wasm | 281 } // namespace wasm |
282 } // namespace internal | 282 } // namespace internal |
283 } // namespace v8 | 283 } // namespace v8 |
284 | 284 |
285 #endif // V8_WASM_INTERPRETER_H_ | 285 #endif // V8_WASM_INTERPRETER_H_ |
OLD | NEW |