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

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

Issue 1765843002: wasm: use strings for section names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix some encoding. A few tests still fail. 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
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++) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 var kDeclNoLocals = 0; 51 var kDeclNoLocals = 0;
52 52
53 // Section declaration constants 53 // Section declaration constants
54 var kDeclMemory = 0x00; 54 var kDeclMemory = 0x00;
55 var kDeclSignatures = 0x01; 55 var kDeclSignatures = 0x01;
56 var kDeclFunctions = 0x02; 56 var kDeclFunctions = 0x02;
57 var kDeclGlobals = 0x03; 57 var kDeclGlobals = 0x03;
58 var kDeclDataSegments = 0x04; 58 var kDeclDataSegments = 0x04;
59 var kDeclFunctionTable = 0x05; 59 var kDeclFunctionTable = 0x05;
60 var kDeclEnd = 0x06;
60 var kDeclStartFunction = 0x07; 61 var kDeclStartFunction = 0x07;
61 var kDeclImportTable = 0x08; 62 var kDeclImportTable = 0x08;
62 var kDeclExportTable = 0x09; 63 var kDeclExportTable = 0x09;
63 var kDeclEnd = 0x06; 64
65 var section_names = [
66 "memory", "signatures", "functions", "globals", "data_segments",
67 "function_table", "end", "start_function", "import_table", "export_table"];
64 68
65 // Function declaration flags 69 // Function declaration flags
66 var kDeclFunctionName = 0x01; 70 var kDeclFunctionName = 0x01;
67 var kDeclFunctionImport = 0x02; 71 var kDeclFunctionImport = 0x02;
68 var kDeclFunctionLocals = 0x04; 72 var kDeclFunctionLocals = 0x04;
69 var kDeclFunctionExport = 0x08; 73 var kDeclFunctionExport = 0x08;
70 74
71 // Local types 75 // Local types
72 var kAstStmt = 0; 76 var kAstStmt = 0;
73 var kAstI32 = 1; 77 var kAstI32 = 1;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 286 }
283 threwException = false; 287 threwException = false;
284 } catch (e) { 288 } catch (e) {
285 assertEquals("string", typeof e); 289 assertEquals("string", typeof e);
286 assertEquals(kTrapMsgs[trap], e); 290 assertEquals(kTrapMsgs[trap], e);
287 // Success. 291 // Success.
288 return; 292 return;
289 } 293 }
290 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap] ); 294 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap] );
291 } 295 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698