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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 end_ = end; | 274 end_ = end; |
275 error_pc_ = nullptr; | 275 error_pc_ = nullptr; |
276 error_pt_ = nullptr; | 276 error_pt_ = nullptr; |
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() { return start_; } | 284 const byte* start() const { return start_; } |
285 const byte* pc() { return pc_; } | 285 const byte* pc() const { return pc_; } |
286 uint32_t pc_offset() { return static_cast<uint32_t>(pc_ - start_); } | 286 uint32_t pc_offset() const { return static_cast<uint32_t>(pc_ - start_); } |
287 | 287 |
288 protected: | 288 protected: |
289 const byte* start_; | 289 const byte* start_; |
290 const byte* pc_; | 290 const byte* pc_; |
291 const byte* end_; | 291 const byte* end_; |
292 const byte* error_pc_; | 292 const byte* error_pc_; |
293 const byte* error_pt_; | 293 const byte* error_pt_; |
294 std::unique_ptr<char[]> error_msg_; | 294 std::unique_ptr<char[]> error_msg_; |
295 | 295 |
296 private: | 296 private: |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 return traceOffEnd<uint32_t>(); | 388 return traceOffEnd<uint32_t>(); |
389 } | 389 } |
390 }; | 390 }; |
391 | 391 |
392 #undef TRACE | 392 #undef TRACE |
393 } // namespace wasm | 393 } // namespace wasm |
394 } // namespace internal | 394 } // namespace internal |
395 } // namespace v8 | 395 } // namespace v8 |
396 | 396 |
397 #endif // V8_WASM_DECODER_H_ | 397 #endif // V8_WASM_DECODER_H_ |
OLD | NEW |