| 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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1023     ValueTypeCode t = static_cast<ValueTypeCode>(val); | 1023     ValueTypeCode t = static_cast<ValueTypeCode>(val); | 
| 1024     switch (t) { | 1024     switch (t) { | 
| 1025       case kLocalI32: | 1025       case kLocalI32: | 
| 1026         return kWasmI32; | 1026         return kWasmI32; | 
| 1027       case kLocalI64: | 1027       case kLocalI64: | 
| 1028         return kWasmI64; | 1028         return kWasmI64; | 
| 1029       case kLocalF32: | 1029       case kLocalF32: | 
| 1030         return kWasmF32; | 1030         return kWasmF32; | 
| 1031       case kLocalF64: | 1031       case kLocalF64: | 
| 1032         return kWasmF64; | 1032         return kWasmF64; | 
| 1033       case kLocalS128: | 1033       default: | 
| 1034         if (origin_ != kAsmJsOrigin && FLAG_wasm_simd_prototype) { | 1034         if (origin_ != kAsmJsOrigin && FLAG_wasm_simd_prototype) { | 
| 1035           return kWasmS128; | 1035           switch (t) { | 
| 1036         } else { | 1036             case kLocalS128: | 
| 1037           error(pc_ - 1, "invalid local type"); | 1037               return kWasmS128; | 
| 1038           return kWasmStmt; | 1038             case kLocalS1x4: | 
|  | 1039               return kWasmS1x4; | 
|  | 1040             case kLocalS1x8: | 
|  | 1041               return kWasmS1x8; | 
|  | 1042             case kLocalS1x16: | 
|  | 1043               return kWasmS1x16; | 
|  | 1044             default: | 
|  | 1045               break; | 
|  | 1046           } | 
| 1039         } | 1047         } | 
| 1040       default: |  | 
| 1041         error(pc_ - 1, "invalid local type"); | 1048         error(pc_ - 1, "invalid local type"); | 
| 1042         return kWasmStmt; | 1049         return kWasmStmt; | 
| 1043     } | 1050     } | 
| 1044   } | 1051   } | 
| 1045 | 1052 | 
| 1046   // Parses a type entry, which is currently limited to functions only. | 1053   // Parses a type entry, which is currently limited to functions only. | 
| 1047   FunctionSig* consume_sig() { | 1054   FunctionSig* consume_sig() { | 
| 1048     if (!expect_u8("type form", kWasmFunctionTypeForm)) return nullptr; | 1055     if (!expect_u8("type form", kWasmFunctionTypeForm)) return nullptr; | 
| 1049     // parse parameter types | 1056     // parse parameter types | 
| 1050     uint32_t param_count = | 1057     uint32_t param_count = | 
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1298     result.push_back({section_start, name_offset, name_length, payload_offset, | 1305     result.push_back({section_start, name_offset, name_length, payload_offset, | 
| 1299                       payload_length, section_length}); | 1306                       payload_length, section_length}); | 
| 1300   } | 1307   } | 
| 1301 | 1308 | 
| 1302   return result; | 1309   return result; | 
| 1303 } | 1310 } | 
| 1304 | 1311 | 
| 1305 }  // namespace wasm | 1312 }  // namespace wasm | 
| 1306 }  // namespace internal | 1313 }  // namespace internal | 
| 1307 }  // namespace v8 | 1314 }  // namespace v8 | 
| OLD | NEW | 
|---|