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

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

Issue 1943313002: [wasm] Fix for 608630: allow proxies as FFI. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --expose-wasm
6
7 var __v_5 = {};
8 var __v_35 = {};
9 var __v_44 = {};
10 var __v_43 = {};
11
12 try {
13 __v_1 = 1;
14 __v_2 = {
15 get: function() { return function() {} },
16 has() { return true },
17 getOwnPropertyDescriptor: function() {
18 if (__v_1-- == 0) throw "please die";
19 return {value: function() {}, configurable: true};
20 }
21 };
22 __v_3 = new Proxy({}, __v_2);
23 __v_30 = Object.create(__v_35);
24 with (__v_5) { f() }
25 } catch(e) { print("Caught: " + e); }
26
27 function __f_1(asmfunc, expect) {
28 var __v_1 = asmfunc.toString();
29 var __v_2 = __v_1.replace(new RegExp("use asm"), "");
30 var __v_39 = {Math: Math};
31 var __v_4 = eval("(" + __v_2 + ")")(__v_3);
32 print("Testing " + asmfunc.name + " (js)...");
33 __v_44.valueOf = __v_43;
34 expect(__v_4);
35 print("Testing " + asmfunc.name + " (asm.js)...");
36 var __v_5 = asmfunc(__v_3);
37 expect(__v_5);
38 print("Testing " + asmfunc.name + " (wasm)...");
39 var __v_6 = Wasm.instantiateModuleFromAsm(__v_1, __v_3);
40 expect(__v_6);
41 }
42 function __f_2() {
43 "use asm";
44 function __f_3() { return 0; }
45 function __f_4() { return 1; }
46 function __f_5() { return 4; }
47 function __f_6() { return 64; }
48 function __f_7() { return 137; }
49 function __f_8() { return 128; }
50 function __f_9() { return -1; }
51 function __f_10() { return 1000; }
52 function __f_11() { return 2000000; }
53 function __f_12() { return 2147483647; }
54 return {__f_3: __f_3, __f_4: __f_4, __f_5: __f_5, __f_6: __f_6, __f_7: __f_7, __f_8: __f_8,
55 __f_9: __f_9, __f_10: __f_10, __f_11, __f_12: __f_12};
56 }
57 try {
58 __f_1(__f_2, function(module) {
59 assertEquals(0, module.__f_3());
60 assertEquals(1, module.__f_4());
61 assertEquals(4, module.__f_5());
62 assertEquals(64, module.__f_6());
63 assertEquals(128, module.__f_8());
64 assertEquals(-1, module.__f_9());
65 assertEquals(1000, module.__f_10());
66 assertEquals(2000000, module.__f_11());
67 assertEquals(2147483647, module.__f_12());
68 });
69 } catch(e) { print("Caught: " + e); }
OLDNEW
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698