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

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

Issue 2618743004: [wasm] some const annotations (Closed)
Patch Set: rebase 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 | no next file » | 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698