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

Side by Side Diff: src/wasm/decoder.h

Issue 2610813009: [wasm] factor lower level utilties out of WasmFullDecoder (Closed)
Patch Set: harden decl decoding Created 3 years, 11 months 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 | « no previous file | src/wasm/function-body-decoder.h » ('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 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
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/wasm/function-body-decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698