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

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

Issue 2345593003: [wasm] Master CL for Binary 0xC changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix exceptions.js Created 4 years, 3 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
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } else { 201 } else {
202 TRACE("= %u\n", result); 202 TRACE("= %u\n", result);
203 } 203 }
204 return result; 204 return result;
205 } 205 }
206 return traceOffEnd<uint32_t>(); 206 return traceOffEnd<uint32_t>();
207 } 207 }
208 208
209 // Consume {size} bytes and send them to the bit bucket, advancing {pc_}. 209 // Consume {size} bytes and send them to the bit bucket, advancing {pc_}.
210 void consume_bytes(int size) { 210 void consume_bytes(int size) {
211 TRACE(" +%d %-20s: %d bytes\n", static_cast<int>(pc_ - start_), "skip",
212 size);
211 if (checkAvailable(size)) { 213 if (checkAvailable(size)) {
212 pc_ += size; 214 pc_ += size;
213 } else { 215 } else {
214 pc_ = limit_; 216 pc_ = limit_;
215 } 217 }
216 } 218 }
217 219
218 // Check that at least {size} bytes exist between {pc_} and {limit_}. 220 // Check that at least {size} bytes exist between {pc_} and {limit_}.
219 bool checkAvailable(int size) { 221 bool checkAvailable(int size) {
220 intptr_t pc_overflow_value = std::numeric_limits<intptr_t>::max() - size; 222 intptr_t pc_overflow_value = std::numeric_limits<intptr_t>::max() - size;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 return result; 373 return result;
372 } 374 }
373 }; 375 };
374 376
375 #undef TRACE 377 #undef TRACE
376 } // namespace wasm 378 } // namespace wasm
377 } // namespace internal 379 } // namespace internal
378 } // namespace v8 380 } // namespace v8
379 381
380 #endif // V8_WASM_DECODER_H_ 382 #endif // V8_WASM_DECODER_H_
OLDNEW
« src/wasm/ast-decoder.cc ('K') | « src/wasm/ast-decoder.cc ('k') | src/wasm/encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698