OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_AST_DECODER_H_ | 5 #ifndef V8_WASM_AST_DECODER_H_ |
6 #define V8_WASM_AST_DECODER_H_ | 6 #define V8_WASM_AST_DECODER_H_ |
7 | 7 |
8 #include "src/signature.h" | 8 #include "src/signature.h" |
9 #include "src/wasm/decoder.h" | 9 #include "src/wasm/decoder.h" |
10 #include "src/wasm/wasm-opcodes.h" | 10 #include "src/wasm/wasm-opcodes.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 case kAstF32: | 212 case kAstF32: |
213 local_f32_count += count; | 213 local_f32_count += count; |
214 break; | 214 break; |
215 case kAstF64: | 215 case kAstF64: |
216 local_f64_count += count; | 216 local_f64_count += count; |
217 break; | 217 break; |
218 default: | 218 default: |
219 UNREACHABLE(); | 219 UNREACHABLE(); |
220 } | 220 } |
221 total_locals += count; | 221 total_locals += count; |
222 DCHECK(total_locals == | 222 DCHECK_EQ(total_locals, |
223 (sig->parameter_count() + local_i32_count + local_i64_count + | 223 (sig->parameter_count() + local_i32_count + local_i64_count + |
224 local_f32_count + local_f64_count)); | 224 local_f32_count + local_f64_count)); |
225 } | 225 } |
226 | 226 |
227 void SumLocals() { | 227 void SumLocals() { |
228 total_locals = static_cast<uint32_t>(sig->parameter_count()) + | 228 total_locals = static_cast<uint32_t>(sig->parameter_count()) + |
229 local_i32_count + local_i64_count + local_f32_count + | 229 local_i32_count + local_i64_count + local_f32_count + |
230 local_f64_count; | 230 local_f64_count; |
231 } | 231 } |
232 }; | 232 }; |
233 | 233 |
234 struct Tree; | 234 struct Tree; |
(...skipping 29 matching lines...) Expand all Loading... |
264 // Computes the length of the opcode at the given address. | 264 // Computes the length of the opcode at the given address. |
265 int OpcodeLength(const byte* pc, const byte* end); | 265 int OpcodeLength(const byte* pc, const byte* end); |
266 | 266 |
267 // Computes the arity (number of sub-nodes) of the opcode at the given address. | 267 // Computes the arity (number of sub-nodes) of the opcode at the given address. |
268 int OpcodeArity(FunctionEnv* env, const byte* pc, const byte* end); | 268 int OpcodeArity(FunctionEnv* env, const byte* pc, const byte* end); |
269 } // namespace wasm | 269 } // namespace wasm |
270 } // namespace internal | 270 } // namespace internal |
271 } // namespace v8 | 271 } // namespace v8 |
272 | 272 |
273 #endif // V8_WASM_AST_DECODER_H_ | 273 #endif // V8_WASM_AST_DECODER_H_ |
OLD | NEW |