diff --git a/src/objects/managed.h b/src/objects/managed.h index c3203df8a5..8d56a13aef 100644 --- a/src/objects/managed.h +++ b/src/objects/managed.h @@ -92,11 +92,12 @@ class Managed : public Foreign { // Create a {Managed} from an existing {std::shared_ptr}. static Handle> FromSharedPtr( Isolate* isolate, size_t estimated_size, - const std::shared_ptr& shared_ptr) { + std::shared_ptr shared_ptr) { reinterpret_cast(isolate) ->AdjustAmountOfExternalAllocatedMemory(estimated_size); auto destructor = new ManagedPtrDestructor( - estimated_size, new std::shared_ptr{shared_ptr}, Destructor); + estimated_size, new std::shared_ptr{std::move(shared_ptr)}, + Destructor); Handle> handle = Handle>::cast( isolate->factory()->NewForeign(reinterpret_cast
(destructor))); Handle global_handle = isolate->global_handles()->Create(*handle); diff --git a/src/wasm/module-compiler.cc b/src/wasm/module-compiler.cc index 74c4382456..6074836e41 100644 --- a/src/wasm/module-compiler.cc +++ b/src/wasm/module-compiler.cc @@ -1602,11 +1602,9 @@ void AsyncCompileJob::PrepareRuntimeObjects() { // Create heap objects for script and module bytes to be stored in the // module object. Asm.js is not compiled asynchronously. DCHECK(module_object_.is_null()); - const WasmModule* module = native_module_->module(); auto source_url = stream_ ? stream_->url() : Vector(); auto script = isolate_->wasm_engine()->GetOrCreateScript( - isolate_, native_module_.get(), VectorOf(module->source_map_url), - module->name, source_url); + isolate_, native_module_, source_url); Handle module_object = WasmModuleObject::New(isolate_, native_module_, script); @@ -2996,71 +2994,6 @@ WasmCode* CompileImportWrapper( return published_code; } -Handle