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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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: { | 184 case kDeclWLL: { |
185 // Reserved for experimentation by the Web Low-level Language project | 185 // Reserved for experimentation by the Web Low-level Language project |
186 // which is augmenting the binary encoding with source code meta | 186 // which is augmenting the binary encoding with source code meta |
187 // information. This section does not affect the semantics of the code | 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 | 188 // and can be ignored by the runtime. https://github.com/JSStats/wll |
189 int length; | 189 int length = 0; |
190 uint32_t section_size = u32v(&length, "section size"); | 190 uint32_t section_size = u32v(&length, "section size"); |
191 if (pc_ + section_size > limit_ || pc_ + section_size < pc_) { | 191 if (pc_ + section_size > limit_ || pc_ + section_size < pc_) { |
192 error(pc_ - length, "invalid section size"); | 192 error(pc_ - length, "invalid section size"); |
193 break; | 193 break; |
194 } | 194 } |
195 pc_ += section_size; | 195 pc_ += section_size; |
196 break; | 196 break; |
197 } | 197 } |
198 default: | 198 default: |
199 error(pc_ - 1, nullptr, "unrecognized section 0x%02x", section); | 199 error(pc_ - 1, nullptr, "unrecognized section 0x%02x", section); |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 if (function_start > function_end) return FunctionError("start > end"); | 557 if (function_start > function_end) return FunctionError("start > end"); |
558 if (size > kMaxFunctionSize) | 558 if (size > kMaxFunctionSize) |
559 return FunctionError("size > maximum function size"); | 559 return FunctionError("size > maximum function size"); |
560 WasmFunction* function = new WasmFunction(); | 560 WasmFunction* function = new WasmFunction(); |
561 ModuleDecoder decoder(zone, function_start, function_end, false); | 561 ModuleDecoder decoder(zone, function_start, function_end, false); |
562 return decoder.DecodeSingleFunction(module_env, function); | 562 return decoder.DecodeSingleFunction(module_env, function); |
563 } | 563 } |
564 } // namespace wasm | 564 } // namespace wasm |
565 } // namespace internal | 565 } // namespace internal |
566 } // namespace v8 | 566 } // namespace v8 |
OLD | NEW |