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 #include "src/wasm/module-decoder.h" | 5 #include "src/wasm/module-decoder.h" |
6 #include "src/wasm/function-body-decoder-impl.h" | 6 #include "src/wasm/function-body-decoder-impl.h" |
7 | 7 |
8 #include "src/base/functional.h" | 8 #include "src/base/functional.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/flags.h" | 10 #include "src/flags.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 if (magic_word != kWasmMagic) { | 265 if (magic_word != kWasmMagic) { |
266 error(pos, pos, | 266 error(pos, pos, |
267 "expected magic word %02x %02x %02x %02x, " | 267 "expected magic word %02x %02x %02x %02x, " |
268 "found %02x %02x %02x %02x", | 268 "found %02x %02x %02x %02x", |
269 BYTES(kWasmMagic), BYTES(magic_word)); | 269 BYTES(kWasmMagic), BYTES(magic_word)); |
270 } | 270 } |
271 | 271 |
272 pos = pc_; | 272 pos = pc_; |
273 { | 273 { |
274 uint32_t magic_version = consume_u32("wasm version"); | 274 uint32_t magic_version = consume_u32("wasm version"); |
275 if (magic_version != kWasmVersion && | 275 if (magic_version != kWasmVersion) { |
276 magic_version != kWasmLegacyVersion) { | |
277 error(pos, pos, | 276 error(pos, pos, |
278 "expected version %02x %02x %02x %02x, " | 277 "expected version %02x %02x %02x %02x, " |
279 "found %02x %02x %02x %02x", | 278 "found %02x %02x %02x %02x", |
280 BYTES(kWasmVersion), BYTES(magic_version)); | 279 BYTES(kWasmVersion), BYTES(magic_version)); |
281 } | 280 } |
282 } | 281 } |
283 | 282 |
284 WasmSectionIterator section_iter(*this); | 283 WasmSectionIterator section_iter(*this); |
285 | 284 |
286 // ===== Type section ==================================================== | 285 // ===== Type section ==================================================== |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 result.push_back({section_start, name_offset, name_length, payload_offset, | 1337 result.push_back({section_start, name_offset, name_length, payload_offset, |
1339 payload_length, section_length}); | 1338 payload_length, section_length}); |
1340 } | 1339 } |
1341 | 1340 |
1342 return result; | 1341 return result; |
1343 } | 1342 } |
1344 | 1343 |
1345 } // namespace wasm | 1344 } // namespace wasm |
1346 } // namespace internal | 1345 } // namespace internal |
1347 } // namespace v8 | 1346 } // namespace v8 |
OLD | NEW |