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

Side by Side Diff: test/unittests/wasm/module-decoder-unittest.cc

Issue 1742073002: [wasm] Properly plumb the origin of the WASM module from asm.js translation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « test/mjsunit/wasm/asm-wasm.js ('k') | no next file » | 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 "test/unittests/test-utils.h" 5 #include "test/unittests/test-utils.h"
6 6
7 #include "src/wasm/module-decoder.h" 7 #include "src/wasm/module-decoder.h"
8 #include "src/wasm/wasm-opcodes.h" 8 #include "src/wasm/wasm-opcodes.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 12 matching lines...) Expand all
23 #define SIG_INDEX(v) U16(v) 23 #define SIG_INDEX(v) U16(v)
24 #define FUNC_INDEX(v) U16(v) 24 #define FUNC_INDEX(v) U16(v)
25 #define NAME_OFFSET(v) U32(v) 25 #define NAME_OFFSET(v) U32(v)
26 26
27 #define EMPTY_FUNCTION(sig_index) 0, SIG_INDEX(sig_index), U16(0) 27 #define EMPTY_FUNCTION(sig_index) 0, SIG_INDEX(sig_index), U16(0)
28 28
29 class WasmModuleVerifyTest : public TestWithZone { 29 class WasmModuleVerifyTest : public TestWithZone {
30 public: 30 public:
31 ModuleResult DecodeModule(const byte* module_start, const byte* module_end) { 31 ModuleResult DecodeModule(const byte* module_start, const byte* module_end) {
32 return DecodeWasmModule(nullptr, zone(), module_start, module_end, false, 32 return DecodeWasmModule(nullptr, zone(), module_start, module_end, false,
33 false); 33 kWasmOrigin);
34 } 34 }
35 }; 35 };
36 36
37 37
38 #define EXPECT_VERIFIES(data) \ 38 #define EXPECT_VERIFIES(data) \
39 do { \ 39 do { \
40 ModuleResult result = DecodeModule(data, data + arraysize(data)); \ 40 ModuleResult result = DecodeModule(data, data + arraysize(data)); \
41 EXPECT_TRUE(result.ok()); \ 41 EXPECT_TRUE(result.ok()); \
42 if (result.val) delete result.val; \ 42 if (result.val) delete result.val; \
43 } while (false) 43 } while (false)
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 for (int length = 13; length < sizeof(data); length++) { 1149 for (int length = 13; length < sizeof(data); length++) {
1150 ModuleResult result = DecodeModule(data, data + length); 1150 ModuleResult result = DecodeModule(data, data + length);
1151 EXPECT_FALSE(result.ok()); 1151 EXPECT_FALSE(result.ok());
1152 if (result.val) delete result.val; 1152 if (result.val) delete result.val;
1153 } 1153 }
1154 } 1154 }
1155 1155
1156 } // namespace wasm 1156 } // namespace wasm
1157 } // namespace internal 1157 } // namespace internal
1158 } // namespace v8 1158 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/asm-wasm.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698