| 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/macro-assembler.h" | 5 #include "src/macro-assembler.h" |
| 6 #include "src/objects.h" | 6 #include "src/objects.h" |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/wasm/decoder.h" | 9 #include "src/wasm/decoder.h" |
| 10 #include "src/wasm/module-decoder.h" | 10 #include "src/wasm/module-decoder.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 static_cast<int>(pc_ - start_)); | 174 static_cast<int>(pc_ - start_)); |
| 175 uint16_t index = u16(); | 175 uint16_t index = u16(); |
| 176 if (index >= module->functions->size()) { | 176 if (index >= module->functions->size()) { |
| 177 error(pc_ - 2, "invalid function index"); | 177 error(pc_ - 2, "invalid function index"); |
| 178 break; | 178 break; |
| 179 } | 179 } |
| 180 module->function_table->push_back(index); | 180 module->function_table->push_back(index); |
| 181 } | 181 } |
| 182 break; | 182 break; |
| 183 } | 183 } |
| 184 case kDeclWLL: { |
| 185 // Reserved for experimentation by the Web Low-level Language project |
| 186 // which is augmenting the binary encoding with source code meta |
| 187 // information. This section does not affect the semantics of the code |
| 188 // and can be ignored by the runtime. https://github.com/JSStats/wll |
| 189 int length; |
| 190 uint32_t section_size = u32v(&length, "section size"); |
| 191 if (pc_ + section_size > limit_ || pc_ + section_size < pc_) { |
| 192 error(pc_ - length, "invalid section size"); |
| 193 break; |
| 194 } |
| 195 pc_ += section_size; |
| 196 break; |
| 197 } |
| 184 default: | 198 default: |
| 185 error(pc_ - 1, nullptr, "unrecognized section 0x%02x", section); | 199 error(pc_ - 1, nullptr, "unrecognized section 0x%02x", section); |
| 186 break; | 200 break; |
| 187 } | 201 } |
| 188 } | 202 } |
| 189 | 203 |
| 190 return toResult(module); | 204 return toResult(module); |
| 191 } | 205 } |
| 192 | 206 |
| 193 uint32_t SafeReserve(uint32_t count) { | 207 uint32_t SafeReserve(uint32_t count) { |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 if (function_start > function_end) return FunctionError("start > end"); | 538 if (function_start > function_end) return FunctionError("start > end"); |
| 525 if (size > kMaxFunctionSize) | 539 if (size > kMaxFunctionSize) |
| 526 return FunctionError("size > maximum function size"); | 540 return FunctionError("size > maximum function size"); |
| 527 WasmFunction* function = new WasmFunction(); | 541 WasmFunction* function = new WasmFunction(); |
| 528 ModuleDecoder decoder(zone, function_start, function_end, false); | 542 ModuleDecoder decoder(zone, function_start, function_end, false); |
| 529 return decoder.DecodeSingleFunction(module_env, function); | 543 return decoder.DecodeSingleFunction(module_env, function); |
| 530 } | 544 } |
| 531 } // namespace wasm | 545 } // namespace wasm |
| 532 } // namespace internal | 546 } // namespace internal |
| 533 } // namespace v8 | 547 } // namespace v8 |
| OLD | NEW |