From 4e7c416dc47e3df07ac1d8192d108f32028f3199 Mon Sep 17 00:00:00 2001 From: Clemens Hammacher Date: Mon, 8 May 2017 11:51:55 +0200 Subject: [PATCH] [wasm] Fix for perfect forwarding We don't currently depend on this, but it might improve performance by avoiding intermediate copies. The functions are already set up for perfect forwarding, but without declaring the parameters as forwarding references, this does not work as expected. R=ahaas@chromium.org Change-Id: I2c4d96ea1108b3f884d3e581e74c20aafd232934 Reviewed-on: https://chromium-review.googlesource.com/497409 Reviewed-by: Andreas Haas Commit-Queue: Clemens Hammacher Cr-Commit-Position: refs/heads/master@{#45158} --- src/wasm/wasm-module.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc index c1cac681f1..fc2ddb6ee9 100644 --- a/src/wasm/wasm-module.cc +++ b/src/wasm/wasm-module.cc @@ -2668,7 +2668,7 @@ class AsyncCompileJob { }; template - void DoSync(Args... args) { + void DoSync(Args&&... args) { static_assert(Task::type == SYNC, "Scheduled type must be sync"); Task* task = new Task(std::forward(args)...); task->job_ = this; @@ -2677,7 +2677,7 @@ class AsyncCompileJob { } template - void DoAsync(Args... args) { + void DoAsync(Args&&... args) { static_assert(Task::type == ASYNC, "Scheduled type must be async"); Task* task = new Task(std::forward(args)...); task->job_ = this;