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

Side by Side Diff: test/mjsunit/regress/wasm/regress-5860.js

Issue 2653533003: [wasm] Do not patch memory references in imported functions. (Closed)
Patch Set: ]This patch should apply Created 3 years, 11 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-objects.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 2017 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 load('test/mjsunit/wasm/wasm-constants.js');
8 load('test/mjsunit/wasm/wasm-module-builder.js');
9
10 let module1 = (() => {
11 let builder = new WasmModuleBuilder();
12 builder.addMemory(1, 1);
13 builder.addFunction('load', kSig_i_i)
14 .addBody([kExprI32Const, 0, kExprI32LoadMem, 0, 0])
15 .exportAs('load');
16 return new WebAssembly.Module(builder.toBuffer());
17 })();
18
19 let module2 = (() => {
20 let builder = new WasmModuleBuilder();
21 builder.addMemory(1, 1);
22 builder.addImport('A', 'load', kSig_i_i);
23 builder.addExportOfKind('load', kExternalFunction, 0);
24 return new WebAssembly.Module(builder.toBuffer());
25 })();
26
27 let instance1 = new WebAssembly.Instance(module1);
28 let instance2 = new WebAssembly.Instance(module2, {A: instance1.exports});
29
30 assertEquals(0, instance2.exports.load());
OLDNEW
« no previous file with comments | « src/wasm/wasm-objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698