From 9bd9aae4e467602557abab25ed1596c12991975e Mon Sep 17 00:00:00 2001 From: Gregory Mierzwinski Date: Sat, 22 Dec 2018 19:55:10 +0000 Subject: [PATCH 1/8] Bug 1514087 - Rebuild custom d8 on a regular basis. r=jmaher This patch adds a cron task to regularly schedule an update to the custom d8/v8 version in use in jsshell benchmarks. Differential Revision: https://phabricator.services.mozilla.com/D15256 --HG-- extra : moz-landing-system : lando --- .cron.yml | 11 +++++++++++ taskcluster/taskgraph/target_tasks.py | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/.cron.yml b/.cron.yml index f6314f644688..d77c9fb86e98 100644 --- a/.cron.yml +++ b/.cron.yml @@ -99,6 +99,17 @@ jobs: mozilla-central: [{hour: 10, minute: 0}] # No default + - name: customv8-update + job: + type: decision-task + treeherder-symbol: customv8 + target-tasks-method: customv8_update + run-on-projects: + - mozilla-central + when: + by-project: + mozilla-central: [{hour: 10, minute: 30}] + - name: bouncer-check job: type: decision-task diff --git a/taskcluster/taskgraph/target_tasks.py b/taskcluster/taskgraph/target_tasks.py index d7f494864503..ebc09a57778c 100644 --- a/taskcluster/taskgraph/target_tasks.py +++ b/taskcluster/taskgraph/target_tasks.py @@ -570,6 +570,12 @@ def target_tasks_searchfox(full_task_graph, parameters, graph_config): 'searchfox-win64-searchfox/debug'] +@_target_task('customv8_update') +def target_tasks_customv8_update(full_task_graph, parameters, graph_config): + """Select tasks required for building latest d8/v8 version.""" + return ['toolchain-linux64-custom-v8'] + + @_target_task('pipfile_update') def target_tasks_pipfile_update(full_task_graph, parameters, graph_config): """Select the set of tasks required to perform nightly in-tree pipfile updates From 929107cd391f846054b8dc2301402c77c4b3e7b1 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Fri, 21 Dec 2018 18:34:12 +0000 Subject: [PATCH 2/8] Bug 1515590 part 2 - Fix test_bug1042436.xul to create the sandbox in a new compartment because Xray warning state is stored per compartment. r=bholley Differential Revision: https://phabricator.services.mozilla.com/D15092 --HG-- extra : moz-landing-system : lando --- js/xpconnect/tests/chrome/test_bug1042436.xul | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/js/xpconnect/tests/chrome/test_bug1042436.xul b/js/xpconnect/tests/chrome/test_bug1042436.xul index f8370f39c476..a279b875b80b 100644 --- a/js/xpconnect/tests/chrome/test_bug1042436.xul +++ b/js/xpconnect/tests/chrome/test_bug1042436.xul @@ -27,17 +27,23 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1042436 SimpleTest.expectConsoleMessages(function() { - nonXrayableObj.someExpandoProperty; - nonXrayableObj.someOtherExpandoProperty; + // Create sandboxes in fresh compartments, because the warning state is + // stored per compartment. + var chromeSb1 = Cu.Sandbox(this, {freshCompartment: true}); + chromeSb1.nonXrayableObj = nonXrayableObj; + Cu.evalInSandbox(` + nonXrayableObj.someExpandoProperty; + nonXrayableObj.someOtherExpandoProperty; + `, chromeSb1); - var chromeSb = Cu.Sandbox(this); + var chromeSb2 = Cu.Sandbox(this, {freshCompartment: true}); var contentObjWithGetter = contentSb.eval('({ get getterProp() {return 42;}, valueProp: 42 })'); is(contentObjWithGetter.wrappedJSObject.getterProp, 42, "Getter prop set up correctly"); is(contentObjWithGetter.getterProp, undefined, "Xrays work right"); is(contentObjWithGetter.valueProp, 42, "Getter prop set up correctly"); - chromeSb.contentObjWithGetter = contentObjWithGetter; + chromeSb2.contentObjWithGetter = contentObjWithGetter; Cu.evalInSandbox('contentObjWithGetter.getterProp; contentObjWithGetter.valueProp; contentObjWithGetter.getterProp;', - chromeSb, "1.7", "http://phony.example.com/file.js", 99); + chromeSb2, "1.7", "http://phony.example.com/file.js", 99); }, [{ errorMessage: /property "someExpandoProperty" \(reason: object is not safely Xrayable/, sourceName: /test_bug1042436/, isWarning: true }, { errorMessage: /property "getterProp" \(reason: property has accessor/, sourceName: /phony/, lineNumber: 99, isWarning: true } ], From 9190590e0948bafa75b950a1bb75a3c5136e1ef9 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Sat, 22 Dec 2018 21:39:56 +0000 Subject: [PATCH 3/8] Bug 1515590 part 3 - Fix some debugger tests by forcing separate compartments for the debugger and debuggee. r=ochameau With same-compartment chrome globals these would end up in the same compartment. We need to prevent that because the debugger doesn't support it. Differential Revision: https://phabricator.services.mozilla.com/D15093 --HG-- extra : moz-landing-system : lando --- .../test_Debugger.Source.prototype.element.html | 2 +- ...est_Debugger.Source.prototype.introductionType.html | 2 +- .../mochitest/test_makeGlobalObjectReference.html | 7 +++++-- dom/base/test/jsmodules/iframe_extractIntroType.html | 2 +- dom/promise/tests/test_on_new_promise.html | 3 ++- dom/promise/tests/test_on_promise_settled.html | 3 ++- .../tests/test_on_promise_settled_duplicates.html | 3 ++- js/ductwork/debugger/jsdebugger.jsm | 10 +++++++++- js/xpconnect/tests/chrome/test_evalInSandbox.xul | 5 ++++- .../tests/chrome/test_onGarbageCollection.html | 3 ++- tools/lint/eslint/modules.json | 2 +- 11 files changed, 30 insertions(+), 12 deletions(-) diff --git a/devtools/server/tests/mochitest/test_Debugger.Source.prototype.element.html b/devtools/server/tests/mochitest/test_Debugger.Source.prototype.element.html index e45a30df25f9..a6d77e41e80e 100644 --- a/devtools/server/tests/mochitest/test_Debugger.Source.prototype.element.html +++ b/devtools/server/tests/mochitest/test_Debugger.Source.prototype.element.html @@ -18,7 +18,7 @@ element to which code is attached (if any), and how. "use strict"; ChromeUtils.import("resource://gre/modules/jsdebugger.jsm"); -addDebuggerToGlobal(this); +addSandboxedDebuggerToGlobal(this); window.onload = function() { SimpleTest.waitForExplicitFinish(); diff --git a/devtools/server/tests/mochitest/test_Debugger.Source.prototype.introductionType.html b/devtools/server/tests/mochitest/test_Debugger.Source.prototype.introductionType.html index 2bcf0fcdf776..4bbb97fd841f 100644 --- a/devtools/server/tests/mochitest/test_Debugger.Source.prototype.introductionType.html +++ b/devtools/server/tests/mochitest/test_Debugger.Source.prototype.introductionType.html @@ -19,7 +19,7 @@ JavaScrip appearing in an inline event handler attribute. "use strict"; ChromeUtils.import("resource://gre/modules/jsdebugger.jsm"); -addDebuggerToGlobal(this); +addSandboxedDebuggerToGlobal(this); let dbg; let iframeDO, doc; diff --git a/devtools/server/tests/mochitest/test_makeGlobalObjectReference.html b/devtools/server/tests/mochitest/test_makeGlobalObjectReference.html index 5618f6135fd1..3a1d28aa8656 100644 --- a/devtools/server/tests/mochitest/test_makeGlobalObjectReference.html +++ b/devtools/server/tests/mochitest/test_makeGlobalObjectReference.html @@ -18,13 +18,16 @@ Debugger.prototype.makeGlobalObjectReference should dereference WindowProxy "use strict"; ChromeUtils.import("resource://gre/modules/jsdebugger.jsm"); -addDebuggerToGlobal(this); +addSandboxedDebuggerToGlobal(this); window.onload = function() { SimpleTest.waitForExplicitFinish(); + // Load one of our iframes over http to force it in a different compartment + // from the current window and the other iframe. const iframe = document.createElement("iframe"); - iframe.src = "iframe1_makeGlobalObjectReference.html"; + const baseURL = "http://mochi.test:8888/chrome/devtools/server/tests/mochitest/"; + iframe.src = baseURL + "iframe1_makeGlobalObjectReference.html"; iframe.onload = iframeOnLoad; document.body.appendChild(iframe); diff --git a/dom/base/test/jsmodules/iframe_extractIntroType.html b/dom/base/test/jsmodules/iframe_extractIntroType.html index e6111779a2c1..1e917aaf5059 100644 --- a/dom/base/test/jsmodules/iframe_extractIntroType.html +++ b/dom/base/test/jsmodules/iframe_extractIntroType.html @@ -5,7 +5,7 @@ // Hook up the debugger statement to extract the calling script's // introductionType and set it in a property on the parent global. ChromeUtils.import("resource://gre/modules/jsdebugger.jsm"); - addDebuggerToGlobal(this); + addSandboxedDebuggerToGlobal(this); var dbg = new Debugger; dbg.addDebuggee(parent); dbg.onDebuggerStatement = function (frame) { diff --git a/dom/promise/tests/test_on_new_promise.html b/dom/promise/tests/test_on_new_promise.html index f34771506f91..5cfd28545e49 100644 --- a/dom/promise/tests/test_on_new_promise.html +++ b/dom/promise/tests/test_on_new_promise.html @@ -26,7 +26,8 @@ Debugger.prototype.onNewPromise. "We should have the native DOM promise implementation."); ChromeUtils.import("resource://gre/modules/jsdebugger.jsm"); - var dbgGlobal = new Cu.Sandbox(document.nodePrincipal); + var dbgGlobal = new Cu.Sandbox(document.nodePrincipal, + {freshCompartment: true}); addDebuggerToGlobal(dbgGlobal); var dbg = new dbgGlobal.Debugger(this); diff --git a/dom/promise/tests/test_on_promise_settled.html b/dom/promise/tests/test_on_promise_settled.html index cf69ce95a816..2a44a718b6d5 100644 --- a/dom/promise/tests/test_on_promise_settled.html +++ b/dom/promise/tests/test_on_promise_settled.html @@ -28,7 +28,8 @@ Debugger.prototype.onPromiseResolved. "We should have the native DOM promise implementation."); ChromeUtils.import("resource://gre/modules/jsdebugger.jsm"); - var dbgGlobal = new Cu.Sandbox(document.nodePrincipal); + var dbgGlobal = new Cu.Sandbox(document.nodePrincipal, + {freshCompartment: true}); addDebuggerToGlobal(dbgGlobal); var dbg = new dbgGlobal.Debugger(this); diff --git a/dom/promise/tests/test_on_promise_settled_duplicates.html b/dom/promise/tests/test_on_promise_settled_duplicates.html index 8dfb5d59ee0a..96cef1f9c3be 100644 --- a/dom/promise/tests/test_on_promise_settled_duplicates.html +++ b/dom/promise/tests/test_on_promise_settled_duplicates.html @@ -27,7 +27,8 @@ Bug 1084065 - Test that Debugger.prototype.onPromiseResolved doesn't get dupes. "We should have the native DOM promise implementation."); ChromeUtils.import("resource://gre/modules/jsdebugger.jsm"); - var dbgGlobal = new Cu.Sandbox(document.nodePrincipal); + var dbgGlobal = new Cu.Sandbox(document.nodePrincipal, + {freshCompartment: true}); addDebuggerToGlobal(dbgGlobal); var dbg = new dbgGlobal.Debugger(this); diff --git a/js/ductwork/debugger/jsdebugger.jsm b/js/ductwork/debugger/jsdebugger.jsm index 48fe567ea0f9..4189594179e1 100644 --- a/js/ductwork/debugger/jsdebugger.jsm +++ b/js/ductwork/debugger/jsdebugger.jsm @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -var EXPORTED_SYMBOLS = [ "addDebuggerToGlobal" ]; +var EXPORTED_SYMBOLS = [ "addDebuggerToGlobal", "addSandboxedDebuggerToGlobal" ]; /* * This is the js module for Debugger. Import it like so: @@ -24,6 +24,14 @@ function addDebuggerToGlobal(global) { initPromiseDebugging(global); } +// Defines the Debugger in a sandbox global in a separate compartment. This +// ensures the debugger and debuggee are in different compartments. +function addSandboxedDebuggerToGlobal(global) { + var sb = Cu.Sandbox(global, {freshCompartment: true}); + addDebuggerToGlobal(sb); + global.Debugger = sb.Debugger; +} + function initPromiseDebugging(global) { if (global.Debugger.Object.prototype.PromiseDebugging) { return; diff --git a/js/xpconnect/tests/chrome/test_evalInSandbox.xul b/js/xpconnect/tests/chrome/test_evalInSandbox.xul index 860d5394ef1b..b4de5165d9c1 100644 --- a/js/xpconnect/tests/chrome/test_evalInSandbox.xul +++ b/js/xpconnect/tests/chrome/test_evalInSandbox.xul @@ -183,7 +183,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=533596 try { let dbg = new Debugger(); - let sandbox = new Cu.Sandbox(this, { invisibleToDebugger: false }); + let sandbox = new Cu.Sandbox(this, { + invisibleToDebugger: false, + freshCompartment: true, + }); dbg.addDebuggee(sandbox); ok(true, "debugger added visible value"); } catch(e) { diff --git a/js/xpconnect/tests/chrome/test_onGarbageCollection.html b/js/xpconnect/tests/chrome/test_onGarbageCollection.html index d50664213e2f..bda2bcdac151 100644 --- a/js/xpconnect/tests/chrome/test_onGarbageCollection.html +++ b/js/xpconnect/tests/chrome/test_onGarbageCollection.html @@ -16,7 +16,8 @@ // Instanciate `Debugger` in a sandbox as Debugger requires to be created // in a compartment different than the debuggee. - let sandbox = Cu.Sandbox(Components.Constructor("@mozilla.org/systemprincipal;1", "nsIPrincipal")()); + let sandbox = Cu.Sandbox(Components.Constructor("@mozilla.org/systemprincipal;1", "nsIPrincipal")(), + {freshCompartment: true}); Cu.evalInSandbox( "Components.utils.import('resource://gre/modules/jsdebugger.jsm');" + "addDebuggerToGlobal(this);", diff --git a/tools/lint/eslint/modules.json b/tools/lint/eslint/modules.json index 90b9d0451e0f..0a36a6dbdadb 100644 --- a/tools/lint/eslint/modules.json +++ b/tools/lint/eslint/modules.json @@ -94,7 +94,7 @@ "import_module.jsm": ["MODULE_IMPORTED", "MODULE_URI", "SUBMODULE_IMPORTED", "same_scope", "SUBMODULE_IMPORTED_TO_SCOPE"], "import_sub_module.jsm": ["SUBMODULE_IMPORTED", "test_obj"], "InlineSpellChecker.jsm": ["InlineSpellChecker", "SpellCheckHelper"], - "jsdebugger.jsm": ["addDebuggerToGlobal"], + "jsdebugger.jsm": ["addDebuggerToGlobal", "addSandboxedDebuggerToGlobal"], "jsesc.js": ["jsesc"], "json2.js": ["JSON"], "keys.js": ["BulkKeyBundle", "SyncKeyBundle"], From ecaf5bdea00661c9629420eced0fc09454d904af Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Fri, 21 Dec 2018 18:33:08 +0000 Subject: [PATCH 4/8] Bug 1515590 part 4 - Don't call FixWaiverAfterTransplant if JS_TransplantObject didn't change object identity. r=bholley Depends on D15093 Differential Revision: https://phabricator.services.mozilla.com/D15094 --HG-- extra : moz-landing-system : lando --- js/xpconnect/wrappers/WrapperFactory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/xpconnect/wrappers/WrapperFactory.cpp b/js/xpconnect/wrappers/WrapperFactory.cpp index 19bc3372a281..fb4f683449dd 100644 --- a/js/xpconnect/wrappers/WrapperFactory.cpp +++ b/js/xpconnect/wrappers/WrapperFactory.cpp @@ -639,6 +639,11 @@ JSObject* TransplantObject(JSContext* cx, JS::HandleObject origobj, return newIdentity; } + // If we transplanted within a compartment, oldWaiver is still valid. + if (newIdentity == origobj) { + return newIdentity; + } + if (!FixWaiverAfterTransplant(cx, oldWaiver, newIdentity)) { return nullptr; } From 1d8954ace90bb05eddeda84a73e8b10a2382e89b Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Sat, 22 Dec 2018 21:42:21 +0000 Subject: [PATCH 5/8] Bug 1515754 - Enter the reaction's realm in EnqueuePromiseReactionJob before creating the job. r=arai This is consistent with what we do for cross-compartment wrappers and avoids problems with running jobs against a dying global (Gecko drops such jobs). I added a globalOfFirstJobInQueue() shell function so I could write a test that checks both the compartment-per-global and single-compartment cases. Differential Revision: https://phabricator.services.mozilla.com/D15176 --HG-- extra : moz-landing-system : lando --- js/src/builtin/Promise.cpp | 7 +++++ .../tests/realms/promise-job-global.js | 31 +++++++++++++++++++ js/src/shell/js.cpp | 23 ++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 js/src/jit-test/tests/realms/promise-job-global.js diff --git a/js/src/builtin/Promise.cpp b/js/src/builtin/Promise.cpp index 6f5738ea222a..0839e2099586 100644 --- a/js/src/builtin/Promise.cpp +++ b/js/src/builtin/Promise.cpp @@ -959,6 +959,13 @@ MOZ_MUST_USE static bool EnqueuePromiseReactionJob( if (!IsProxy(reactionObj)) { MOZ_RELEASE_ASSERT(reactionObj->is()); reaction = &reactionObj->as(); + if (cx->realm() != reaction->realm()) { + // If the compartment has multiple realms, create the job in the + // reaction's realm. This is consistent with the code in the else-branch + // and avoids problems with running jobs against a dying global (Gecko + // drops such jobs). + ar.emplace(cx, reaction); + } } else { JSObject* unwrappedReactionObj = UncheckedUnwrap(reactionObj); if (JS_IsDeadWrapper(unwrappedReactionObj)) { diff --git a/js/src/jit-test/tests/realms/promise-job-global.js b/js/src/jit-test/tests/realms/promise-job-global.js new file mode 100644 index 000000000000..246ce171a2a9 --- /dev/null +++ b/js/src/jit-test/tests/realms/promise-job-global.js @@ -0,0 +1,31 @@ +// Test that jobs added to the promise job queue have a global that's consistent +// with and without same-compartment realms. + +var g1 = newGlobal(); +var g2 = newGlobal({sameCompartmentAs: this}); + +// EnqueuePromiseReactionJob, handler is a primitive. +// Job's global is the reaction's global. +function test1(g) { + var resolve; + var p = new Promise(res => { resolve = res; }); + g.Promise.prototype.then.call(p, 1); + resolve(); + assertEq(globalOfFirstJobInQueue(), g); + drainJobQueue(); +} +test1(g1); +test1(g2); + +// EnqueuePromiseReactionJob, handler is an object. +// Job's global is the handler's global. +function test2(g) { + var resolve; + var p = new Promise(res => { resolve = res; }); + p.then(new g.Function()); + resolve(); + assertEq(globalOfFirstJobInQueue(), g); + drainJobQueue(); +} +test2(g1); +test2(g2); diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 4a119c5bc1f0..f294004852b0 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -1036,6 +1036,24 @@ static bool DrainJobQueue(JSContext* cx, unsigned argc, Value* vp) { return true; } +static bool GlobalOfFirstJobInQueue(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + if (cx->jobQueue->empty()) { + JS_ReportErrorASCII(cx, "Job queue is empty"); + return false; + } + + RootedObject job(cx, cx->jobQueue->front()); + RootedObject global(cx, &job->nonCCWGlobal()); + if (!cx->compartment()->wrap(cx, &global)) { + return false; + } + + args.rval().setObject(*global); + return true; +} + static void ForwardingPromiseRejectionTrackerCallback( JSContext* cx, JS::HandleObject promise, JS::PromiseRejectionHandlingState state, void* data) { @@ -8617,6 +8635,11 @@ JS_FN_HELP("parseBin", BinParse, 1, 0, "enqueueJob(fn)", " Enqueue 'fn' on the shell's job queue."), + JS_FN_HELP("globalOfFirstJobInQueue", GlobalOfFirstJobInQueue, 0, 0, +"globalOfFirstJobInQueue()", +" Returns the global of the first item in the job queue. Throws an exception\n" +" if the queue is empty.\n"), + JS_FN_HELP("drainJobQueue", DrainJobQueue, 0, 0, "drainJobQueue()", "Take jobs from the shell's job queue in FIFO order and run them until the\n" From a62ba0ea682cba72afbe6a57824bd1b432a4b9c4 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Sat, 22 Dec 2018 21:42:23 +0000 Subject: [PATCH 6/8] Bug 1515754 - Change Debugger::onPromiseSettled to check promise->realm()->isDebuggee() instead of cx->realm()->isDebuggee(). r=arai As discussed on IRC this is hard to trigger, but this is more consistent with the cross-compartment code. Differential Revision: https://phabricator.services.mozilla.com/D15214 --HG-- extra : moz-landing-system : lando --- js/src/vm/Debugger-inl.h | 2 +- js/src/vm/Debugger.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/js/src/vm/Debugger-inl.h b/js/src/vm/Debugger-inl.h index 73702b4552a3..61d9921bc0cc 100644 --- a/js/src/vm/Debugger-inl.h +++ b/js/src/vm/Debugger-inl.h @@ -104,7 +104,7 @@ /* static */ void js::Debugger::onPromiseSettled( JSContext* cx, Handle promise) { - if (MOZ_UNLIKELY(cx->realm()->isDebuggee())) { + if (MOZ_UNLIKELY(promise->realm()->isDebuggee())) { slowPathPromiseHook(cx, Debugger::OnPromiseSettled, promise); } } diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 8df37ffccda9..d789da13721d 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -2491,12 +2491,13 @@ ResumeMode Debugger::firePromiseHook(JSContext* cx, Hook hook, JSContext* cx, Hook hook, Handle promise) { MOZ_ASSERT(hook == OnNewPromise || hook == OnPromiseSettled); - Maybe ar; - if (hook == OnNewPromise) { - ar.emplace(cx, promise); + if (hook == OnPromiseSettled) { + // We should be in the right compartment, but for simplicity always enter + // the promise's realm below. + cx->check(promise); } - cx->check(promise); + AutoRealm ar(cx, promise); RootedValue rval(cx); ResumeMode resumeMode = dispatchHook( From 2c917c374f838c63643be78d396fd6c205bdce5e Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Sun, 23 Dec 2018 14:46:43 +0000 Subject: [PATCH 7/8] Bug 1516061. Split MissedComposite telemetry. r=mattwoodrow We're seeing a substantial amount of paint misses caused by MissedComposite. This splits MissedComposite into subcategories based on the full paint time. Differential Revision: https://phabricator.services.mozilla.com/D15241 --HG-- extra : moz-landing-system : lando --- gfx/layers/wr/WebRenderBridgeParent.cpp | 16 ++++++++++++++-- toolkit/components/telemetry/Histograms.json | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gfx/layers/wr/WebRenderBridgeParent.cpp b/gfx/layers/wr/WebRenderBridgeParent.cpp index e056609a8368..65d63ae1ae9a 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.cpp +++ b/gfx/layers/wr/WebRenderBridgeParent.cpp @@ -2001,9 +2001,21 @@ TransactionId WebRenderBridgeParent::FlushTransactionIdsForEpoch( Telemetry::AccumulateCategorical( LABELS_CONTENT_FRAME_TIME_REASON::NoVsync); } else if (aCompositeStartId - transactionId.mVsyncId > 1) { + auto fullPaintTime = + transactionId.mSceneBuiltTime + ? transactionId.mSceneBuiltTime - transactionId.mTxnStartTime + : TimeDuration::FromMilliseconds(0); // Composite started late (and maybe took too long as well) - Telemetry::AccumulateCategorical( - LABELS_CONTENT_FRAME_TIME_REASON::MissedComposite); + if (fullPaintTime >= TimeDuration::FromMilliseconds(20)) { + Telemetry::AccumulateCategorical( + LABELS_CONTENT_FRAME_TIME_REASON::MissedCompositeLong); + } else if (fullPaintTime >= TimeDuration::FromMilliseconds(10)) { + Telemetry::AccumulateCategorical( + LABELS_CONTENT_FRAME_TIME_REASON::MissedCompositeMid); + } else { + Telemetry::AccumulateCategorical( + LABELS_CONTENT_FRAME_TIME_REASON::MissedComposite); + } } else { // Composite start on time, but must have taken too long. Telemetry::AccumulateCategorical( diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 2f9cbf67aefd..da4784f9777d 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -13222,7 +13222,7 @@ "expires_in_version": "73", "kind": "categorical", "description": "The reason that CONTENT_FRAME_TIME recorded a slow (>200) result, if any.", - "labels": ["OnTime", "NoVsync", "MissedComposite", "SlowComposite"] + "labels": ["OnTime", "NoVsync", "MissedComposite", "SlowComposite", "MissedCompositeMid", "MissedCompositeLong"] }, "CONTENT_LARGE_PAINT_PHASE_WEIGHT": { "record_in_processes": ["main", "content"], From 825dbc97c0b1b52459df808f445026e8c03685b2 Mon Sep 17 00:00:00 2001 From: WR Updater Bot Date: Sun, 23 Dec 2018 16:28:52 +0000 Subject: [PATCH 8/8] Bug 1516073 - Update webrender to commit 8b90bdd513419a06f2755b08713238e6ee52b1e9 (WR PR #3443). r=kats https://github.com/servo/webrender/pull/3443 Differential Revision: https://phabricator.services.mozilla.com/D15270 --HG-- extra : moz-landing-system : lando --- gfx/webrender_bindings/revision.txt | 2 +- gfx/wr/Cargo.lock | 47 ++++++++++++----------------- gfx/wr/webrender/Cargo.toml | 2 +- gfx/wr/wrench/Cargo.toml | 2 +- 4 files changed, 23 insertions(+), 30 deletions(-) diff --git a/gfx/webrender_bindings/revision.txt b/gfx/webrender_bindings/revision.txt index b25d5b3e28ea..396ffed3eef5 100644 --- a/gfx/webrender_bindings/revision.txt +++ b/gfx/webrender_bindings/revision.txt @@ -1 +1 @@ -8476ed5e134e54f2facb01ea45e8a2008c8ba8da +8b90bdd513419a06f2755b08713238e6ee52b1e9 diff --git a/gfx/wr/Cargo.lock b/gfx/wr/Cargo.lock index 35794460e9aa..42e816085c59 100644 --- a/gfx/wr/Cargo.lock +++ b/gfx/wr/Cargo.lock @@ -58,11 +58,10 @@ dependencies = [ [[package]] name = "base64" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -75,7 +74,7 @@ name = "bincode" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -110,7 +109,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" -version = "1.2.3" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -118,7 +117,7 @@ name = "bytes" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -319,7 +318,7 @@ version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "adler32 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -472,7 +471,7 @@ name = "fxhash" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -584,7 +583,7 @@ name = "image" version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "gif 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "jpeg-decoder 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -640,7 +639,7 @@ name = "jpeg-decoder" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -979,7 +978,7 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)", "half 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1162,11 +1161,6 @@ dependencies = [ "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "safemem" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "scoped_threadpool" version = "0.1.9" @@ -1285,7 +1279,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1378,7 +1372,7 @@ name = "tiff" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1533,10 +1527,10 @@ name = "webrender" version = "0.57.2" dependencies = [ "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1591,7 +1585,7 @@ dependencies = [ "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1666,9 +1660,9 @@ name = "wrench" version = "0.3.0" dependencies = [ "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1700,7 +1694,7 @@ name = "ws" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1765,7 +1759,7 @@ dependencies = [ "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1" -"checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9" +"checksum base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "621fc7ecb8008f86d7fb9b95356cd692ce9514b80a86d85b397f32a22da7b9e2" "checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff" "checksum bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bda13183df33055cbb84b847becce220d392df502ebe7a4a78d7021771ed94d0" "checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" @@ -1773,7 +1767,7 @@ dependencies = [ "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" "checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" -"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9" +"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d" "checksum bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "2f1d50c876fb7545f5f289cd8b2aee3f359d073ae819eed5d6373638e2c61e59" "checksum cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0ebb87d1116151416c0cf66a0e3fb6430cccd120fd6300794b4dfaa050ac40ba" "checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" @@ -1893,7 +1887,6 @@ dependencies = [ "checksum regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1ac0f60d675cc6cf13a20ec076568254472551051ad5dd050364d70671bf6b" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "da06feaa07f69125ab9ddc769b11de29090122170b402547f64b86fe16ebc399" -"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" "checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef" diff --git a/gfx/wr/webrender/Cargo.toml b/gfx/wr/webrender/Cargo.toml index 7dae53dcc89d..6af9d5b749eb 100644 --- a/gfx/wr/webrender/Cargo.toml +++ b/gfx/wr/webrender/Cargo.toml @@ -20,7 +20,7 @@ serialize_program = ["serde"] [dependencies] app_units = "0.7" -base64 = { optional = true, version = "0.9" } +base64 = { optional = true, version = "0.10" } bincode = "1.0" bitflags = "1.0" byteorder = "1.0" diff --git a/gfx/wr/wrench/Cargo.toml b/gfx/wr/wrench/Cargo.toml index 28a3f2cce4e3..b1f6a63f60e4 100644 --- a/gfx/wr/wrench/Cargo.toml +++ b/gfx/wr/wrench/Cargo.toml @@ -6,7 +6,7 @@ build = "build.rs" license = "MPL-2.0" [dependencies] -base64 = "0.9" +base64 = "0.10" bincode = "1.0" byteorder = "1.0" env_logger = { version = "0.5", optional = true }