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
--- 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()