diff options
Diffstat (limited to 'deps/v8/src/wasm/wasm-serialization.cc')
-rw-r--r-- | deps/v8/src/wasm/wasm-serialization.cc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/deps/v8/src/wasm/wasm-serialization.cc b/deps/v8/src/wasm/wasm-serialization.cc index 773a709721c..8df5d4c88ee 100644 --- a/deps/v8/src/wasm/wasm-serialization.cc +++ b/deps/v8/src/wasm/wasm-serialization.cc @@ -10,7 +10,6 @@ #include "src/objects/objects.h" #include "src/runtime/runtime.h" #include "src/snapshot/code-serializer.h" -#include "src/snapshot/serializer-common.h" #include "src/utils/ostreams.h" #include "src/utils/utils.h" #include "src/utils/version.h" @@ -301,8 +300,7 @@ NativeModuleSerializer::NativeModuleSerializer( size_t NativeModuleSerializer::MeasureCode(const WasmCode* code) const { if (code == nullptr) return sizeof(bool); - DCHECK(code->kind() == WasmCode::kFunction || - code->kind() == WasmCode::kInterpreterEntry); + DCHECK_EQ(WasmCode::kFunction, code->kind()); return kCodeHeaderSize + code->instructions().size() + code->reloc_info().size() + code->source_positions().size() + code->protected_instructions_data().size(); @@ -330,8 +328,7 @@ void NativeModuleSerializer::WriteCode(const WasmCode* code, Writer* writer) { return; } writer->Write(true); - DCHECK(code->kind() == WasmCode::kFunction || - code->kind() == WasmCode::kInterpreterEntry); + DCHECK_EQ(WasmCode::kFunction, code->kind()); // Write the size of the entire code section, followed by the code header. writer->Write(code->constant_pool_offset()); writer->Write(code->safepoint_table_offset()); @@ -611,9 +608,6 @@ MaybeHandle<WasmModuleObject> DeserializeNativeModule( if (decode_result.failed()) return {}; std::shared_ptr<WasmModule> module = std::move(decode_result.value()); CHECK_NOT_NULL(module); - Handle<Script> script = CreateWasmScript(isolate, wire_bytes_vec, - VectorOf(module->source_map_url), - module->name, source_url); auto shared_native_module = wasm_engine->MaybeGetNativeModule( module->origin, wire_bytes_vec, isolate); @@ -641,6 +635,8 @@ MaybeHandle<WasmModuleObject> DeserializeNativeModule( CompileJsToWasmWrappers(isolate, shared_native_module->module(), &export_wrappers); + Handle<Script> script = + wasm_engine->GetOrCreateScript(isolate, shared_native_module, source_url); Handle<WasmModuleObject> module_object = WasmModuleObject::New( isolate, std::move(shared_native_module), script, export_wrappers); |