Bug 1416185 - Fix Clang warning about unused private field in ScriptPcIterator. r=nbp
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 15 Nov 2017 13:51:43 +0100
changeset 391985 815b8640da1e3029dd680e4187b68852d36e2a4e
parent 391984 4162a11c0a7e692cf8bfdf27b66363201823c354
child 391986 53015dab607555789926343c75a478f10337df0b
push id32909
push usercbrindusan@mozilla.com
push dateWed, 15 Nov 2017 22:25:14 +0000
treeherdermozilla-central@f41930a869a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1416185
milestone59.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 1416185 - Fix Clang warning about unused private field in ScriptPcIterator. r=nbp
js/src/jit/JitcodeMap.h
--- a/js/src/jit/JitcodeMap.h
+++ b/js/src/jit/JitcodeMap.h
@@ -1363,26 +1363,33 @@ class JitcodeRegionEntry
     }
     uint32_t scriptDepth() const {
         return scriptDepth_;
     }
 
     class ScriptPcIterator
     {
       private:
-        uint32_t count_;
         const uint8_t* start_;
         const uint8_t* end_;
-
+#ifdef DEBUG
+        uint32_t count_;
+#endif
         uint32_t idx_;
         const uint8_t* cur_;
 
       public:
-        ScriptPcIterator(uint32_t count, const uint8_t* start, const uint8_t* end)
-          : count_(count), start_(start), end_(end), idx_(0), cur_(start_)
+        ScriptPcIterator(const uint8_t* start, const uint8_t* end, uint32_t count)
+          : start_(start),
+            end_(end),
+#ifdef DEBUG
+            count_(count),
+#endif
+            idx_(0),
+            cur_(start_)
         {}
 
         bool hasMore() const
         {
             MOZ_ASSERT((idx_ == count_) == (cur_ == end_));
             MOZ_ASSERT((idx_ < count_) == (cur_ < end_));
             return cur_ < end_;
         }
@@ -1406,17 +1413,17 @@ class JitcodeRegionEntry
         void reset() {
             idx_ = 0;
             cur_ = start_;
         }
     };
 
     ScriptPcIterator scriptPcIterator() const {
         // End of script+pc sequence is the start of the delta run.
-        return ScriptPcIterator(scriptDepth_, scriptPcStack_,  deltaRun_);
+        return ScriptPcIterator(scriptPcStack_,  deltaRun_, scriptDepth_);
     }
 
     class DeltaIterator {
       private:
         const uint8_t* start_;
         const uint8_t* end_;
         const uint8_t* cur_;