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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 var kExprI32ReinterpretF32 = 0xb4; | 304 var kExprI32ReinterpretF32 = 0xb4; |
305 var kExprI64ReinterpretF64 = 0xb5; | 305 var kExprI64ReinterpretF64 = 0xb5; |
306 var kExprI32Ror = 0xb6; | 306 var kExprI32Ror = 0xb6; |
307 var kExprI32Rol = 0xb7; | 307 var kExprI32Rol = 0xb7; |
308 var kExprI64Ror = 0xb8; | 308 var kExprI64Ror = 0xb8; |
309 var kExprI64Rol = 0xb9; | 309 var kExprI64Rol = 0xb9; |
310 var kExprSimdPrefix = 0xe5; | 310 var kExprSimdPrefix = 0xe5; |
311 var kExprI32x4Splat = 0x1b; | 311 var kExprI32x4Splat = 0x1b; |
312 var kExprI32x4ExtractLane = 0x1c; | 312 var kExprI32x4ExtractLane = 0x1c; |
313 | 313 |
314 var kExprJITSingleFunction = 0xf0; | |
315 | |
316 var kTrapUnreachable = 0; | 314 var kTrapUnreachable = 0; |
317 var kTrapMemOutOfBounds = 1; | 315 var kTrapMemOutOfBounds = 1; |
318 var kTrapDivByZero = 2; | 316 var kTrapDivByZero = 2; |
319 var kTrapDivUnrepresentable = 3; | 317 var kTrapDivUnrepresentable = 3; |
320 var kTrapRemByZero = 4; | 318 var kTrapRemByZero = 4; |
321 var kTrapFloatUnrepresentable = 5; | 319 var kTrapFloatUnrepresentable = 5; |
322 var kTrapFuncInvalid = 6; | 320 var kTrapFuncInvalid = 6; |
323 var kTrapFuncSigMismatch = 7; | 321 var kTrapFuncSigMismatch = 7; |
324 var kTrapInvalidIndex = 8; | 322 var kTrapInvalidIndex = 8; |
325 | 323 |
(...skipping 19 matching lines...) Expand all Loading... |
345 } | 343 } |
346 threwException = false; | 344 threwException = false; |
347 } catch (e) { | 345 } catch (e) { |
348 assertEquals("object", typeof e); | 346 assertEquals("object", typeof e); |
349 assertEquals(kTrapMsgs[trap], e.message); | 347 assertEquals(kTrapMsgs[trap], e.message); |
350 // Success. | 348 // Success. |
351 return; | 349 return; |
352 } | 350 } |
353 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap]
); | 351 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap]
); |
354 } | 352 } |
OLD | NEW |