OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 var __v_5 = {}; | 7 var __v_5 = {}; |
8 var __v_35 = {}; | 8 var __v_35 = {}; |
9 var __v_44 = {}; | 9 var __v_44 = {}; |
10 var __v_43 = {}; | 10 var __v_43 = {}; |
(...skipping 18 matching lines...) Expand all Loading... |
29 var __v_2 = __v_1.replace(new RegExp("use asm"), ""); | 29 var __v_2 = __v_1.replace(new RegExp("use asm"), ""); |
30 var __v_39 = {Math: Math}; | 30 var __v_39 = {Math: Math}; |
31 var __v_4 = eval("(" + __v_2 + ")")(__v_3); | 31 var __v_4 = eval("(" + __v_2 + ")")(__v_3); |
32 print("Testing " + asmfunc.name + " (js)..."); | 32 print("Testing " + asmfunc.name + " (js)..."); |
33 __v_44.valueOf = __v_43; | 33 __v_44.valueOf = __v_43; |
34 expect(__v_4); | 34 expect(__v_4); |
35 print("Testing " + asmfunc.name + " (asm.js)..."); | 35 print("Testing " + asmfunc.name + " (asm.js)..."); |
36 var __v_5 = asmfunc(__v_3); | 36 var __v_5 = asmfunc(__v_3); |
37 expect(__v_5); | 37 expect(__v_5); |
38 print("Testing " + asmfunc.name + " (wasm)..."); | 38 print("Testing " + asmfunc.name + " (wasm)..."); |
39 var __v_6 = Wasm.instantiateModuleFromAsm(__v_1, __v_3); | 39 var __v_6 = Wasm.instantiateModuleFromAsm(__v_1, {}, __v_3); |
40 expect(__v_6); | 40 expect(__v_6); |
41 } | 41 } |
42 function __f_2() { | 42 function __f_2() { |
43 "use asm"; | 43 "use asm"; |
44 function __f_3() { return 0; } | 44 function __f_3() { return 0; } |
45 function __f_4() { return 1; } | 45 function __f_4() { return 1; } |
46 function __f_5() { return 4; } | 46 function __f_5() { return 4; } |
47 function __f_6() { return 64; } | 47 function __f_6() { return 64; } |
48 function __f_7() { return 137; } | 48 function __f_7() { return 137; } |
49 function __f_8() { return 128; } | 49 function __f_8() { return 128; } |
(...skipping 10 matching lines...) Expand all Loading... |
60 assertEquals(1, module.__f_4()); | 60 assertEquals(1, module.__f_4()); |
61 assertEquals(4, module.__f_5()); | 61 assertEquals(4, module.__f_5()); |
62 assertEquals(64, module.__f_6()); | 62 assertEquals(64, module.__f_6()); |
63 assertEquals(128, module.__f_8()); | 63 assertEquals(128, module.__f_8()); |
64 assertEquals(-1, module.__f_9()); | 64 assertEquals(-1, module.__f_9()); |
65 assertEquals(1000, module.__f_10()); | 65 assertEquals(1000, module.__f_10()); |
66 assertEquals(2000000, module.__f_11()); | 66 assertEquals(2000000, module.__f_11()); |
67 assertEquals(2147483647, module.__f_12()); | 67 assertEquals(2147483647, module.__f_12()); |
68 }); | 68 }); |
69 } catch(e) { print("Caught: " + e); } | 69 } catch(e) { print("Caught: " + e); } |
OLD | NEW |