2020-10-23 13:58:59 +00:00
|
|
|
// Copyright 2020 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
// The test needs --wasm-tier-up because we can't serialize and deserialize
|
|
|
|
// Liftoff code.
|
|
|
|
// Flags: --expose-wasm --allow-natives-syntax --expose-gc --wasm-tier-up
|
|
|
|
|
2021-06-01 12:46:36 +00:00
|
|
|
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
|
2020-10-23 13:58:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
const wire_bytes = new WasmModuleBuilder().toBuffer();
|
|
|
|
|
|
|
|
const serialized = (() => {
|
|
|
|
return %SerializeWasmModule(new WebAssembly.Module(wire_bytes));
|
|
|
|
})();
|
|
|
|
|
|
|
|
// Collect the compiled module, to avoid sharing of the NativeModule.
|
|
|
|
gc();
|
|
|
|
|
|
|
|
const module = %DeserializeWasmModule(serialized, wire_bytes);
|
|
|
|
%SerializeWasmModule(module);
|