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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 var kExprF64UConvertI64 = 0xb1; | 297 var kExprF64UConvertI64 = 0xb1; |
298 var kExprF64ConvertF32 = 0xb2; | 298 var kExprF64ConvertF32 = 0xb2; |
299 var kExprF64ReinterpretI64 = 0xb3; | 299 var kExprF64ReinterpretI64 = 0xb3; |
300 var kExprI32ReinterpretF32 = 0xb4; | 300 var kExprI32ReinterpretF32 = 0xb4; |
301 var kExprI64ReinterpretF64 = 0xb5; | 301 var kExprI64ReinterpretF64 = 0xb5; |
302 var kExprI32Ror = 0xb6; | 302 var kExprI32Ror = 0xb6; |
303 var kExprI32Rol = 0xb7; | 303 var kExprI32Rol = 0xb7; |
304 var kExprI64Ror = 0xb8; | 304 var kExprI64Ror = 0xb8; |
305 var kExprI64Rol = 0xb9; | 305 var kExprI64Rol = 0xb9; |
306 | 306 |
| 307 var kExprJITSingleFunction = 0xf0; |
| 308 |
307 var kTrapUnreachable = 0; | 309 var kTrapUnreachable = 0; |
308 var kTrapMemOutOfBounds = 1; | 310 var kTrapMemOutOfBounds = 1; |
309 var kTrapDivByZero = 2; | 311 var kTrapDivByZero = 2; |
310 var kTrapDivUnrepresentable = 3; | 312 var kTrapDivUnrepresentable = 3; |
311 var kTrapRemByZero = 4; | 313 var kTrapRemByZero = 4; |
312 var kTrapFloatUnrepresentable = 5; | 314 var kTrapFloatUnrepresentable = 5; |
313 var kTrapFuncInvalid = 6; | 315 var kTrapFuncInvalid = 6; |
314 var kTrapFuncSigMismatch = 7; | 316 var kTrapFuncSigMismatch = 7; |
315 var kTrapMemAllocationFail = 8; | 317 var kTrapMemAllocationFail = 8; |
316 | 318 |
(...skipping 19 matching lines...) Expand all Loading... |
336 } | 338 } |
337 threwException = false; | 339 threwException = false; |
338 } catch (e) { | 340 } catch (e) { |
339 assertEquals("object", typeof e); | 341 assertEquals("object", typeof e); |
340 assertEquals(kTrapMsgs[trap], e.message); | 342 assertEquals(kTrapMsgs[trap], e.message); |
341 // Success. | 343 // Success. |
342 return; | 344 return; |
343 } | 345 } |
344 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap]
); | 346 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap]
); |
345 } | 347 } |
OLD | NEW |