Bug 1461556 - Initialize various asm.js structures using in-class initializers, not PodZero. r=jandem
authorJeff Walden <jwalden@mit.edu>
Wed, 16 May 2018 10:44:41 -0700
changeset 418610 19d2aace5b3c
parent 418609 2ddbcf79bc48
child 418611 d8411d78d58a
push id103351
push userjwalden@mit.edu
push dateThu, 17 May 2018 07:17:38 +0000
treeherdermozilla-inbound@e016aa76775e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1461556
milestone62.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 1461556 - Initialize various asm.js structures using in-class initializers, not PodZero. r=jandem
js/src/wasm/AsmJS.cpp
--- a/js/src/wasm/AsmJS.cpp
+++ b/js/src/wasm/AsmJS.cpp
@@ -248,24 +248,24 @@ class AsmJSImport
 
 typedef Vector<AsmJSImport, 0, SystemAllocPolicy> AsmJSImportVector;
 
 // An AsmJSExport logically extends Export with the extra information needed for
 // an asm.js exported function, viz., the offsets in module's source chars in
 // case the function is toString()ed.
 class AsmJSExport
 {
-    uint32_t funcIndex_;
+    uint32_t funcIndex_ = 0;
 
     // All fields are treated as cacheable POD:
-    uint32_t startOffsetInModule_;  // Store module-start-relative offsets
-    uint32_t endOffsetInModule_;    // so preserved by serialization.
+    uint32_t startOffsetInModule_ = 0;  // Store module-start-relative offsets
+    uint32_t endOffsetInModule_ = 0;    // so preserved by serialization.
 
   public:
-    AsmJSExport() { PodZero(this); }
+    AsmJSExport() = default;
     AsmJSExport(uint32_t funcIndex, uint32_t startOffsetInModule, uint32_t endOffsetInModule)
       : funcIndex_(funcIndex),
         startOffsetInModule_(startOffsetInModule),
         endOffsetInModule_(endOffsetInModule)
     {}
     uint32_t funcIndex() const {
         return funcIndex_;
     }
@@ -287,22 +287,22 @@ enum class CacheResult
 
 // Holds the immutable guts of an AsmJSModule.
 //
 // AsmJSMetadata is built incrementally by ModuleValidator and then shared
 // immutably between AsmJSModules.
 
 struct AsmJSMetadataCacheablePod
 {
-    uint32_t                numFFIs;
-    uint32_t                srcLength;
-    uint32_t                srcLengthWithRightBrace;
-    bool                    usesSimd;
-
-    AsmJSMetadataCacheablePod() { PodZero(this); }
+    uint32_t                numFFIs = 0;
+    uint32_t                srcLength = 0;
+    uint32_t                srcLengthWithRightBrace = 0;
+    bool                    usesSimd = false;
+
+    AsmJSMetadataCacheablePod() = default;
 };
 
 struct js::AsmJSMetadata : Metadata, AsmJSMetadataCacheablePod
 {
     AsmJSGlobalVector       asmJSGlobals;
     AsmJSImportVector       asmJSImports;
     AsmJSExportVector       asmJSExports;
     CacheableCharsVector    asmJSFuncNames;