Bug 1325299 - Disable untested code path in Stopwatch.(h|cpp). r=Yoric draft
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sat, 21 Jan 2017 14:20:45 +0900
changeset 466924 b22e11fc79f3a6a210728cd419d6d329bf9fa23c
parent 466800 3dc221ca67642ea810cb353869f76b82c40c7bf3
child 543571 250b6b0d6a4d04b1e4a379a0b44ebeaf7279ecef
push id43053
push userVYV03354@nifty.ne.jp
push dateThu, 26 Jan 2017 22:20:41 +0000
reviewersYoric
bugs1325299
milestone54.0a1
Bug 1325299 - Disable untested code path in Stopwatch.(h|cpp). r=Yoric This patch temporarily disables multiprocessor support because tests fail on Win7 VM and we would not like to block other bugs until we investigate the formerly untested code path. MozReview-Commit-ID: B2ajBK4rrrd
js/src/vm/Stopwatch.cpp
js/src/vm/Stopwatch.h
--- a/js/src/vm/Stopwatch.cpp
+++ b/js/src/vm/Stopwatch.cpp
@@ -314,17 +314,18 @@ AutoStopwatch::exit()
         // `getCPU()`.  We hope that this will happen rarely
         // enough that the impact on our statistics will remain
         // limited.
         const cpuid_t cpuEnd = this->getCPU();
         if (isSameCPU(cpuStart_, cpuEnd)) {
             const uint64_t cyclesEnd = getCycles(runtime);
             cyclesDelta = cyclesEnd - cyclesStart_; // Always >= 0 by definition of `getCycles`.
         }
-#if WINVER >= 0x600
+// Temporary disable untested code path.
+#if 0 // WINVER >= 0x600
         updateTelemetry(cpuStart_, cpuEnd);
 #elif defined(__linux__)
         updateTelemetry(cpuStart_, cpuEnd);
 #endif // WINVER >= 0x600 || _linux__
     }
 
     uint64_t CPOWTimeDelta = 0;
     if (isMonitoringCPOW_ && runtime->performanceMonitoring.isMonitoringCPOW()) {
@@ -406,31 +407,33 @@ uint64_t
 AutoStopwatch::getCycles(JSRuntime* runtime) const
 {
     return runtime->performanceMonitoring.monotonicReadTimestampCounter();
 }
 
 cpuid_t inline
 AutoStopwatch::getCPU() const
 {
-#if defined(XP_WIN) && WINVER >= _WIN32_WINNT_VISTA
+// Temporary disable untested code path.
+#if 0 // defined(XP_WIN) && WINVER >= _WIN32_WINNT_VISTA
     PROCESSOR_NUMBER proc;
     GetCurrentProcessorNumberEx(&proc);
 
     cpuid_t result(proc.Group, proc.Number);
     return result;
 #else
     return {};
 #endif // defined(XP_WIN)
 }
 
 bool inline
 AutoStopwatch::isSameCPU(const cpuid_t& a, const cpuid_t& b) const
 {
-#if defined(XP_WIN)  && WINVER >= _WIN32_WINNT_VISTA
+// Temporary disable untested code path.
+#if 0 // defined(XP_WIN)  && WINVER >= _WIN32_WINNT_VISTA
     return a.group_ == b.group_ && a.number_ == b.number_;
 #else
     return true;
 #endif
 }
 
 PerformanceGroup::PerformanceGroup()
     : recentCycles_(0)
--- a/js/src/vm/Stopwatch.h
+++ b/js/src/vm/Stopwatch.h
@@ -294,17 +294,18 @@ struct PerformanceMonitoring {
 
     /**
      * The highest value of the timestamp counter encountered
      * during this iteration.
      */
     uint64_t highestTimestampCounter_;
 };
 
-#if WINVER >= 0x0600
+// Temporary disable untested code path.
+#if 0 // WINVER >= 0x0600
 struct cpuid_t {
     uint16_t group_;
     uint8_t number_;
     cpuid_t(uint16_t group, uint8_t number)
         : group_(group),
           number_(number)
     { }
     cpuid_t()