Commit 34a8204a authored by Choongwoo Han's avatar Choongwoo Han Committed by Commit Bot

[wasm] Set wasm_compiled_module for script of deserialized module

Bug: chromium:808980
Change-Id: I7a89c6e30f473821f676fd5771365103072c78f1
Reviewed-on: https://chromium-review.googlesource.com/901306Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51099}
parent 544c9705
...@@ -737,6 +737,7 @@ MaybeHandle<WasmCompiledModule> DeserializeNativeModule( ...@@ -737,6 +737,7 @@ MaybeHandle<WasmCompiledModule> DeserializeNativeModule(
export_wrappers, std::vector<wasm::GlobalHandleAddress>(), export_wrappers, std::vector<wasm::GlobalHandleAddress>(),
trap_handler::IsTrapHandlerEnabled()); trap_handler::IsTrapHandlerEnabled());
compiled_module->OnWasmModuleDecodingComplete(shared); compiled_module->OnWasmModuleDecodingComplete(shared);
script->set_wasm_compiled_module(*compiled_module);
NativeModuleDeserializer deserializer(isolate, NativeModuleDeserializer deserializer(isolate,
compiled_module->GetNativeModule()); compiled_module->GetNativeModule());
if (!deserializer.Read(data)) return {}; if (!deserializer.Read(data)) return {};
......
// Copyright 2018 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.
// Flags: --allow-natives-syntax --throws
load('test/mjsunit/wasm/wasm-constants.js');
load('test/mjsunit/wasm/wasm-module-builder.js');
let kTableSize = 3;
var builder = new WasmModuleBuilder();
var sig_index1 = builder.addType(kSig_i_v);
builder.addFunction('main', kSig_i_ii).addBody([
kExprGetLocal,
0,
kExprCallIndirect,
sig_index1,
kTableZero
]).exportAs('main');
builder.setFunctionTableBounds(kTableSize, kTableSize);
var m1_bytes = builder.toBuffer();
var m1 = new WebAssembly.Module(m1_bytes);
var serialized_m1 = %SerializeWasmModule(m1);
var m1_clone = %DeserializeWasmModule(serialized_m1, m1_bytes);
var i1 = new WebAssembly.Instance(m1_clone);
i1.exports.main(123123);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment