Bug 1290337 - Part 1: Make ArgSeq and ArgList not to drop qualifier from argument types. r=nbp,jwalden
authorTooru Fujisawa <arai_a@mac.com>
Sun, 11 Sep 2016 18:15:21 +0900
changeset 316046 95c5ce6ed75dd9427d4eb9eac65704260074d577
parent 316045 108c16a295e740c0b095c762d7211fad50e9375c
child 316047 a3a7f0fa1186ada56b6a66f1181069790c61a3bd
push id30759
push userphilringnalda@gmail.com
push dateSat, 01 Oct 2016 06:25:09 +0000
treeherdermozilla-central@fcc62bbf09ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp, jwalden
bugs1290337
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1290337 - Part 1: Make ArgSeq and ArgList not to drop qualifier from argument types. r=nbp,jwalden
js/src/jit/shared/CodeGenerator-shared.h
--- a/js/src/jit/shared/CodeGenerator-shared.h
+++ b/js/src/jit/shared/CodeGenerator-shared.h
@@ -644,37 +644,39 @@ class ArgSeq<>
     inline void generate(CodeGeneratorShared* codegen) const {
     }
 };
 
 template <typename HeadType, typename... TailTypes>
 class ArgSeq<HeadType, TailTypes...> : public ArgSeq<TailTypes...>
 {
   private:
-    HeadType head_;
+    using RawHeadType = typename mozilla::RemoveReference<HeadType>::Type;
+    RawHeadType head_;
 
   public:
-    explicit ArgSeq(HeadType&& head, TailTypes&&... tail)
-      : ArgSeq<TailTypes...>(mozilla::Move(tail)...),
-        head_(mozilla::Move(head))
+    template <typename ProvidedHead, typename... ProvidedTail>
+    explicit ArgSeq(ProvidedHead&& head, ProvidedTail&&... tail)
+      : ArgSeq<TailTypes...>(mozilla::Forward<ProvidedTail>(tail)...),
+        head_(mozilla::Forward<ProvidedHead>(head))
     { }
 
     // Arguments are pushed in reverse order, from last argument to first
     // argument.
     inline void generate(CodeGeneratorShared* codegen) const {
         this->ArgSeq<TailTypes...>::generate(codegen);
         codegen->pushArg(head_);
     }
 };
 
 template <typename... ArgTypes>
 inline ArgSeq<ArgTypes...>
-ArgList(ArgTypes... args)
+ArgList(ArgTypes&&... args)
 {
-    return ArgSeq<ArgTypes...>(mozilla::Move(args)...);
+    return ArgSeq<ArgTypes...>(mozilla::Forward<ArgTypes>(args)...);
 }
 
 // Store wrappers, to generate the right move of data after the VM call.
 
 struct StoreNothing
 {
     inline void generate(CodeGeneratorShared* codegen) const {
     }