Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: test/mjsunit/regress/regress-608630.js

Issue 2264913002: [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/mjsunit/regress/regress-605488.js ('k') | test/mjsunit/regress/regress-613928.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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: --validate-asm --allow-natives-syntax
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 = {};
11 11
12 try { 12 try {
13 __v_1 = 1; 13 __v_1 = 1;
14 __v_2 = { 14 __v_2 = {
15 get: function() { return function() {} }, 15 get: function() { return function() {} },
(...skipping 13 matching lines...) Expand all
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 module_func = eval(__v_1);
40 var __v_6 = module_func({}, __v_3);
41 assertTrue(%IsAsmWasmCode(module_func));
40 expect(__v_6); 42 expect(__v_6);
41 } 43 }
42 function __f_2() { 44 function __f_2() {
43 "use asm"; 45 "use asm";
44 function __f_3() { return 0; } 46 function __f_3() { return 0; }
45 function __f_4() { return 1; } 47 function __f_4() { return 1; }
46 function __f_5() { return 4; } 48 function __f_5() { return 4; }
47 function __f_6() { return 64; } 49 function __f_6() { return 64; }
48 function __f_7() { return 137; } 50 function __f_7() { return 137; }
49 function __f_8() { return 128; } 51 function __f_8() { return 128; }
(...skipping 10 matching lines...) Expand all
60 assertEquals(1, module.__f_4()); 62 assertEquals(1, module.__f_4());
61 assertEquals(4, module.__f_5()); 63 assertEquals(4, module.__f_5());
62 assertEquals(64, module.__f_6()); 64 assertEquals(64, module.__f_6());
63 assertEquals(128, module.__f_8()); 65 assertEquals(128, module.__f_8());
64 assertEquals(-1, module.__f_9()); 66 assertEquals(-1, module.__f_9());
65 assertEquals(1000, module.__f_10()); 67 assertEquals(1000, module.__f_10());
66 assertEquals(2000000, module.__f_11()); 68 assertEquals(2000000, module.__f_11());
67 assertEquals(2147483647, module.__f_12()); 69 assertEquals(2147483647, module.__f_12());
68 }); 70 });
69 } catch(e) { print("Caught: " + e); } 71 } catch(e) { print("Caught: " + e); }
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-605488.js ('k') | test/mjsunit/regress/regress-613928.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698