Commit 4fe70280 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Don't pass rvalue references

std::unique_ptr should never be passed by rvalue reference. This is
also not allowed by our style guide. Instead, just pass it by value.

R=ahaas@chromium.org

Bug: v8:7570
Change-Id: I525d3b4fd88e6ea47b22a517714a713dbb711ef8
Reviewed-on: https://chromium-review.googlesource.com/999419Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52475}
parent c65fbba6
......@@ -76,7 +76,7 @@ class CompilationState {
base::RandomNumberGenerator* random_number_generator,
size_t max_memory = 0);
void Schedule(std::unique_ptr<compiler::WasmCompilationUnit>&& item);
void Schedule(std::unique_ptr<compiler::WasmCompilationUnit> item);
bool IsEmpty() const { return schedule_.empty(); }
......@@ -3025,7 +3025,7 @@ CompilationState::CodeGenerationSchedule::CodeGenerationSchedule(
}
void CompilationState::CodeGenerationSchedule::Schedule(
std::unique_ptr<compiler::WasmCompilationUnit>&& item) {
std::unique_ptr<compiler::WasmCompilationUnit> item) {
size_t cost = item->memory_cost();
schedule_.push_back(std::move(item));
allocated_memory_.Increment(cost);
......
......@@ -149,12 +149,12 @@ class V8_EXPORT_PRIVATE WasmCode final {
private:
friend class NativeModule;
WasmCode(Vector<byte> instructions,
std::unique_ptr<const byte[]>&& reloc_info, size_t reloc_size,
std::unique_ptr<const byte[]>&& source_pos, size_t source_pos_size,
NativeModule* native_module, Maybe<uint32_t> index, Kind kind,
size_t constant_pool_offset, uint32_t stack_slots,
size_t safepoint_table_offset, size_t handler_table_offset,
WasmCode(Vector<byte> instructions, std::unique_ptr<const byte[]> reloc_info,
size_t reloc_size, std::unique_ptr<const byte[]> source_pos,
size_t source_pos_size, NativeModule* native_module,
Maybe<uint32_t> index, Kind kind, size_t constant_pool_offset,
uint32_t stack_slots, size_t safepoint_table_offset,
size_t handler_table_offset,
std::shared_ptr<ProtectedInstructions> protected_instructions,
Tier tier)
: instructions_(instructions),
......
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