OLD | NEW |
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 kDeclStartFunction = 0x07; | 60 var kDeclStartFunction = 0x07; |
61 var kDeclImportTable = 0x08; | 61 var kDeclImportTable = 0x08; |
62 var kDeclExportTable = 0x09; | 62 var kDeclExportTable = 0x09; |
63 var kDeclEnd = 0x06; | 63 var kDeclEnd = 0x06; |
| 64 var kDeclFunctionSignatures = 0x0a; |
| 65 var kDeclFunctionBodies = 0x0b; |
| 66 var kDeclNames = 0x0c; |
64 | 67 |
65 // Function declaration flags | 68 // Function declaration flags |
66 var kDeclFunctionName = 0x01; | 69 var kDeclFunctionName = 0x01; |
67 var kDeclFunctionImport = 0x02; | 70 var kDeclFunctionImport = 0x02; |
68 var kDeclFunctionLocals = 0x04; | 71 var kDeclFunctionLocals = 0x04; |
69 var kDeclFunctionExport = 0x08; | 72 var kDeclFunctionExport = 0x08; |
70 | 73 |
71 // Local types | 74 // Local types |
72 var kAstStmt = 0; | 75 var kAstStmt = 0; |
73 var kAstI32 = 1; | 76 var kAstI32 = 1; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 285 } |
283 threwException = false; | 286 threwException = false; |
284 } catch (e) { | 287 } catch (e) { |
285 assertEquals("string", typeof e); | 288 assertEquals("string", typeof e); |
286 assertEquals(kTrapMsgs[trap], e); | 289 assertEquals(kTrapMsgs[trap], e); |
287 // Success. | 290 // Success. |
288 return; | 291 return; |
289 } | 292 } |
290 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap]
); | 293 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap]
); |
291 } | 294 } |
OLD | NEW |