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

Side by Side Diff: test/mjsunit/wasm/wasm-constants.js

Issue 1744713003: [wasm] Add an export table. (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/export-table.js ('k') | test/unittests/wasm/module-decoder-unittest.cc » ('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 function bytes() { 7 function bytes() {
8 var buffer = new ArrayBuffer(arguments.length); 8 var buffer = new ArrayBuffer(arguments.length);
9 var view = new Uint8Array(buffer); 9 var view = new Uint8Array(buffer);
10 for (var i = 0; i < arguments.length; i++) { 10 for (var i = 0; i < arguments.length; i++) {
11 var val = arguments[i]; 11 var val = arguments[i];
12 if ((typeof val) == "string") val = val.charCodeAt(0); 12 if ((typeof val) == "string") val = val.charCodeAt(0);
13 view[i] = val | 0; 13 view[i] = val | 0;
14 } 14 }
15 return buffer; 15 return buffer;
16 } 16 }
17 17
18 // Section declaration constants 18 // Section declaration constants
19 var kDeclMemory = 0x00; 19 var kDeclMemory = 0x00;
20 var kDeclSignatures = 0x01; 20 var kDeclSignatures = 0x01;
21 var kDeclFunctions = 0x02; 21 var kDeclFunctions = 0x02;
22 var kDeclGlobals = 0x03; 22 var kDeclGlobals = 0x03;
23 var kDeclDataSegments = 0x04; 23 var kDeclDataSegments = 0x04;
24 var kDeclFunctionTable = 0x05; 24 var kDeclFunctionTable = 0x05;
25 var kDeclStartFunction = 0x07; 25 var kDeclStartFunction = 0x07;
26 var kDeclImportTable = 0x08; 26 var kDeclImportTable = 0x08;
27 var kDeclExportTable = 0x09;
27 var kDeclEnd = 0x06; 28 var kDeclEnd = 0x06;
28 29
29 // Function declaration flags 30 // Function declaration flags
30 var kDeclFunctionName = 0x01; 31 var kDeclFunctionName = 0x01;
31 var kDeclFunctionImport = 0x02; 32 var kDeclFunctionImport = 0x02;
32 var kDeclFunctionLocals = 0x04; 33 var kDeclFunctionLocals = 0x04;
33 var kDeclFunctionExport = 0x08; 34 var kDeclFunctionExport = 0x08;
34 35
35 // Local types 36 // Local types
36 var kAstStmt = 0; 37 var kAstStmt = 0;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 243 }
243 threwException = false; 244 threwException = false;
244 } catch (e) { 245 } catch (e) {
245 assertEquals("string", typeof e); 246 assertEquals("string", typeof e);
246 assertEquals(kTrapMsgs[trap], e); 247 assertEquals(kTrapMsgs[trap], e);
247 // Success. 248 // Success.
248 return; 249 return;
249 } 250 }
250 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap] ); 251 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap] );
251 } 252 }
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/export-table.js ('k') | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698