Bug 905210: Use a member initializer list in VMFunction for better codegen with static data. r=nbp
authorDavid Major <dmajor@mozilla.com>
Wed, 01 Feb 2017 12:18:12 +1300
changeset 331946 097237b12c7af50158d853ff1abdb2e2590aed10
parent 331945 e46a1e9ecb7ae720f8c0a500c84962b83f2c1617
child 331947 661cad778f950879e02c62fcd7dc06381243b7ff
push id31291
push usercbook@mozilla.com
push dateWed, 01 Feb 2017 12:14:40 +0000
treeherdermozilla-central@9e7b1041929f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs905210
milestone54.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 905210: Use a member initializer list in VMFunction for better codegen with static data. r=nbp MozReview-Commit-ID: 5XrMBkusm8p
js/src/jit/VMFunctions.h
--- a/js/src/jit/VMFunctions.h
+++ b/js/src/jit/VMFunctions.h
@@ -221,40 +221,53 @@ struct VMFunction
         // few loop iterations)
         while (n) {
             count++;
             n &= n - 1;
         }
         return count;
     }
 
+    constexpr
     VMFunction(void* wrapped, const char* name, uint32_t explicitArgs, uint32_t argumentProperties,
                uint32_t argumentPassedInFloatRegs, uint64_t argRootTypes,
                DataType outParam, RootType outParamRootType, DataType returnType,
                uint32_t extraValuesToPop = 0, MaybeTailCall expectTailCall = NonTailCall)
-      : wrapped(wrapped),
+      : next(nullptr),
+        wrapped(wrapped),
         name_(name),
         explicitArgs(explicitArgs),
         argumentProperties(argumentProperties),
         argumentPassedInFloatRegs(argumentPassedInFloatRegs),
         outParam(outParam),
         returnType(returnType),
         argumentRootTypes(argRootTypes),
         outParamRootType(outParamRootType),
         extraValuesToPop(extraValuesToPop),
         expectTailCall(expectTailCall)
+    { }
+
+    VMFunction(const VMFunction& o)
+      : next(nullptr),
+        wrapped(o.wrapped),
+        name_(o.name_),
+        explicitArgs(o.explicitArgs),
+        argumentProperties(o.argumentProperties),
+        argumentPassedInFloatRegs(o.argumentPassedInFloatRegs),
+        outParam(o.outParam),
+        returnType(o.returnType),
+        argumentRootTypes(o.argumentRootTypes),
+        outParamRootType(o.outParamRootType),
+        extraValuesToPop(o.extraValuesToPop),
+        expectTailCall(o.expectTailCall)
     {
         // Check for valid failure/return type.
         MOZ_ASSERT_IF(outParam != Type_Void, returnType == Type_Bool);
         MOZ_ASSERT(returnType == Type_Bool ||
                    returnType == Type_Object);
-    }
-
-    VMFunction(const VMFunction& o) {
-        *this = o;
         addToFunctions();
     }
 
   private:
     // Add this to the global list of VMFunctions.
     void addToFunctions();
 };