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

Unified Diff: test/mjsunit/wasm/instantiate-module-basic.js

Issue 2306403002: Revert of [wasm] reuse the first compiled module (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/wasm/compiled-module-management.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/instantiate-module-basic.js
diff --git a/test/mjsunit/wasm/instantiate-module-basic.js b/test/mjsunit/wasm/instantiate-module-basic.js
index 04fc903010db1b17935e374df2f72820d92488df..0328bad31b76abd2787fec520b14ca6c9b1329c4 100644
--- a/test/mjsunit/wasm/instantiate-module-basic.js
+++ b/test/mjsunit/wasm/instantiate-module-basic.js
@@ -155,50 +155,24 @@
})();
(function GlobalsArePrivateToTheInstance() {
- var builder = new WasmModuleBuilder();
- builder.addGlobal(kAstI32);
- builder.addFunction("read", kSig_i_v)
- .addBody([
- kExprGetGlobal, 0])
- .exportFunc();
+ var builder = new WasmModuleBuilder();
+ builder.addGlobal(kAstI32);
+ builder.addFunction("read", kSig_i_v)
+ .addBody([
+ kExprGetGlobal, 0])
+ .exportFunc();
- builder.addFunction("write", kSig_v_i)
- .addBody([
- kExprGetLocal, 0,
- kExprSetGlobal, 0])
- .exportFunc();
-
- var module = new WebAssembly.Module(builder.toBuffer());
- var i1 = new WebAssembly.Instance(module);
- var i2 = new WebAssembly.Instance(module);
- i1.exports.write(1);
- i2.exports.write(2);
- assertEquals(1, i1.exports.read());
- assertEquals(2, i2.exports.read());
-})();
-
-
-(function InstanceMemoryIsIsolated() {
- var builder = new WasmModuleBuilder();
- builder.addMemory(1,1, true);
-
- builder.addFunction("f", kSig_i)
+ builder.addFunction("write", kSig_v_i)
.addBody([
- kExprI32Const, 0,
- kExprI32LoadMem, 0, 0
- ]).exportFunc();
-
- var mem_1 = new ArrayBuffer(65536);
- var mem_2 = new ArrayBuffer(65536);
- var view_1 = new Int32Array(mem_1);
- var view_2 = new Int32Array(mem_2);
- view_1[0] = 1;
- view_2[0] = 1000;
+ kExprGetLocal, 0,
+ kExprSetGlobal, 0])
+ .exportFunc();
var module = new WebAssembly.Module(builder.toBuffer());
- var i1 = new WebAssembly.Instance(module, null, mem_1);
- var i2 = new WebAssembly.Instance(module, null, mem_2);
-
- assertEquals(1, i1.exports.f());
- assertEquals(1000, i2.exports.f());
+ var i1 = new WebAssembly.Instance(module);
+ var i2 = new WebAssembly.Instance(module);
+ i1.exports.write(1);
+ i2.exports.write(2);
+ assertEquals(1, i1.exports.read());
+ assertEquals(2, i2.exports.read());
})();
« no previous file with comments | « test/mjsunit/wasm/compiled-module-management.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698