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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 var kAstStmt = 0; | 86 var kAstStmt = 0; |
87 var kAstI32 = 1; | 87 var kAstI32 = 1; |
88 var kAstI64 = 2; | 88 var kAstI64 = 2; |
89 var kAstF32 = 3; | 89 var kAstF32 = 3; |
90 var kAstF64 = 4; | 90 var kAstF64 = 4; |
91 | 91 |
92 // Useful signatures | 92 // Useful signatures |
93 var kSig_i = makeSig([], [kAstI32]); | 93 var kSig_i = makeSig([], [kAstI32]); |
94 var kSig_d = makeSig([], [kAstF64]); | 94 var kSig_d = makeSig([], [kAstF64]); |
95 var kSig_i_i = makeSig([kAstI32], [kAstI32]); | 95 var kSig_i_i = makeSig([kAstI32], [kAstI32]); |
| 96 var kSig_i_l = makeSig([kAstI64], [kAstI32]); |
96 var kSig_i_ii = makeSig([kAstI32, kAstI32], [kAstI32]); | 97 var kSig_i_ii = makeSig([kAstI32, kAstI32], [kAstI32]); |
97 var kSig_i_iii = makeSig([kAstI32, kAstI32, kAstI32], [kAstI32]); | 98 var kSig_i_iii = makeSig([kAstI32, kAstI32, kAstI32], [kAstI32]); |
98 var kSig_d_dd = makeSig([kAstF64, kAstF64], [kAstF64]); | 99 var kSig_d_dd = makeSig([kAstF64, kAstF64], [kAstF64]); |
99 var kSig_l_ll = makeSig([kAstI64, kAstI64], [kAstI64]); | 100 var kSig_l_ll = makeSig([kAstI64, kAstI64], [kAstI64]); |
100 var kSig_i_dd = makeSig([kAstF64, kAstF64], [kAstI32]); | 101 var kSig_i_dd = makeSig([kAstF64, kAstF64], [kAstI32]); |
101 var kSig_v_v = makeSig([], []); | 102 var kSig_v_v = makeSig([], []); |
102 var kSig_i_v = makeSig([], [kAstI32]); | 103 var kSig_i_v = makeSig([], [kAstI32]); |
103 var kSig_v_i = makeSig([kAstI32], []); | 104 var kSig_v_i = makeSig([kAstI32], []); |
104 var kSig_v_ii = makeSig([kAstI32, kAstI32], []); | 105 var kSig_v_ii = makeSig([kAstI32, kAstI32], []); |
105 var kSig_v_iii = makeSig([kAstI32, kAstI32, kAstI32], []); | 106 var kSig_v_iii = makeSig([kAstI32, kAstI32, kAstI32], []); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 } | 341 } |
341 threwException = false; | 342 threwException = false; |
342 } catch (e) { | 343 } catch (e) { |
343 assertEquals("object", typeof e); | 344 assertEquals("object", typeof e); |
344 assertEquals(kTrapMsgs[trap], e.message); | 345 assertEquals(kTrapMsgs[trap], e.message); |
345 // Success. | 346 // Success. |
346 return; | 347 return; |
347 } | 348 } |
348 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap]
); | 349 throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap]
); |
349 } | 350 } |
OLD | NEW |