[cleanup] Remove unnecessary copies from general classes.

Fixing clang-tidy warning.

Bug: v8:8015
Change-Id: I829fe79b95a0275ccc94e32fea2cdc74affef714
Reviewed-on: https://chromium-review.googlesource.com/1228066
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Florian Sattler <sattlerf@google.com>
Cr-Commit-Position: refs/heads/master@{#56050}
This commit is contained in:
Florian Sattler 2018-09-17 19:24:39 +02:00 committed by Commit Bot
parent ba463e55e8
commit 03f7ce40cf
3 changed files with 5 additions and 3 deletions

View File

@ -299,7 +299,9 @@ class CodeStubDescriptor {
DCHECK(!stack_parameter_count_.is_valid());
}
void set_call_descriptor(CallInterfaceDescriptor d) { call_descriptor_ = d; }
void set_call_descriptor(CallInterfaceDescriptor d) {
call_descriptor_ = std::move(d);
}
CallInterfaceDescriptor call_descriptor() const { return call_descriptor_; }
int GetRegisterParameterCount() const {

View File

@ -83,7 +83,7 @@ class BuiltinDeserializerAllocator final {
// Builtin deserialization does not bake reservations into the snapshot, hence
// this is a nop.
void DecodeReservation(std::vector<SerializedData::Reservation> res) {}
void DecodeReservation(const std::vector<SerializedData::Reservation>& res) {}
// These methods are used to pre-allocate builtin objects prior to
// deserialization.

View File

@ -2472,7 +2472,7 @@ class AsyncCompileJob::PrepareAndStartCompile : public CompileStep {
public:
PrepareAndStartCompile(std::shared_ptr<const WasmModule> module,
bool start_compilation)
: module_(module), start_compilation_(start_compilation) {}
: module_(std::move(module)), start_compilation_(start_compilation) {}
private:
std::shared_ptr<const WasmModule> module_;