From 5a094e519c4992b29b910243b80bbf75e69f46a7 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Thu, 2 Apr 2015 16:12:06 -0700 Subject: [PATCH] Backed out changeset 39d74e5c3df5 (bug 1149897) for frequent bc3 timeout errors --- js/src/vm/Interpreter.cpp | 7 ++---- js/src/vm/Runtime.h | 22 ----------------- .../tests/browser/browser_compartments.js | 24 +++++++++---------- 3 files changed, 13 insertions(+), 40 deletions(-) diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index 687cc2ebacd..c7a476548fd 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -567,14 +567,11 @@ struct AutoStopwatch final ULARGE_INTEGER userTimeInt; kernelTimeInt.LowPart = kernelFileTime.dwLowDateTime; kernelTimeInt.HighPart = kernelFileTime.dwHighDateTime; - // Convert 100 ns to 1 us, make sure that the result is monotonic - *systemTime = runtime_-> stopwatch.systemTimeFix.monotonize(kernelTimeInt.QuadPart / 10); + *systemTime = kernelTimeInt.QuadPart / 10; // 100 ns to 1 us userTimeInt.LowPart = userFileTime.dwLowDateTime; userTimeInt.HighPart = userFileTime.dwHighDateTime; - // Convert 100 ns to 1 us, make sure that the result is monotonic - *userTime = runtime_-> stopwatch.userTimeFix.monotonize(userTimeInt.QuadPart / 10); - + *userTime = userTimeInt.QuadPart / 10; // 100 ns to 1 us #endif // defined(XP_UNIX) || defined(XP_WIN) return true; diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index 0bec2e7e1ba..1213cd8956e 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -1532,28 +1532,6 @@ struct JSRuntime : public JS::shadow::Runtime, return isActive_; } - // Some systems have non-monotonic clocks. While we cannot - // improve the precision, we can make sure that our measures - // are monotonic nevertheless. We do this by storing the - // result of the latest call to the clock and making sure - // that the next timestamp is greater or equal. - struct MonotonicTimeStamp { - MonotonicTimeStamp() - : latestGood_(0) - {} - inline uint64_t monotonize(uint64_t stamp) - { - if (stamp <= latestGood_) - return latestGood_; - latestGood_ = stamp; - return stamp; - } - private: - uint64_t latestGood_; - }; - MonotonicTimeStamp systemTimeFix; - MonotonicTimeStamp userTimeFix; - private: /** * A map used to collapse compartments belonging to the same diff --git a/toolkit/components/aboutperformance/tests/browser/browser_compartments.js b/toolkit/components/aboutperformance/tests/browser/browser_compartments.js index ff5bb518510..5c7d598f19d 100644 --- a/toolkit/components/aboutperformance/tests/browser/browser_compartments.js +++ b/toolkit/components/aboutperformance/tests/browser/browser_compartments.js @@ -93,10 +93,8 @@ function monotinicity_tester(source, testName) { // Sanity check on components data. let set = new Set(); - let keys = []; for (let item of snapshot.componentsData) { - let key = `{name: ${item.name}, addonId: ${item.addonId}, isSystem: ${item.isSystem}}`; - keys.push(key); + let key = `{name: ${item.name}, addonId: ${item.addonId}}`; set.add(key); sanityCheck(previous.componentsMap.get(key), item); previous.componentsMap.set(key, item); @@ -105,15 +103,13 @@ function monotinicity_tester(source, testName) { Assert_leq(item[k], snapshot.processData[k], `Sanity check (${name}): component has a lower ${k} than process`); } + for (let i = 0; i < item.durations.length; ++i) { + Assert_leq(item.durations[i], snapshot.processData.durations[i], + `Sanity check (${name}): component has a lower durations[${i}] than process.`); + } } // Check that we do not have duplicate components. - info(`Before deduplication, we had the following components: ${keys.sort().join(", ")}`); - info(`After deduplication, we have the following components: ${[...set.keys()].sort().join(", ")}`); - - info(`Deactivating deduplication check (Bug 1150045)`); - if (false) { - Assert.equal(set.size, snapshot.componentsData.length); - } + Assert.equal(set.size, snapshot.componentsData.length); }); let interval = window.setInterval(frameCheck, 300); registerCleanupFunction(() => { @@ -137,9 +133,11 @@ add_task(function* test() { info("Opening URL"); newTab.linkedBrowser.loadURI(URL); - info("Setting up monotonicity testing"); - monotinicity_tester(() => PerformanceStats.getSnapshot(), "parent process"); - monotinicity_tester(() => promiseContentResponseOrNull(browser, "compartments-test:getStatistics", null), "content process" ); + info("Skipping monotonicity testing (1149897)"); + if (false) { + monotinicity_tester(() => PerformanceStats.getSnapshot(), "parent process"); + monotinicity_tester(() => promiseContentResponseOrNull(browser, "compartments-test:getStatistics", null), "content process" ); + } while (true) { let stats = (yield promiseContentResponse(browser, "compartments-test:getStatistics", null));