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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 let kExprSelect = 0x1b; | 160 let kExprSelect = 0x1b; |
161 let kExprGetLocal = 0x20; | 161 let kExprGetLocal = 0x20; |
162 let kExprSetLocal = 0x21; | 162 let kExprSetLocal = 0x21; |
163 let kExprTeeLocal = 0x22; | 163 let kExprTeeLocal = 0x22; |
164 let kExprGetGlobal = 0x23; | 164 let kExprGetGlobal = 0x23; |
165 let kExprSetGlobal = 0x24; | 165 let kExprSetGlobal = 0x24; |
166 let kExprI32Const = 0x41; | 166 let kExprI32Const = 0x41; |
167 let kExprI64Const = 0x42; | 167 let kExprI64Const = 0x42; |
168 let kExprF32Const = 0x43; | 168 let kExprF32Const = 0x43; |
169 let kExprF64Const = 0x44; | 169 let kExprF64Const = 0x44; |
170 let kExprI8Const = 0xcb; | |
171 let kExprI32LoadMem = 0x28; | 170 let kExprI32LoadMem = 0x28; |
172 let kExprI64LoadMem = 0x29; | 171 let kExprI64LoadMem = 0x29; |
173 let kExprF32LoadMem = 0x2a; | 172 let kExprF32LoadMem = 0x2a; |
174 let kExprF64LoadMem = 0x2b; | 173 let kExprF64LoadMem = 0x2b; |
175 let kExprI32LoadMem8S = 0x2c; | 174 let kExprI32LoadMem8S = 0x2c; |
176 let kExprI32LoadMem8U = 0x2d; | 175 let kExprI32LoadMem8U = 0x2d; |
177 let kExprI32LoadMem16S = 0x2e; | 176 let kExprI32LoadMem16S = 0x2e; |
178 let kExprI32LoadMem16U = 0x2f; | 177 let kExprI32LoadMem16U = 0x2f; |
179 let kExprI64LoadMem8S = 0x30; | 178 let kExprI64LoadMem8S = 0x30; |
180 let kExprI64LoadMem8U = 0x31; | 179 let kExprI64LoadMem8U = 0x31; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 eval(code); | 365 eval(code); |
367 } | 366 } |
368 } catch (e) { | 367 } catch (e) { |
369 assertEquals("number", typeof e); | 368 assertEquals("number", typeof e); |
370 assertEquals(value, e); | 369 assertEquals(value, e); |
371 // Success. | 370 // Success. |
372 return; | 371 return; |
373 } | 372 } |
374 throw new MjsUnitAssertionError("Did not throw at all, expected: " + value); | 373 throw new MjsUnitAssertionError("Did not throw at all, expected: " + value); |
375 } | 374 } |
OLD | NEW |