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_DECODER_H_ | 5 #ifndef V8_WASM_DECODER_H_ |
6 #define V8_WASM_DECODER_H_ | 6 #define V8_WASM_DECODER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/base/compiler-specific.h" | 10 #include "src/base/compiler-specific.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 error_msg_.reset(); | 277 error_msg_.reset(); |
278 } | 278 } |
279 | 279 |
280 bool ok() const { return error_msg_ == nullptr; } | 280 bool ok() const { return error_msg_ == nullptr; } |
281 bool failed() const { return !ok(); } | 281 bool failed() const { return !ok(); } |
282 bool more() const { return pc_ < end_; } | 282 bool more() const { return pc_ < end_; } |
283 | 283 |
284 const byte* start() const { return start_; } | 284 const byte* start() const { return start_; } |
285 const byte* pc() const { return pc_; } | 285 const byte* pc() const { return pc_; } |
286 uint32_t pc_offset() const { return static_cast<uint32_t>(pc_ - start_); } | 286 uint32_t pc_offset() const { return static_cast<uint32_t>(pc_ - start_); } |
| 287 const byte* end() const { return end_; } |
287 | 288 |
288 protected: | 289 protected: |
289 const byte* start_; | 290 const byte* start_; |
290 const byte* pc_; | 291 const byte* pc_; |
291 const byte* end_; | 292 const byte* end_; |
292 const byte* error_pc_; | 293 const byte* error_pc_; |
293 const byte* error_pt_; | 294 const byte* error_pt_; |
294 std::unique_ptr<char[]> error_msg_; | 295 std::unique_ptr<char[]> error_msg_; |
295 | 296 |
296 private: | 297 private: |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 return traceOffEnd<uint32_t>(); | 389 return traceOffEnd<uint32_t>(); |
389 } | 390 } |
390 }; | 391 }; |
391 | 392 |
392 #undef TRACE | 393 #undef TRACE |
393 } // namespace wasm | 394 } // namespace wasm |
394 } // namespace internal | 395 } // namespace internal |
395 } // namespace v8 | 396 } // namespace v8 |
396 | 397 |
397 #endif // V8_WASM_DECODER_H_ | 398 #endif // V8_WASM_DECODER_H_ |
OLD | NEW |