Commit a836dfb5 authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[wasm] Refactored function to no longer make copies

Bug: v8:8015
Change-Id: I4e4892f49de69b8c6c3347de024708997825cb44
Reviewed-on: https://chromium-review.googlesource.com/1209848Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Florian Sattler <sattlerf@google.com>
Cr-Commit-Position: refs/heads/master@{#55704}
parent 3d76e88f
...@@ -2822,7 +2822,7 @@ void CompilationState::SetNumberOfFunctionsToCompile(size_t num_functions) { ...@@ -2822,7 +2822,7 @@ void CompilationState::SetNumberOfFunctionsToCompile(size_t num_functions) {
void CompilationState::SetCallback( void CompilationState::SetCallback(
std::function<void(CompilationEvent, ErrorThrower*)> callback) { std::function<void(CompilationEvent, ErrorThrower*)> callback) {
DCHECK_NULL(callback_); DCHECK_NULL(callback_);
callback_ = callback; callback_ = std::move(callback);
} }
void CompilationState::AddCompilationUnits( void CompilationState::AddCompilationUnits(
......
...@@ -186,7 +186,7 @@ std::shared_ptr<NativeModule> WasmEngine::ExportNativeModule( ...@@ -186,7 +186,7 @@ std::shared_ptr<NativeModule> WasmEngine::ExportNativeModule(
} }
Handle<WasmModuleObject> WasmEngine::ImportNativeModule( Handle<WasmModuleObject> WasmEngine::ImportNativeModule(
Isolate* isolate, std::shared_ptr<NativeModule> shared_module) { Isolate* isolate, const std::shared_ptr<NativeModule>& shared_module) {
CHECK_EQ(code_manager(), shared_module->code_manager()); CHECK_EQ(code_manager(), shared_module->code_manager());
Vector<const byte> wire_bytes = shared_module->wire_bytes(); Vector<const byte> wire_bytes = shared_module->wire_bytes();
Handle<Script> script = CreateWasmScript(isolate, wire_bytes); Handle<Script> script = CreateWasmScript(isolate, wire_bytes);
......
...@@ -106,7 +106,7 @@ class V8_EXPORT_PRIVATE WasmEngine { ...@@ -106,7 +106,7 @@ class V8_EXPORT_PRIVATE WasmEngine {
// Imports the shared part of a module from a different Context/Isolate using // Imports the shared part of a module from a different Context/Isolate using
// the the same engine, recreating a full module object in the given Isolate. // the the same engine, recreating a full module object in the given Isolate.
Handle<WasmModuleObject> ImportNativeModule( Handle<WasmModuleObject> ImportNativeModule(
Isolate* isolate, std::shared_ptr<NativeModule> shared_module); Isolate* isolate, const std::shared_ptr<NativeModule>& shared_module);
WasmCodeManager* code_manager() const { return code_manager_.get(); } WasmCodeManager* code_manager() const { return code_manager_.get(); }
......
...@@ -149,7 +149,7 @@ ErrorThrower::ErrorThrower(ErrorThrower&& other) V8_NOEXCEPT ...@@ -149,7 +149,7 @@ ErrorThrower::ErrorThrower(ErrorThrower&& other) V8_NOEXCEPT
: isolate_(other.isolate_), : isolate_(other.isolate_),
context_(other.context_), context_(other.context_),
error_type_(other.error_type_), error_type_(other.error_type_),
error_msg_(other.error_msg_) { error_msg_(std::move(other.error_msg_)) {
other.error_type_ = kNone; other.error_type_ = kNone;
} }
......
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