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

Side by Side Diff: test/mjsunit/wasm/instantiate-module-basic.js

Issue 1740373002: [wasm] Add a magic word and a version number to the binary. (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/indirect-calls.js ('k') | test/mjsunit/wasm/instantiate-run-basic.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 // Flags: --expose-wasm 5 // Flags: --expose-wasm
6 6
7 load("test/mjsunit/wasm/wasm-constants.js"); 7 load("test/mjsunit/wasm/wasm-constants.js");
8 8
9 var kReturnValue = 117; 9 var kReturnValue = 117;
10 10
11 var kBodySize = 2; 11 var kBodySize = 2;
12 var kNameOffset = 19 + kBodySize + 1; 12 var kNameOffset = kHeaderSize + 19 + kBodySize + 1;
13 13
14 var data = bytes( 14 var data = bytesWithHeader(
15 // -- memory 15 // -- memory
16 kDeclMemory, 16 kDeclMemory,
17 10, 10, 1, 17 10, 10, 1,
18 // -- signatures 18 // -- signatures
19 kDeclSignatures, 1, 19 kDeclSignatures, 1,
20 0, kAstI32, // signature: void -> int 20 0, kAstI32, // signature: void -> int
21 // -- main function 21 // -- main function
22 kDeclFunctions, 1, 22 kDeclFunctions, 1,
23 kDeclFunctionName | kDeclFunctionExport, 23 kDeclFunctionName | kDeclFunctionExport,
24 0, 0, // signature index 24 0, 0, // signature index
(...skipping 28 matching lines...) Expand all
53 53
54 assertEquals(1024, module.memory.byteLength); 54 assertEquals(1024, module.memory.byteLength);
55 55
56 // Check the properties of the main function. 56 // Check the properties of the main function.
57 assertFalse(module.main === undefined); 57 assertFalse(module.main === undefined);
58 assertFalse(module.main === null); 58 assertFalse(module.main === null);
59 assertFalse(module.main === 0); 59 assertFalse(module.main === 0);
60 assertEquals("function", typeof module.main); 60 assertEquals("function", typeof module.main);
61 61
62 assertEquals(kReturnValue, module.main()); 62 assertEquals(kReturnValue, module.main());
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/indirect-calls.js ('k') | test/mjsunit/wasm/instantiate-run-basic.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698