| 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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 ValueTypeCode t = static_cast<ValueTypeCode>(val); | 1056 ValueTypeCode t = static_cast<ValueTypeCode>(val); |
| 1057 switch (t) { | 1057 switch (t) { |
| 1058 case kLocalI32: | 1058 case kLocalI32: |
| 1059 return kWasmI32; | 1059 return kWasmI32; |
| 1060 case kLocalI64: | 1060 case kLocalI64: |
| 1061 return kWasmI64; | 1061 return kWasmI64; |
| 1062 case kLocalF32: | 1062 case kLocalF32: |
| 1063 return kWasmF32; | 1063 return kWasmF32; |
| 1064 case kLocalF64: | 1064 case kLocalF64: |
| 1065 return kWasmF64; | 1065 return kWasmF64; |
| 1066 case kLocalS128: | 1066 default: |
| 1067 if (origin_ != kAsmJsOrigin && FLAG_wasm_simd_prototype) { | 1067 if (origin_ != kAsmJsOrigin && FLAG_wasm_simd_prototype) { |
| 1068 return kWasmS128; | 1068 switch (t) { |
| 1069 } else { | 1069 case kLocalS128: |
| 1070 error(pc_ - 1, "invalid local type"); | 1070 return kWasmS128; |
| 1071 return kWasmStmt; | 1071 case kLocalS1x4: |
| 1072 return kWasmS1x4; |
| 1073 case kLocalS1x8: |
| 1074 return kWasmS1x8; |
| 1075 case kLocalS1x16: |
| 1076 return kWasmS1x16; |
| 1077 default: |
| 1078 break; |
| 1079 } |
| 1072 } | 1080 } |
| 1073 default: | |
| 1074 error(pc_ - 1, "invalid local type"); | 1081 error(pc_ - 1, "invalid local type"); |
| 1075 return kWasmStmt; | 1082 return kWasmStmt; |
| 1076 } | 1083 } |
| 1077 } | 1084 } |
| 1078 | 1085 |
| 1079 // Parses a type entry, which is currently limited to functions only. | 1086 // Parses a type entry, which is currently limited to functions only. |
| 1080 FunctionSig* consume_sig() { | 1087 FunctionSig* consume_sig() { |
| 1081 if (!expect_u8("type form", kWasmFunctionTypeForm)) return nullptr; | 1088 if (!expect_u8("type form", kWasmFunctionTypeForm)) return nullptr; |
| 1082 // parse parameter types | 1089 // parse parameter types |
| 1083 uint32_t param_count = | 1090 uint32_t param_count = |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1331 result.push_back({section_start, name_offset, name_length, payload_offset, | 1338 result.push_back({section_start, name_offset, name_length, payload_offset, |
| 1332 payload_length, section_length}); | 1339 payload_length, section_length}); |
| 1333 } | 1340 } |
| 1334 | 1341 |
| 1335 return result; | 1342 return result; |
| 1336 } | 1343 } |
| 1337 | 1344 |
| 1338 } // namespace wasm | 1345 } // namespace wasm |
| 1339 } // namespace internal | 1346 } // namespace internal |
| 1340 } // namespace v8 | 1347 } // namespace v8 |
| OLD | NEW |