Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/wasm/module-decoder.cc

Issue 2400863003: [wasm] Simd128 types should not be available in asmjs modules. (Closed)
Patch Set: Fix test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | test/mjsunit/regress/wasm/regression-648079.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6
7 #include "src/base/functional.h" 7 #include "src/base/functional.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/flags.h"
9 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
10 #include "src/objects.h" 11 #include "src/objects.h"
11 #include "src/v8.h" 12 #include "src/v8.h"
12 13
13 #include "src/wasm/decoder.h" 14 #include "src/wasm/decoder.h"
14 15
15 namespace v8 { 16 namespace v8 {
16 namespace internal { 17 namespace internal {
17 namespace wasm { 18 namespace wasm {
18 19
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 switch (t) { 926 switch (t) {
926 case kLocalI32: 927 case kLocalI32:
927 return kAstI32; 928 return kAstI32;
928 case kLocalI64: 929 case kLocalI64:
929 return kAstI64; 930 return kAstI64;
930 case kLocalF32: 931 case kLocalF32:
931 return kAstF32; 932 return kAstF32;
932 case kLocalF64: 933 case kLocalF64:
933 return kAstF64; 934 return kAstF64;
934 case kLocalS128: 935 case kLocalS128:
935 return kAstS128; 936 if (origin_ != kAsmJsOrigin && FLAG_wasm_simd_prototype) {
937 return kAstS128;
938 } else {
939 error(pc_ - 1, "invalid local type");
940 return kAstStmt;
941 }
936 default: 942 default:
937 error(pc_ - 1, "invalid local type"); 943 error(pc_ - 1, "invalid local type");
938 return kAstStmt; 944 return kAstStmt;
939 } 945 }
940 } 946 }
941 947
942 // Parses a type entry, which is currently limited to functions only. 948 // Parses a type entry, which is currently limited to functions only.
943 FunctionSig* consume_sig() { 949 FunctionSig* consume_sig() {
944 if (!expect_u8("type form", kWasmFunctionTypeForm)) return nullptr; 950 if (!expect_u8("type form", kWasmFunctionTypeForm)) return nullptr;
945 // parse parameter types 951 // parse parameter types
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 decoder.consume_bytes(size); 1121 decoder.consume_bytes(size);
1116 } 1122 }
1117 if (decoder.more()) decoder.error("unexpected additional bytes"); 1123 if (decoder.more()) decoder.error("unexpected additional bytes");
1118 1124
1119 return decoder.toResult(std::move(table)); 1125 return decoder.toResult(std::move(table));
1120 } 1126 }
1121 1127
1122 } // namespace wasm 1128 } // namespace wasm
1123 } // namespace internal 1129 } // namespace internal
1124 } // namespace v8 1130 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | test/mjsunit/regress/wasm/regression-648079.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698