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

Unified Diff: test/mjsunit/wasm/compiled-module-serialization.js

Issue 2433273002: [wasm] Avoid double-serializing the wire bytes (Closed)
Patch Set: removed unrelated changes Created 4 years, 2 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 | « src/snapshot/code-serializer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/compiled-module-serialization.js
diff --git a/test/mjsunit/wasm/compiled-module-serialization.js b/test/mjsunit/wasm/compiled-module-serialization.js
index 96ebd8ab6359be6627dffd234b49b93fdbde610a..b5c25e0a0186b1014b710f9e7a16553dceb4cd60 100644
--- a/test/mjsunit/wasm/compiled-module-serialization.js
+++ b/test/mjsunit/wasm/compiled-module-serialization.js
@@ -35,12 +35,12 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
kExprCallFunction, 1]);
builder.appendToTable([2, 3]);
-
- var module = new WebAssembly.Module(builder.toBuffer());
+ var wire_bytes = builder.toBuffer();
+ var module = new WebAssembly.Module(wire_bytes);
var buff = %SerializeWasmModule(module);
module = null;
gc();
- module = %DeserializeWasmModule(buff);
+ module = %DeserializeWasmModule(buff, wire_bytes);
var mem_1 = new ArrayBuffer(4);
var view_1 = new Int32Array(mem_1);
@@ -59,7 +59,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
(function DeserializeInvalidObject() {
var invalid_buffer = new ArrayBuffer(10);
- module = %DeserializeWasmModule(invalid_buffer);
+ module = %DeserializeWasmModule(invalid_buffer, invalid_buffer);
assertEquals(module, undefined);
})();
@@ -69,9 +69,10 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
.addBody([kExprI8Const, 42])
.exportFunc();
- var compiled_module = new WebAssembly.Module(builder.toBuffer());
+ var wire_bytes = builder.toBuffer();
+ var compiled_module = new WebAssembly.Module(wire_bytes);
var serialized = %SerializeWasmModule(compiled_module);
- var clone = %DeserializeWasmModule(serialized);
+ var clone = %DeserializeWasmModule(serialized, wire_bytes);
assertNotNull(clone);
assertFalse(clone == undefined);
@@ -85,11 +86,12 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
.addBody([kExprI8Const, 42])
.exportFunc();
- var compiled_module = new WebAssembly.Module(builder.toBuffer());
+ var wire_bytes = builder.toBuffer()
+ var compiled_module = new WebAssembly.Module(wire_bytes);
var instance1 = new WebAssembly.Instance(compiled_module);
var instance2 = new WebAssembly.Instance(compiled_module);
var serialized = %SerializeWasmModule(compiled_module);
- var clone = %DeserializeWasmModule(serialized);
+ var clone = %DeserializeWasmModule(serialized, wire_bytes);
assertNotNull(clone);
assertFalse(clone == undefined);
« no previous file with comments | « src/snapshot/code-serializer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698