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

Side by Side Diff: test/mjsunit/wasm/start-function.js

Issue 2591753002: [wasm] Implement correct 2-level namespace for imports. (Closed)
Patch Set: Fix debug tests Created 4 years 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/wasm/stackwalk.js ('k') | test/mjsunit/wasm/table.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: --expose-wasm
6 6
7 load("test/mjsunit/wasm/wasm-constants.js"); 7 load("test/mjsunit/wasm/wasm-constants.js");
8 load("test/mjsunit/wasm/wasm-module-builder.js"); 8 load("test/mjsunit/wasm/wasm-module-builder.js");
9 9
10 function instantiate(sig, body) { 10 function instantiate(sig, body) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 var module = builder.instantiate(); 93 var module = builder.instantiate();
94 var memory = module.exports.memory.buffer; 94 var memory = module.exports.memory.buffer;
95 var view = new Int8Array(memory); 95 var view = new Int8Array(memory);
96 assertEquals(77, view[0]); 96 assertEquals(77, view[0]);
97 })(); 97 })();
98 98
99 (function testStartFFI() { 99 (function testStartFFI() {
100 print("testStartFFI"); 100 print("testStartFFI");
101 var ranned = false; 101 var ranned = false;
102 var ffi = { foo : function() { 102 var ffi = {gak: {foo : function() {
103 print("we ranned at stert!"); 103 print("we ranned at stert!");
104 ranned = true; 104 ranned = true;
105 }}; 105 }}};
106 106
107 var builder = new WasmModuleBuilder(); 107 var builder = new WasmModuleBuilder();
108 var sig_index = builder.addType(kSig_v_v); 108 var sig_index = builder.addType(kSig_v_v);
109 109
110 builder.addImport("foo", sig_index); 110 builder.addImport("gak", "foo", sig_index);
111 var func = builder.addFunction("", sig_index) 111 var func = builder.addFunction("", sig_index)
112 .addBody([kExprCallFunction, 0]); 112 .addBody([kExprCallFunction, 0]);
113 113
114 builder.addStart(func.index); 114 builder.addStart(func.index);
115 115
116 var module = builder.instantiate(ffi); 116 var module = builder.instantiate(ffi);
117 assertTrue(ranned); 117 assertTrue(ranned);
118 })(); 118 })();
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/stackwalk.js ('k') | test/mjsunit/wasm/table.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698