Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE

This commit is contained in:
Mihai Alexandru Michis 2019-07-06 06:45:07 +03:00
Родитель 61484db444 5e3c522c30
Коммит c2dd1916fb
238 изменённых файлов: 1373 добавлений и 1088 удалений

Просмотреть файл

@ -172,24 +172,10 @@ jobs:
- mozilla-beta
- mozilla-release
- mozilla-esr60
- mozilla-esr68
when:
by-project:
# No default branch
mozilla-central:
- {weekday: 'Monday', hour: 10, minute: 0}
- {weekday: 'Thursday', hour: 10, minute: 0}
mozilla-beta:
- {weekday: 'Monday', hour: 10, minute: 0}
- {weekday: 'Thursday', hour: 10, minute: 0}
mozilla-release:
- {weekday: 'Monday', hour: 10, minute: 0}
- {weekday: 'Thursday', hour: 10, minute: 0}
mozilla-esr60:
- {weekday: 'Monday', hour: 10, minute: 0}
- {weekday: 'Thursday', hour: 10, minute: 0}
mozilla-esr68:
- {weekday: 'Monday', hour: 10, minute: 0}
- {weekday: 'Thursday', hour: 10, minute: 0}
- {weekday: 'Monday', hour: 10, minute: 0}
- {weekday: 'Thursday', hour: 10, minute: 0}
- name: pipfile-update
job:

Просмотреть файл

@ -106,6 +106,15 @@ bool TreeWalker::Seek(nsIContent* aChildNode) {
? childNode->GetParentNode()
: childNode->GetFlattenedTreeParent();
// Handle the special case of XBL binding child under a shadow root.
if (parentNode && parentNode->IsShadowRoot()) {
parentNode = childNode->GetFlattenedTreeParent();
if (parentNode == mAnchorNode) {
return true;
}
continue;
}
if (!parentNode || !parentNode->IsElement()) {
return false;
}

Просмотреть файл

@ -7,3 +7,4 @@ support-files =
[browser_aria_owns.js]
skip-if = true || (verify && !debug && (os == 'linux')) #Bug 1445513
[browser_shadowdom.js]

Просмотреть файл

@ -0,0 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
"use strict";
const REORDER = { expected: [[EVENT_REORDER, "container"]] };
// Dynamically inserted slotted accessible elements should be in
// the accessible tree.
const snippet = `
<script>
customElements.define("x-el", class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML =
"<div role='presentation'><slot></slot></div>";
}
});
</script>
<x-el id="container" role="group"><label id="l1">label1</label></x-el>
`;
addAccessibleTask(snippet, async function(browser, accDoc) {
let container = findAccessibleChildByID(accDoc, "container");
testChildrenIds(container, ["l1"]);
await contentSpawnMutation(browser, REORDER, function() {
let labelEl = content.document.createElement("label");
labelEl.id = "l2";
let containerEl = content.document.getElementById("container");
containerEl.appendChild(labelEl);
});
testChildrenIds(container, ["l1", "l2"]);
});

Просмотреть файл

@ -1092,6 +1092,13 @@
<toolbaritem id="PanelUI-button"
removable="false">
<toolbarbutton id="whats-new-menu-button"
class="toolbarbutton-1"
hidden="true"
badged="true"
consumeanchor="PanelUI-button"
onmousedown="PanelUI.showSubView('PanelUI-whatsNew', this, event);"
onkeypress="PanelUI.showSubView('PanelUI-whatsNew', this, event);"/>
<toolbarbutton id="PanelUI-menu-button"
class="toolbarbutton-1"
badged="true"

Просмотреть файл

@ -399,6 +399,11 @@
label="&webDeveloperMenu.label;"
closemenu="none"
oncommand="PanelUI.showSubView('PanelUI-developer', this)"/>
<toolbarbutton id="appMenu-whatsnew-button"
class="subviewbutton subviewbutton-iconic subviewbutton-nav"
hidden="true"
closemenu="none"
oncommand="PanelUI.showSubView('PanelUI-whatsNew', this)"/>
<toolbarbutton id="appMenu-help-button"
class="subviewbutton subviewbutton-iconic subviewbutton-nav"
label="&appMenuHelp.label;"
@ -801,6 +806,23 @@
oncommand="BookmarkingUI.toggleBookmarksToolbar();"/>
</vbox>
</panelview>
<panelview id="PanelUI-whatsNew" class="PanelUI-subView">
<vbox class="panel-subview-body">
<box id="PanelUI-whatsNew-title" class="panel-header">
<label/>
</box>
<toolbaritem id="PanelUI-whatsNew-content"
orient="vertical"
smoothscroll="false"
flatList="true"
tooltip="bhTooltip">
<html:div id="PanelUI-whatsNew-message-container">
<!-- What's New messages will be rendered here -->
</html:div>
</toolbaritem>
</vbox>
</panelview>
</panelmultiview>
</panel>

Просмотреть файл

@ -56,6 +56,7 @@ cfr-doorhanger-extension-total-users =
cfr-doorhanger-pintab-description = Get easy access to your most-used sites. Keep sites open in a tab (even when you restart).
## These messages are steps on how to use the feature and are shown together.
cfr-doorhanger-pintab-step1 = <b>Right-click</b> on the tab you want to pin.
cfr-doorhanger-pintab-step2 = Select <b>Pin Tab</b> from the menu.
cfr-doorhanger-pintab-step3 = If the site has an update youll see a blue dot on your pinned tab.
@ -65,9 +66,18 @@ cfr-doorhanger-pintab-animation-resume = Resume
## Firefox Accounts Message
cfr-doorhanger-bookmark-fxa-header = Sync your bookmarks everywhere.
cfr-doorhanger-bookmark-fxa-body = Great find! Now dont be left without this bookmark on your mobile devices. Get Started with a { -fxaccount-brand-name }.
cfr-doorhanger-bookmark-fxa-link-text = Sync bookmarks now…
cfr-doorhanger-bookmark-fxa-close-btn-tooltip =
.aria-label = Close button
.title = Close
## What's New toolbar button and panel
cfr-whatsnew-button =
.label = Whats New
.tooltiptext = Whats New
cfr-whatsnew-panel-header = Whats New

Просмотреть файл

@ -1786,3 +1786,25 @@ toolbarpaletteitem[place="menu-panel"] > .subviewbutton-nav::after {
.subviewbutton.download:-moz-any([canShow],[canRetry]) > .action-button@buttonStateActive@ {
background-color: var(--arrowpanel-dimmed-even-further);
}
/* What's New panel */
#customizationui-widget-multiview #PanelUI-whatsNew {
min-width: @menuPanelWidth@;
max-width: @menuPanelWidth@;
}
#PanelUI-whatsNew-content {
padding: 0 10px;
}
#customizationui-widget-multiview #PanelUI-whatsNew-content {
height: 586px;
}
#PanelUI-whatsNew-title {
display: none;
}
#customizationui-widget-multiview #PanelUI-whatsNew-title {
display: flex;
}

Просмотреть файл

@ -0,0 +1,10 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="context-fill" fill-opacity="context-fill-opacity" d="M2 13.76A1.23 1.23 0 0 0 3.24 15H7V9H2z"/>
<path fill="context-fill" fill-opacity="context-fill-opacity" d="M9 9v6h3.76A1.23 1.23 0 0 0 14 13.76V9H9z"/>
<path fill="context-fill" fill-opacity="context-fill-opacity" d="M1 5v3h6V4H2a1 1 0 0 0-1 1z"/>
<path fill="context-fill" fill-opacity="context-fill-opacity" d="M14 4H9v4h6V5a1 1 0 0 0-1-1z"/>
<path fill="context-fill" fill-opacity="context-fill-opacity" d="M10.05.41A1.34 1.34 0 0 0 8 1a1.35 1.35 0 0 0-2-.59C5.2 1.08 4.91 2.48 8 4c3.09-1.52 2.8-2.92 2.05-3.59z"/>
</svg>

После

Ширина:  |  Высота:  |  Размер: 897 B

Просмотреть файл

@ -209,6 +209,7 @@
skin/classic/browser/tab.svg (../shared/icons/tab.svg)
skin/classic/browser/undo.svg (../shared/icons/undo.svg)
skin/classic/browser/unpin-tab.svg (../shared/icons/unpin-tab.svg)
skin/classic/browser/whatsnew.svg (../shared/icons/whatsnew.svg)
skin/classic/browser/window.svg (../shared/icons/window.svg)
skin/classic/browser/zoom-in.svg (../shared/icons/zoom-in.svg)
skin/classic/browser/zoom-out.svg (../shared/icons/zoom-out.svg)

Просмотреть файл

@ -41,6 +41,10 @@
list-style-image: url(chrome://global/skin/icons/performance.svg);
}
#appMenu-whatsnew-button {
list-style-image: url(chrome://browser/skin/whatsnew.svg);
}
#appMenu-help-button {
list-style-image: url(chrome://global/skin/icons/help.svg);
}

Просмотреть файл

@ -595,3 +595,7 @@ toolbarbutton.bookmark-item {
.bookmark-item[query][hostContainer] {
list-style-image: url("chrome://browser/skin/places/folder.svg");
}
#whats-new-menu-button {
list-style-image: url("chrome://browser/skin/whatsnew.svg");
}

Просмотреть файл

@ -105,8 +105,11 @@ toolbar .toolbarbutton-1 {
-moz-box-pack: center;
}
:root:not([uidensity=compact]) #PanelUI-menu-button {
:root:not([uidensity=compact]) #PanelUI-button {
padding-inline-start: 5px;
}
:root:not([uidensity=compact]) #PanelUI-menu-button {
padding-inline-end: 5px;
}

Просмотреть файл

@ -356,6 +356,7 @@ function HTMLTooltip(
this._onXulPanelHidden = this._onXulPanelHidden.bind(this);
this.container = this._createContainer();
this.container.classList.toggle("tooltip-container-xul", this.useXulWrapper);
if (this.useXulWrapper) {
// When using a XUL panel as the wrapper, the actual markup for the tooltip is as

Просмотреть файл

@ -42,7 +42,7 @@
/* Tooltips */
--theme-tooltip-color: var(--theme-body-color);
--theme-tooltip-background: rgb(255, 255, 255);
--theme-tooltip-shadow: rgba(155, 155, 155, 0.26);
--theme-tooltip-shadow: var(--grey-90-a10);
/* Doorhangers */
/* These colors are based on the colors used for doorhangers elsewhere in
@ -127,7 +127,7 @@ strong {
background: transparent;
pointer-events: none;
overflow: hidden;
filter: drop-shadow(0 3px 4px var(--theme-tooltip-shadow));
filter: drop-shadow(0 2px 8px var(--theme-tooltip-shadow));
}
.tooltip-xul-wrapper {
@ -205,7 +205,7 @@ strong {
min-height: 10px;
box-sizing: border-box;
width: 100%;
border-radius: 5px;
border-radius: var(--theme-arrowpanel-border-radius);
}
.tooltip-top[type="arrow"] .tooltip-panel {
@ -234,11 +234,11 @@ strong {
}
.tooltip-top .tooltip-arrow {
margin-top: -3px;
margin-top: -1px;
}
.tooltip-bottom .tooltip-arrow {
margin-bottom: -3px;
margin-bottom: -1px;
}
.tooltip-arrow:before {
@ -254,7 +254,7 @@ strong {
}
.tooltip-bottom .tooltip-arrow:before {
margin-top: 4px;
margin-top: 5px;
transform: rotate(225deg);
}
@ -263,6 +263,12 @@ strong {
transform: rotate(45deg);
}
/* XUL panels have a default border, but pure HTML tooltips don't have one. */
.tooltip-container[type="arrow"]:not(.tooltip-container-xul) > .tooltip-panel,
.tooltip-container[type="arrow"]:not(.tooltip-container-xul) > .tooltip-arrow::before {
border: 1px solid var(--theme-arrowpanel-border-color);
}
/* Tooltip : doorhanger style */
.tooltip-container[type="doorhanger"] > .tooltip-panel {
@ -486,6 +492,7 @@ strong {
/* Tooltip: Events */
.devtools-tooltip-events-container {
border-radius: var(--theme-arrowpanel-border-radius);
height: 100%;
overflow-y: auto;
}

Просмотреть файл

@ -114,7 +114,7 @@
:root[platform="mac"].theme-light {
--theme-popup-background: hsla(0,0%,99%,.975);
--theme-popup-color: hsl(0,0%,10%);
--theme-popup-border-color: hsla(210,4%,10%,.05);
--theme-popup-border-color: var(--grey-90-a20);
}
:root.theme-dark {

Просмотреть файл

@ -11,7 +11,7 @@ support-files =
[test_child_navigation_by_location.html]
[test_marquee_event_handlers.html]
skip-if = toolkit == 'android' && !is_fennec # Bug 1455996
skip-if = true # Bug 1455996
[test_other_auxiliary_navigation_by_location.html]
skip-if = toolkit == 'android' && !is_fennec # Bug 1525959
tags = openwindow

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "MimeType.h"
#include "nsUnicharUtils.h"

Просмотреть файл

@ -2163,16 +2163,6 @@ nsDOMWindowUtils::GetUsingAdvancedLayers(bool* retval) {
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetIsWebRenderBuilt(bool* retval) {
#ifdef MOZ_BUILD_WEBRENDER
*retval = true;
#else
*retval = false;
#endif
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetIsWebRenderRequested(bool* retval) {
*retval = gfxPlatform::WebRenderPrefEnabled() ||

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
// intentionally no include guard here.
#ifndef HANDLE_WEBGL_INTERNAL_FORMAT

Просмотреть файл

@ -37,9 +37,9 @@
#include "nsThreadUtils.h"
#include "nsVideoFrame.h"
static mozilla::LazyLogModule gTrackElementLog("nsTrackElement");
#define LOG(msg, ...) \
MOZ_LOG(gTrackElementLog, LogLevel::Verbose, \
extern mozilla::LazyLogModule gTextTrackLog;
#define LOG(msg, ...) \
MOZ_LOG(gTextTrackLog, LogLevel::Verbose, \
("TextTrackElement=%p, " msg, this, ##__VA_ARGS__))
// Replace the usual NS_IMPL_NS_NEW_HTML_ELEMENT(Track) so
@ -99,7 +99,7 @@ class WindowDestroyObserver final : public nsIObserver {
NS_ENSURE_SUCCESS(rv, rv);
if (innerID == mInnerID) {
if (mTrackElement) {
mTrackElement->NotifyShutdown();
mTrackElement->CancelChannelAndListener();
}
UnRegisterWindowDestroyObserver();
}
@ -133,7 +133,7 @@ HTMLTrackElement::~HTMLTrackElement() {
if (mWindowDestroyObserver) {
mWindowDestroyObserver->UnRegisterWindowDestroyObserver();
}
NotifyShutdown();
CancelChannelAndListener();
}
NS_IMPL_ELEMENT_CLONE(HTMLTrackElement)
@ -297,10 +297,7 @@ void HTMLTrackElement::LoadResource(RefPtr<WebVTTListener>&& aWebVTTListener) {
NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv));
LOG("Trying to load from src=%s", NS_ConvertUTF16toUTF8(src).get());
if (mChannel) {
mChannel->Cancel(NS_BINDING_ABORTED);
mChannel = nullptr;
}
CancelChannelAndListener();
// According to
// https://www.w3.org/TR/html5/embedded-content-0.html#sourcing-out-of-band-text-tracks
@ -469,14 +466,17 @@ void HTMLTrackElement::DispatchTrustedEvent(const nsAString& aName) {
aName, CanBubble::eNo, Cancelable::eNo);
}
void HTMLTrackElement::DropChannel() { mChannel = nullptr; }
void HTMLTrackElement::NotifyShutdown() {
void HTMLTrackElement::CancelChannelAndListener() {
if (mChannel) {
mChannel->Cancel(NS_BINDING_ABORTED);
mChannel->SetNotificationCallbacks(nullptr);
mChannel = nullptr;
}
if (mListener) {
mListener->Cancel();
mListener = nullptr;
}
mChannel = nullptr;
mListener = nullptr;
}
nsresult HTMLTrackElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
@ -498,5 +498,12 @@ nsresult HTMLTrackElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
aNameSpaceID, aName, aValue, aOldValue, aMaybeScriptedPrincipal, aNotify);
}
void HTMLTrackElement::DispatchTestEvent(const nsAString& aName) {
if (!StaticPrefs::media_webvtt_testing_events()) {
return;
}
DispatchTrustedEvent(aName);
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -94,10 +94,9 @@ class HTMLTrackElement final : public nsGenericHTMLElement {
void DispatchTrackRunnable(const nsString& aEventName);
void DispatchTrustedEvent(const nsAString& aName);
void DispatchTestEvent(const nsAString& aName);
void DropChannel();
void NotifyShutdown();
void CancelChannelAndListener();
// Only load resource for the non-disabled track with media parent.
void MaybeDispatchLoadResource();

Просмотреть файл

@ -1311,11 +1311,6 @@ interface nsIDOMWindowUtils : nsISupports {
*/
readonly attribute boolean usingAdvancedLayers;
/**
* True if the current build includes WebRender.
*/
readonly attribute boolean isWebRenderBuilt;
/**
* True if webrender was requested by the user (via pref or env-var), false
* otherwise. Note that this doesn't represent whether or not webrender is

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "RemoteBrowser.h"
#include "nsFrameLoader.h"

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "js/ForOfIterator.h" // JS::ForOfIterator
#include "js/JSON.h" // JS_ParseJSON
#include "nsIScriptError.h"
@ -597,4 +603,4 @@ void DOMLocalization::ConvertStringToL10nArgs(JSContext* aCx,
newEntry->mKey = entry.mKey;
newEntry->mValue = entry.mValue;
}
}
}

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#ifndef mozilla_dom_l10n_DOMLocalization_h
#define mozilla_dom_l10n_DOMLocalization_h
@ -93,4 +99,4 @@ class DOMLocalization : public intl::Localization {
} // namespace dom
} // namespace mozilla
#endif
#endif

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "L10nMutations.h"
#include "mozilla/dom/DocumentInlines.h"

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#ifndef mozilla_dom_l10n_L10nMutations_h
#define mozilla_dom_l10n_L10nMutations_h

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "L10nOverlays.h"
#include "mozilla/dom/HTMLTemplateElement.h"
#include "mozilla/dom/HTMLInputElement.h"

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#ifndef mozilla_dom_l10n_L10nOverlays_h
#define mozilla_dom_l10n_L10nOverlays_h

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "BaseMediaResource.h"
#include "ChannelMediaResource.h"

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#if !defined(WavDumper_h_)
# define WavDumper_h_
# include <stdio.h>

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
static const uint8_t sWebMSample[] = {
0x1a, 0x45, 0xdf, 0xa3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,
0x42, 0x86, 0x81, 0x01, 0x42, 0xf7, 0x81, 0x01, 0x42, 0xf2, 0x81, 0x04,

Просмотреть файл

@ -14,6 +14,13 @@
#include "nsIInputStream.h"
#include "nsIWebVTTParserWrapper.h"
extern mozilla::LazyLogModule gTextTrackLog;
#define LOG(msg, ...) \
MOZ_LOG(gTextTrackLog, LogLevel::Debug, \
("WebVTTListener=%p, " msg, this, ##__VA_ARGS__))
#define LOG_WIHTOUT_ADDRESS(msg, ...) \
MOZ_LOG(gTextTrackLog, LogLevel::Debug, (msg, ##__VA_ARGS__))
namespace mozilla {
namespace dom {
@ -30,13 +37,10 @@ NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(WebVTTListener)
NS_IMPL_CYCLE_COLLECTING_RELEASE(WebVTTListener)
LazyLogModule gTextTrackLog("TextTrack");
#define VTT_LOG(...) MOZ_LOG(gTextTrackLog, LogLevel::Debug, (__VA_ARGS__))
WebVTTListener::WebVTTListener(HTMLTrackElement* aElement)
: mElement(aElement), mParserWrapperError(NS_OK) {
MOZ_ASSERT(mElement, "Must pass an element to the callback");
VTT_LOG("WebVTTListener created.");
LOG("Created listener for track element %p", aElement);
MOZ_DIAGNOSTIC_ASSERT(
CycleCollectedJSContext::Get() &&
!CycleCollectedJSContext::Get()->IsInStableOrMetaStableState());
@ -51,7 +55,7 @@ WebVTTListener::WebVTTListener(HTMLTrackElement* aElement)
}
}
WebVTTListener::~WebVTTListener() { VTT_LOG("WebVTTListener destroyed."); }
WebVTTListener::~WebVTTListener() { LOG("destroyed."); }
NS_IMETHODIMP
WebVTTListener::GetInterface(const nsIID& aIID, void** aResult) {
@ -59,6 +63,9 @@ WebVTTListener::GetInterface(const nsIID& aIID, void** aResult) {
}
nsresult WebVTTListener::LoadResource() {
if (IsCanceled()) {
return NS_OK;
}
// Exit if we failed to create the WebVTTParserWrapper (vtt.jsm)
NS_ENSURE_SUCCESS(mParserWrapperError, mParserWrapperError);
@ -70,6 +77,9 @@ NS_IMETHODIMP
WebVTTListener::AsyncOnChannelRedirect(nsIChannel* aOldChannel,
nsIChannel* aNewChannel, uint32_t aFlags,
nsIAsyncVerifyRedirectCallback* cb) {
if (IsCanceled()) {
return NS_OK;
}
if (mElement) {
mElement->OnChannelRedirect(aOldChannel, aNewChannel, aFlags);
}
@ -79,14 +89,24 @@ WebVTTListener::AsyncOnChannelRedirect(nsIChannel* aOldChannel,
NS_IMETHODIMP
WebVTTListener::OnStartRequest(nsIRequest* aRequest) {
VTT_LOG("WebVTTListener::OnStartRequest\n");
if (IsCanceled()) {
return NS_OK;
}
LOG("OnStartRequest");
mElement->DispatchTestEvent(NS_LITERAL_STRING("mozStartedLoadingTextTrack"));
return NS_OK;
}
NS_IMETHODIMP
WebVTTListener::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
VTT_LOG("WebVTTListener::OnStopRequest\n");
if (IsCanceled()) {
return NS_OK;
}
LOG("OnStopRequest");
if (NS_FAILED(aStatus)) {
LOG("Got error status");
mElement->SetReadyState(TextTrackReadyState::FailedToLoad);
}
// Attempt to parse any final data the parser might still have.
@ -95,7 +115,7 @@ WebVTTListener::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
mElement->SetReadyState(TextTrackReadyState::Loaded);
}
mElement->DropChannel();
mElement->CancelChannelAndListener();
return aStatus;
}
@ -106,9 +126,12 @@ nsresult WebVTTListener::ParseChunk(nsIInputStream* aInStream, void* aClosure,
uint32_t* aWriteCount) {
nsCString buffer(aFromSegment, aCount);
WebVTTListener* listener = static_cast<WebVTTListener*>(aClosure);
MOZ_ASSERT(!listener->IsCanceled());
if (NS_FAILED(listener->mParserWrapper->Parse(buffer))) {
VTT_LOG("Unable to parse chunk of WEBVTT text. Aborting.");
LOG_WIHTOUT_ADDRESS(
"WebVTTListener=%p, Unable to parse chunk of WEBVTT text. Aborting.",
listener);
*aWriteCount = 0;
return NS_ERROR_FAILURE;
}
@ -120,7 +143,11 @@ nsresult WebVTTListener::ParseChunk(nsIInputStream* aInStream, void* aClosure,
NS_IMETHODIMP
WebVTTListener::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream,
uint64_t aOffset, uint32_t aCount) {
VTT_LOG("WebVTTListener::OnDataAvailable\n");
if (IsCanceled()) {
return NS_OK;
}
LOG("OnDataAvailable");
uint32_t count = aCount;
while (count > 0) {
uint32_t read;
@ -137,6 +164,7 @@ WebVTTListener::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream,
NS_IMETHODIMP
WebVTTListener::OnCue(JS::Handle<JS::Value> aCue, JSContext* aCx) {
MOZ_ASSERT(!IsCanceled());
if (!aCue.isObject()) {
return NS_ERROR_FAILURE;
}
@ -154,19 +182,33 @@ WebVTTListener::OnCue(JS::Handle<JS::Value> aCue, JSContext* aCx) {
NS_IMETHODIMP
WebVTTListener::OnRegion(JS::Handle<JS::Value> aRegion, JSContext* aCx) {
MOZ_ASSERT(!IsCanceled());
// Nothing for this callback to do.
return NS_OK;
}
NS_IMETHODIMP
WebVTTListener::OnParsingError(int32_t errorCode, JSContext* cx) {
MOZ_ASSERT(!IsCanceled());
// We only care about files that have a bad WebVTT file signature right now
// as that means the file failed to load.
if (errorCode == ErrorCodes::BadSignature) {
LOG("parsing error");
mElement->SetReadyState(TextTrackReadyState::FailedToLoad);
}
return NS_OK;
}
bool WebVTTListener::IsCanceled() const { return mCancel; }
void WebVTTListener::Cancel() {
MOZ_ASSERT(!IsCanceled(), "Do not cancel canceled listener again!");
LOG("Cancel listen to channel's response.");
mCancel = true;
mParserWrapper->Cancel();
mParserWrapper = nullptr;
mElement = nullptr;
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -42,6 +42,14 @@ class WebVTTListener final : public nsIWebVTTListener,
*/
nsresult LoadResource();
/**
* When this listener is not going to be used anymore, its owner should take
* a responsibility to call `Cancel()` to prevent this listener making any
* changes for the track element.
*/
bool IsCanceled() const;
void Cancel();
private:
~WebVTTListener();
@ -54,6 +62,7 @@ class WebVTTListener final : public nsIWebVTTListener,
RefPtr<HTMLTrackElement> mElement;
nsCOMPtr<nsIWebVTTParserWrapper> mParserWrapper;
nsresult mParserWrapperError;
bool mCancel = false;
};
} // namespace dom

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "WidevineFileIO.h"
#include "GMPLog.h"
#include "WidevineUtils.h"

Просмотреть файл

@ -1,6 +1,12 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "HLSUtils.h"
mozilla::LogModule* GetHLSLog() {
static mozilla::LazyLogModule sLogModule("HLS");
return sLogModule;
}
}

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#if !defined(AgnosticDecoderModule_h_)
# define AgnosticDecoderModule_h_

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#ifndef WEBRTC_MODULES_BROWSER_CAPTURE_MAIN_SOURCE_BROWSER_CAPTURE_IMPL_H_
#define WEBRTC_MODULES_BROWSER_CAPTURE_MAIN_SOURCE_BROWSER_CAPTURE_IMPL_H_

Просмотреть файл

@ -1226,6 +1226,9 @@ tags = webvtt
support-files =
../../canvas/test/crossorigin/video.sjs
tags = webvtt
[test_texttrack_mode_change_during_loading.html]
skip-if = toolkit == 'android' # android(bug 1562021)
tags = webvtt
[test_texttrackcue.html]
skip-if = android_version == '17' || android_version == '22' # android(bug 1368010, bug 1372457)
tags = webvtt

Просмотреть файл

@ -0,0 +1,75 @@
<!DOCTYPE HTML>
<html>
<head>
<title>WebVTT : changing track's mode during loading</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="manifest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script class="testbody" type="text/javascript">
/**
* This test is to ensure that we won't get `error` event when we change track's
* mode during loading. In this test, track element starts loading after setting
* the src and we would start another load later just after the channel which is
* used to fetch data starts. The second load is triggered by mode changes, and
* it should stop the prevous load and won't generate any error.
*/
async function startTest() {
const video = createVideo();
const trackElement = createAndAppendtrackElemententToVideo(video);
await changeTrackModeDuringLoading(trackElement);
await waitUntilTrackLoaded(trackElement);
removeNodeAndSource(video);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [["media.webvtt.testing.events", true]]},
startTest);
/**
* The following are test helper functions.
*/
function createVideo() {
info(`create video`);
let video = document.createElement("video");
video.src = "gizmo.mp4";
document.body.appendChild(video);
return video;
}
function createAndAppendtrackElemententToVideo(video) {
let trackElement = document.createElement("track");
trackElement.default = true;
video.append(trackElement);
return trackElement;
}
async function changeTrackModeDuringLoading(trackElement) {
info(`set src to start loading`);
trackElement.src = "basic.vtt";
info(`wait until starting loading resource.`);
await once(trackElement, "mozStartedLoadingTextTrack");
info(`changeing track's mode during loading should not cause loading failed.`);
trackElement.onerror = () => {
ok(false, `Should not get error event!`);
}
trackElement.track.mode = "hidden";
}
async function waitUntilTrackLoaded(trackElement) {
if (trackElement.readyState != 2) {
info(`wait until the track finishes loading`);
await once(trackElement, "load");
}
is(trackElement.readyState, 2, "Track::ReadyState should be set to LOADED.");
is(trackElement.track.cues.length, 6, "Cue list length should be 6.");
}
</script>
</body>
</html>

Просмотреть файл

@ -223,11 +223,6 @@ class AudioEventTimeline {
return mValue;
}
float Value() const {
// TODO: Return the current value based on the timeline of the AudioContext
return mValue;
}
void SetValue(float aValue) {
// Silently don't change anything if there are any events
if (mEvents.IsEmpty()) {

Просмотреть файл

@ -37,6 +37,11 @@ class AudioParam final : public nsWrapperCache, public AudioParamTimeline {
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
float Value() {
return AudioParamTimeline::GetValueAtTime<double>(
GetParentObject()->CurrentTime());
}
// We override SetValueCurveAtTime to convert the Float32Array to the wrapper
// object.
AudioParam* SetValueCurveAtTime(const nsTArray<float>& aValues,

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "CubebDeviceEnumerator.h"
#include "mozilla/StaticPtr.h"

Просмотреть файл

@ -43,6 +43,12 @@ WebVTTParserWrapper.prototype =
};
},
cancel: function() {
this.parser.oncue = null;
this.parser.onregion = null;
this.parser.onparsingerror = null;
},
convertCueToDOMTree: function(window, cue)
{
return WebVTT.convertCueToDOMTree(window, cue.text);

Просмотреть файл

@ -52,6 +52,11 @@ interface nsIWebVTTParserWrapper : nsISupports
*/
void watch(in nsIWebVTTListener callback);
/**
* Cancel watching notifications which parser would send.
*/
void cancel();
/**
* Convert the text content of a WebVTT cue to a document fragment so that
* we can display it on the page.

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#ifndef dom_plugins_ipc_functionbrokeripcutils_h
#define dom_plugins_ipc_functionbrokeripcutils_h 1

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#ifndef dom_plugins_ipc_ipdltuple_h
#define dom_plugins_ipc_ipdltuple_h

Просмотреть файл

@ -7,6 +7,10 @@ const WORKER_BODY = "postMessage(42);\n";
// file:// tests.
add_task(async function() {
await SpecialPowers.pushPrefEnv({
set: [["privacy.file_unique_origin", false]],
});
info("Creating the tmp directory.");
let parent = Cc["@mozilla.org/file/directory_service;1"]
.getService(Ci.nsIDirectoryService)

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "mozilla/ShortcutKeys.h"
#include "../nsXBLPrototypeHandler.h"
#include "nsContentUtils.h"

Просмотреть файл

@ -1,4 +1,5 @@
#! /usr/bin/env python3
from __future__ import print_function
assert __name__ == '__main__'
'''
@ -84,7 +85,7 @@ GN_ENV['DEPOT_TOOLS_WIN_TOOLCHAIN'] = '0'
# ------------------------------------------------------------------------------
def run_checked(*args, **kwargs):
print(' ', args)
print((' ', args))
sys.stdout.flush()
return subprocess.run(args, check=True, **kwargs)
@ -293,7 +294,7 @@ def gather_libraries(roots: Sequence[str], descs: dict) -> Set[str]:
libraries = set()
def fn(target_name):
cur = descs[target_name]
print(' ' + cur['type'], target_name)
print((' ' + cur['type'], target_name))
assert has_all_includes(target_name, descs), target_name
if cur['type'] in ('shared_library', 'static_library'):
@ -308,7 +309,7 @@ def gather_libraries(roots: Sequence[str], descs: dict) -> Set[str]:
libraries = gather_libraries(ROOTS, descs)
print(f'\n{len(libraries)} libraries:')
for k in libraries:
print(' ', k)
print((' ', k))
if CHECK_ONLY:
print('\n--check complete.')
@ -570,7 +571,7 @@ def export_target(target_name) -> Set[str]:
# Write it out
mozbuild = target_dir / 'moz.build'
print(' ', ' ', f'Writing {mozbuild}')
print((' ', ' ', f'Writing {mozbuild}'))
data = b'\n'.join((x.encode() for x in lines))
mozbuild.write_bytes(data)

Просмотреть файл

@ -1,4 +1,5 @@
#! /usr/bin/env python3
from __future__ import print_function
assert __name__ != '__main__'
'''
@ -16,12 +17,12 @@ import sys
# --
def print_now(*args):
print(*args)
print((*args))
sys.stdout.flush()
def run_checked(*args, **kwargs):
print(' ', args)
print((' ', args))
sys.stdout.flush()
return subprocess.run(args, check=True, **kwargs)

Просмотреть файл

@ -212,9 +212,6 @@ static bool IsAccelAngleSupported(const nsCOMPtr<nsIGfxInfo>& gfxInfo,
if (wr::RenderThread::IsInRenderThread()) {
// We can only enter here with WebRender, so assert that this is a
// WebRender-enabled build.
#ifndef MOZ_BUILD_WEBRENDER
MOZ_ASSERT(false);
#endif
return true;
}
int32_t angleSupport;

Просмотреть файл

@ -20,7 +20,7 @@
################################################################################
# includes
from __future__ import print_function
from __future__ import absolute_import, print_function
import os
import sys
import xml.etree.ElementTree

Просмотреть файл

@ -245,7 +245,7 @@ print ("}")
print ()
print ("#undef _")
for i in range (2):
print
print()
vv = sorted (values[i].keys ())
for v in vv:
print ("#undef %s_%s" %

Просмотреть файл

@ -1,6 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
from __future__ import absolute_import
import argparse
import codecs
import locale

Просмотреть файл

@ -1755,11 +1755,6 @@ mozilla::ipc::IPCResult CompositorBridgeParent::RecvAdoptChild(
PWebRenderBridgeParent* CompositorBridgeParent::AllocPWebRenderBridgeParent(
const wr::PipelineId& aPipelineId, const LayoutDeviceIntSize& aSize) {
#ifndef MOZ_BUILD_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
MOZ_ASSERT(wr::AsLayersId(aPipelineId) == mRootLayerTreeID);
MOZ_ASSERT(!mWrBridge);
MOZ_ASSERT(!mCompositor);
@ -1828,11 +1823,6 @@ PWebRenderBridgeParent* CompositorBridgeParent::AllocPWebRenderBridgeParent(
bool CompositorBridgeParent::DeallocPWebRenderBridgeParent(
PWebRenderBridgeParent* aActor) {
#ifndef MOZ_BUILD_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
WebRenderBridgeParent* parent = static_cast<WebRenderBridgeParent*>(aActor);
{
MonitorAutoLock lock(*sIndirectLayerTreesLock);

Просмотреть файл

@ -207,11 +207,6 @@ bool ContentCompositorBridgeParent::DeallocPAPZParent(PAPZParent* aActor) {
PWebRenderBridgeParent*
ContentCompositorBridgeParent::AllocPWebRenderBridgeParent(
const wr::PipelineId& aPipelineId, const LayoutDeviceIntSize& aSize) {
#ifndef MOZ_BUILD_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
LayersId layersId = wr::AsLayersId(aPipelineId);
// Check to see if this child process has access to this layer tree.
if (!LayerTreeOwnerTracker::Get()->IsMapped(layersId, OtherPid())) {
@ -272,11 +267,6 @@ ContentCompositorBridgeParent::AllocPWebRenderBridgeParent(
bool ContentCompositorBridgeParent::DeallocPWebRenderBridgeParent(
PWebRenderBridgeParent* aActor) {
#ifndef MOZ_BUILD_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
WebRenderBridgeParent* parent = static_cast<WebRenderBridgeParent*>(aActor);
EraseLayerState(wr::AsLayersId(parent->PipelineId()));
parent->Release(); // IPDL reference

Просмотреть файл

@ -1,5 +1,6 @@
#!/usr/bin/env python
from __future__ import print_function
import locale
import subprocess
from collections import defaultdict
@ -428,7 +429,7 @@ def write_mozbuild(sources):
f.close()
print 'Wrote ' + filename
print('Wrote ' + filename)
def main():
platform_sources = generate_platform_sources()

Просмотреть файл

@ -3,6 +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/.
from __future__ import absolute_import, print_function
import platform
from unittest import skipIf

Просмотреть файл

@ -111,8 +111,7 @@ function runTest() {
var shouldGetWR = false;
try {
shouldGetWR = SpecialPowers.DOMWindowUtils.isWebRenderBuilt &&
SpecialPowers.DOMWindowUtils.isWebRenderRequested;
shouldGetWR = SpecialPowers.DOMWindowUtils.isWebRenderRequested;
} catch (e) {}
var advancedLayersEnabled = false;

Просмотреть файл

@ -2,6 +2,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/.
from __future__ import absolute_import
import os.path
import re
import sys

Просмотреть файл

@ -2960,12 +2960,6 @@ void gfxPlatform::InitWebRenderConfig() {
NS_LITERAL_CSTRING("FEATURE_FAILURE_SAFE_MODE"));
}
#ifndef MOZ_BUILD_WEBRENDER
featureWebRender.ForceDisable(
FeatureStatus::UnavailableNotBuilt, "Build doesn't include WebRender",
NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_WEBRENDER"));
#endif
#ifdef XP_WIN
if (Preferences::GetBool("gfx.webrender.force-angle", false)) {
if (!gfxConfig::IsEnabled(Feature::D3D11_HW_ANGLE)) {

Просмотреть файл

@ -6,7 +6,6 @@ To build and run WebRender in Gecko:
Ensure that rustc and cargo are in your $PATH (adding $HOME/.cargo/bin/ should be sufficient)
2. Build using |mach build|.
You don't need anything special in your mozconfig for local builds; webrender will be built by default.
If you are building a non-nightly version (e.g. beta) you may need to add |ac_add_options --enable-webrender=build| to your mozconfig.
3. Run with |MOZ_WEBRENDER=1| in your environment. e.g. |MOZ_WEBRENDER=1 ./mach run|.
Alternatively, you can set the gfx.webrender.enabled pref to true (browser restart required).
Note that on Linux, acceleration is disabled by default and it needs to be enabled for WebRender to work.

Просмотреть файл

@ -22,8 +22,6 @@ parse_deps = true
include = ["log", "euclid", "webrender", "webrender_api"]
[fn]
prefix = "WR_INLINE"
postfix = "WR_FUNC"
args = "Vertical"
rename_args = "GeckoCase"

Просмотреть файл

@ -761,7 +761,6 @@ pub unsafe extern "C" fn wr_renderer_readback(renderer: &mut Renderer,
format, &mut slice);
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_renderer_delete(renderer: *mut Renderer) {
let renderer = Box::from_raw(renderer);
@ -841,7 +840,6 @@ pub unsafe extern "C" fn wr_renderer_flush_pipeline_info(renderer: &mut Renderer
WrPipelineInfo::new(&info)
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_pipeline_info_delete(_info: WrPipelineInfo) {
// _info will be dropped here, and the drop impl on FfiVec will free
@ -1057,7 +1055,6 @@ pub unsafe extern "C" fn wr_thread_pool_new() -> *mut WrThreadPool {
Box::into_raw(Box::new(WrThreadPool(workers)))
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_thread_pool_delete(thread_pool: *mut WrThreadPool) {
Box::from_raw(thread_pool);
@ -1070,7 +1067,6 @@ pub unsafe extern "C" fn wr_program_cache_new(prof_path: &nsAString, thread_pool
Box::into_raw(Box::new(program_cache))
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_program_cache_delete(program_cache: *mut WrProgramCache) {
Box::from_raw(program_cache);
@ -1298,7 +1294,6 @@ pub extern "C" fn wr_api_create_document(
)));
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_api_delete_document(dh: &mut DocumentHandle) {
dh.api.delete_document(dh.document_id);
@ -1318,13 +1313,11 @@ pub extern "C" fn wr_api_clone(
*out_handle = Box::into_raw(Box::new(handle));
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_api_delete(dh: *mut DocumentHandle) {
let _ = Box::from_raw(dh);
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_api_shut_down(dh: &mut DocumentHandle) {
dh.api.shut_down();
@ -1348,7 +1341,6 @@ pub unsafe extern "C" fn wr_api_accumulate_memory_report(
*report += dh.api.report_memory();
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_api_clear_all_caches(dh: &mut DocumentHandle) {
dh.api.send_debug_cmd(DebugCommand::ClearCaches(ClearCache::all()));
@ -1372,7 +1364,6 @@ pub extern "C" fn wr_transaction_new(do_async: bool) -> *mut Transaction {
Box::into_raw(Box::new(make_transaction(do_async)))
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub extern "C" fn wr_transaction_delete(txn: *mut Transaction) {
unsafe { let _ = Box::from_raw(txn); }
@ -1802,7 +1793,6 @@ pub unsafe extern "C" fn wr_transaction_clear_display_list(
);
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub extern "C" fn wr_api_send_external_event(dh: &mut DocumentHandle,
evt: usize) {
@ -2035,7 +2025,6 @@ pub extern "C" fn wr_state_new(pipeline_id: WrPipelineId,
Box::into_raw(state)
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub extern "C" fn wr_state_delete(state: *mut WrState) {
assert!(unsafe { !is_in_render_thread() });
@ -3148,7 +3137,6 @@ pub extern "C" fn wr_add_ref_arc(arc: &ArcVecU8) -> *const VecU8 {
Arc::into_raw(arc.clone())
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_dec_ref_arc(arc: *const VecU8) {
Arc::from_raw(arc);
@ -3216,7 +3204,6 @@ impl WrSpatialId {
}
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_device_delete(device: *mut Device) {
Box::from_raw(device);
@ -3261,7 +3248,6 @@ pub extern "C" fn wr_shaders_new(gl_context: *mut c_void,
Box::into_raw(Box::new(shaders))
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_shaders_delete(shaders: *mut WrShaders, gl_context: *mut c_void) {
let mut device = wr_device_new(gl_context, None);

Просмотреть файл

@ -90,30 +90,8 @@ void apz_sample_transforms(mozilla::wr::WrWindowId aWindowId,
void apz_deregister_sampler(mozilla::wr::WrWindowId aWindowId);
} // extern "C"
// Some useful defines to stub out webrender binding functions for when we
// build gecko without webrender. We try to tell the compiler these functions
// are unreachable in that case, but VC++ emits a warning if it finds any
// unreachable functions invoked from destructors. That warning gets turned into
// an error and causes the build to fail. So for wr_* functions called by
// destructors in C++ classes, use WR_DESTRUCTOR_SAFE_FUNC instead, which omits
// the unreachable annotation.
#ifdef MOZ_BUILD_WEBRENDER
# define WR_INLINE
# define WR_FUNC
# define WR_DESTRUCTOR_SAFE_FUNC
#else
# define WR_INLINE inline
# define WR_FUNC \
{ MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("WebRender disabled"); }
# define WR_DESTRUCTOR_SAFE_FUNC \
{}
#endif
#include "webrender_ffi_generated.h"
#undef WR_FUNC
#undef WR_DESTRUCTOR_SAFE_FUNC
// More functions invoked from Rust code. These are down here because they
// refer to data structures from webrender_ffi_generated.h
extern "C" {

Просмотреть файл

@ -2,6 +2,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/.
from __future__ import print_function
import json
import os
import subprocess

Просмотреть файл

@ -4,6 +4,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/.
from __future__ import print_function
import contextlib
import os
import subprocess

Просмотреть файл

@ -4,6 +4,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/.
from __future__ import print_function
import subprocess
with open('reftest.log', "w") as out:

Просмотреть файл

@ -10,6 +10,7 @@
# This script expects to be run from `update-icu.sh` after the in-tree
# copy of ICU has been updated.
from __future__ import absolute_import
from __future__ import print_function
import glob

Просмотреть файл

@ -392,7 +392,7 @@ if not args.nobuild:
configure = os.path.join(DIR.js_src, 'configure')
if need_updating_configure(configure):
shutil.copyfile(configure + ".in", configure)
os.chmod(configure, 0755)
os.chmod(configure, 0o755)
# Run configure
if not args.noconf:

Просмотреть файл

@ -87,7 +87,7 @@ def split_list_per_column(reserved_word_list, column):
per_column = column_dict.setdefault(word[column], [])
per_column.append(item)
return sorted(column_dict.items(), key=lambda (char, word): ord(char))
return sorted(column_dict.items())
def generate_letter_switch(opt, unprocessed_columns, reserved_word_list,
@ -170,7 +170,7 @@ def split_list_per_length(reserved_word_list):
per_length = length_dict.setdefault(len(word), [])
per_length.append(item)
return sorted(length_dict.items(), key=lambda (length, word): length)
return sorted(length_dict.items())
def generate_switch(opt, reserved_word_list):

Просмотреть файл

@ -9184,32 +9184,6 @@ void CodeGenerator::visitStringConvertCase(LStringConvertCase* lir) {
}
}
void CodeGenerator::visitSinCos(LSinCos* lir) {
Register temp = ToRegister(lir->temp());
Register params = ToRegister(lir->temp2());
FloatRegister input = ToFloatRegister(lir->input());
FloatRegister outputSin = ToFloatRegister(lir->outputSin());
FloatRegister outputCos = ToFloatRegister(lir->outputCos());
masm.reserveStack(sizeof(double) * 2);
masm.moveStackPtrTo(params);
masm.setupUnalignedABICall(temp);
masm.passABIArg(input, MoveOp::DOUBLE);
masm.passABIArg(
MoveOperand(params, sizeof(double), MoveOperand::EFFECTIVE_ADDRESS),
MoveOp::GENERAL);
masm.passABIArg(MoveOperand(params, 0, MoveOperand::EFFECTIVE_ADDRESS),
MoveOp::GENERAL);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, js::math_sincos_impl));
masm.loadDouble(Address(masm.getStackPointer(), 0), outputCos);
masm.loadDouble(Address(masm.getStackPointer(), sizeof(double)), outputSin);
masm.freeStack(sizeof(double) * 2);
}
void CodeGenerator::visitStringSplit(LStringSplit* lir) {
pushArg(Imm32(INT32_MAX));
pushArg(ToRegister(lir->separator()));

Просмотреть файл

@ -1046,122 +1046,6 @@ void IonScript::purgeICs(Zone* zone) {
namespace js {
namespace jit {
static void OptimizeSinCos(MIRGraph& graph) {
// Now, we are looking for:
// var y = sin(x);
// var z = cos(x);
// Graph before:
// - 1 op
// - 6 mathfunction op1 Sin
// - 7 mathfunction op1 Cos
// Graph will look like:
// - 1 op
// - 5 sincos op1
// - 6 mathfunction sincos5 Sin
// - 7 mathfunction sincos5 Cos
for (MBasicBlockIterator block(graph.begin()); block != graph.end();
block++) {
for (MInstructionIterator iter(block->begin()), end(block->end());
iter != end;) {
MInstruction* ins = *iter++;
if (!ins->isMathFunction() || ins->isRecoveredOnBailout()) {
continue;
}
MMathFunction* insFunc = ins->toMathFunction();
if (insFunc->function() != MMathFunction::Sin &&
insFunc->function() != MMathFunction::Cos) {
continue;
}
// Check if sin/cos is already optimized.
if (insFunc->getOperand(0)->type() == MIRType::SinCosDouble) {
continue;
}
// insFunc is either a |sin(x)| or |cos(x)| instruction. The
// following loop iterates over the uses of |x| to check if both
// |sin(x)| and |cos(x)| instructions exist.
bool hasSin = false;
bool hasCos = false;
for (MUseDefIterator uses(insFunc->input()); uses; uses++) {
if (!uses.def()->isInstruction()) {
continue;
}
// We should replacing the argument of the sin/cos just when it
// is dominated by the |block|.
if (!block->dominates(uses.def()->block())) {
continue;
}
MInstruction* insUse = uses.def()->toInstruction();
if (!insUse->isMathFunction() || insUse->isRecoveredOnBailout()) {
continue;
}
MMathFunction* mathIns = insUse->toMathFunction();
if (!hasSin && mathIns->function() == MMathFunction::Sin) {
hasSin = true;
JitSpew(JitSpew_Sincos, "Found sin in block %d.",
mathIns->block()->id());
} else if (!hasCos && mathIns->function() == MMathFunction::Cos) {
hasCos = true;
JitSpew(JitSpew_Sincos, "Found cos in block %d.",
mathIns->block()->id());
}
if (hasCos && hasSin) {
break;
}
}
if (!hasCos || !hasSin) {
JitSpew(JitSpew_Sincos, "No sin/cos pair found.");
continue;
}
JitSpew(JitSpew_Sincos,
"Found, at least, a pair sin/cos. Adding sincos in block %d",
block->id());
// Adding the MSinCos and replacing the parameters of the
// sin(x)/cos(x) to sin(sincos(x))/cos(sincos(x)).
MSinCos* insSinCos = MSinCos::New(graph.alloc(), insFunc->input());
insSinCos->setImplicitlyUsedUnchecked();
block->insertBefore(insFunc, insSinCos);
for (MUseDefIterator uses(insFunc->input()); uses;) {
MDefinition* def = uses.def();
uses++;
if (!def->isInstruction()) {
continue;
}
// We should replacing the argument of the sin/cos just when it
// is dominated by the |block|.
if (!block->dominates(def->block())) {
continue;
}
MInstruction* insUse = def->toInstruction();
if (!insUse->isMathFunction() || insUse->isRecoveredOnBailout()) {
continue;
}
MMathFunction* mathIns = insUse->toMathFunction();
if (mathIns->function() != MMathFunction::Sin &&
mathIns->function() != MMathFunction::Cos) {
continue;
}
mathIns->replaceOperand(0, insSinCos);
JitSpew(JitSpew_Sincos, "Replacing %s by sincos in block %d",
mathIns->function() == MMathFunction::Sin ? "sin" : "cos",
mathIns->block()->id());
}
}
}
}
bool OptimizeMIR(MIRGenerator* mir) {
MIRGraph& graph = mir->graph();
GraphSpewer& gs = mir->graphSpewer();
@ -1522,17 +1406,6 @@ bool OptimizeMIR(MIRGenerator* mir) {
}
}
if (mir->optimizationInfo().sincosEnabled()) {
AutoTraceLog log(logger, TraceLogger_Sincos);
OptimizeSinCos(graph);
gs.spewPass("Sincos optimization");
AssertExtendedGraphCoherency(graph);
if (mir->shouldCancel("Sincos optimization")) {
return false;
}
}
// BCE marks bounds checks as dead, so do BCE before DCE.
if (mir->compilingWasm()) {
if (!EliminateBoundsChecks(mir, graph)) {

Просмотреть файл

@ -3234,7 +3234,6 @@ static bool IsResumableMIRType(MIRType type) {
case MIRType::Shape:
case MIRType::ObjectGroup:
case MIRType::Doublex2: // NYI, see also RSimdBox::recover
case MIRType::SinCosDouble:
case MIRType::Int64:
case MIRType::RefOrNull:
return false;

Просмотреть файл

@ -31,7 +31,6 @@ void OptimizationInfo::initNormalOptimizationInfo() {
rangeAnalysis_ = true;
reordering_ = true;
scalarReplacement_ = true;
sincos_ = true;
sink_ = true;
registerAllocator_ = RegisterAllocator_Backtracking;
@ -73,7 +72,6 @@ void OptimizationInfo::initWasmOptimizationInfo() {
edgeCaseAnalysis_ = false;
eliminateRedundantChecks_ = false;
scalarReplacement_ = false; // wasm has no objects.
sincos_ = false;
sink_ = false;
}

Просмотреть файл

@ -97,9 +97,6 @@ class OptimizationInfo {
// Toggles whether Truncation based on Range Analysis is used.
bool autoTruncate_;
// Toggles whether sincos is used.
bool sincos_;
// Toggles whether sink is used.
bool sink_;
@ -179,7 +176,6 @@ class OptimizationInfo {
rangeAnalysis_(false),
reordering_(false),
autoTruncate_(false),
sincos_(false),
sink_(false),
registerAllocator_(RegisterAllocator_Backtracking),
inlineMaxBytecodePerCallSiteHelperThread_(0),
@ -228,8 +224,6 @@ class OptimizationInfo {
return autoTruncate_ && rangeAnalysisEnabled();
}
bool sincosEnabled() const { return sincos_ && !JitOptions.disableSincos; }
bool sinkEnabled() const { return sink_ && !JitOptions.disableSink; }
bool eaaEnabled() const { return eaa_ && !JitOptions.disableEaa; }

Просмотреть файл

@ -459,7 +459,6 @@ enum class MIRType : uint8_t {
MagicUninitializedLexical, // JS_UNINITIALIZED_LEXICAL magic value.
// Types above are specialized.
Value,
SinCosDouble, // Optimizing a sin/cos to sincos.
ObjectOrNull,
None, // Invalid, used as a placeholder.
Slots, // A slots vector
@ -602,8 +601,6 @@ static inline const char* StringFromMIRType(MIRType type) {
return "MagicUninitializedLexical";
case MIRType::Value:
return "Value";
case MIRType::SinCosDouble:
return "SinCosDouble";
case MIRType::ObjectOrNull:
return "ObjectOrNull";
case MIRType::None:

Просмотреть файл

@ -122,14 +122,6 @@ DefaultJitOptions::DefaultJitOptions() {
// Toggles whether CacheIR stubs are used.
SET_DEFAULT(disableCacheIR, false);
// Toggles whether sincos optimization is globally disabled.
// See bug984018: The MacOS is the only one that has the sincos fast.
#if defined(XP_MACOSX)
SET_DEFAULT(disableSincos, false);
#else
SET_DEFAULT(disableSincos, true);
#endif
// Toggles whether sink code motion is globally disabled.
SET_DEFAULT(disableSink, true);

Просмотреть файл

@ -57,7 +57,6 @@ struct DefaultJitOptions {
bool disableRecoverIns;
bool disableScalarReplacement;
bool disableCacheIR;
bool disableSincos;
bool disableSink;
bool disableOptimizationLevels;
bool baselineInterpreter;

Просмотреть файл

@ -359,7 +359,6 @@ static void PrintHelpAndExit(int status = 0) {
" licm Loop invariant code motion\n"
" flac Fold linear arithmetic constants\n"
" eaa Effective address analysis\n"
" sincos Replace sin/cos by sincos\n"
" sink Sink transformation\n"
" regalloc Register allocation\n"
" inline Inlining\n"
@ -447,8 +446,6 @@ void jit::CheckLogging() {
EnableChannel(JitSpew_FLAC);
} else if (IsFlag(found, "eaa")) {
EnableChannel(JitSpew_EAA);
} else if (IsFlag(found, "sincos")) {
EnableChannel(JitSpew_Sincos);
} else if (IsFlag(found, "sink")) {
EnableChannel(JitSpew_Sink);
} else if (IsFlag(found, "regalloc")) {

Просмотреть файл

@ -33,8 +33,6 @@ namespace jit {
_(AliasSummaries) \
/* Information during GVN */ \
_(GVN) \
/* Information during sincos */ \
_(Sincos) \
/* Information during sinking */ \
_(Sink) \
/* Information during Range analysis */ \

Просмотреть файл

@ -367,8 +367,6 @@ static const char* DefTypeName(LDefinition::Type type) {
return "simd128int";
case LDefinition::SIMD128FLOAT:
return "simd128float";
case LDefinition::SINCOS:
return "sincos";
# ifdef JS_NUNBOX32
case LDefinition::TYPE:
return "t";

Просмотреть файл

@ -410,7 +410,6 @@ class LDefinition {
DOUBLE, // 64-bit floating-point value (FPU).
SIMD128INT, // 128-bit SIMD integer vector (FPU).
SIMD128FLOAT, // 128-bit SIMD floating point vector (FPU).
SINCOS,
#ifdef JS_NUNBOX32
// A type virtual register must be followed by a payload virtual
// register, as both will be tracked as a single gcthing.
@ -538,8 +537,6 @@ class LDefinition {
case MIRType::Value:
return LDefinition::BOX;
#endif
case MIRType::SinCosDouble:
return LDefinition::SINCOS;
case MIRType::Slots:
case MIRType::Elements:
return LDefinition::SLOTS;

Просмотреть файл

@ -1568,14 +1568,7 @@ void LIRGenerator::visitSign(MSign* ins) {
void LIRGenerator::visitMathFunction(MMathFunction* ins) {
MOZ_ASSERT(IsFloatingPointType(ins->type()));
MOZ_ASSERT_IF(ins->input()->type() != MIRType::SinCosDouble,
ins->type() == ins->input()->type());
if (ins->input()->type() == MIRType::SinCosDouble) {
MOZ_ASSERT(ins->type() == MIRType::Double);
redefine(ins, ins->input(), ins->function());
return;
}
MOZ_ASSERT(ins->type() == ins->input()->type());
LInstruction* lir;
if (ins->type() == MIRType::Double) {
@ -3409,18 +3402,6 @@ void LIRGenerator::visitArrayJoin(MArrayJoin* ins) {
assignSafepoint(lir, ins);
}
void LIRGenerator::visitSinCos(MSinCos* ins) {
MOZ_ASSERT(ins->type() == MIRType::SinCosDouble);
MOZ_ASSERT(ins->input()->type() == MIRType::Double ||
ins->input()->type() == MIRType::Float32 ||
ins->input()->type() == MIRType::Int32);
LSinCos* lir = new (alloc()) LSinCos(useRegisterAtStart(ins->input()),
tempFixed(CallTempNonArgRegs[0]),
tempFixed(CallTempNonArgRegs[1]));
defineSinCos(lir, ins);
}
void LIRGenerator::visitStringSplit(MStringSplit* ins) {
MOZ_ASSERT(ins->type() == MIRType::Object);
MOZ_ASSERT(ins->string()->type() == MIRType::String);

Просмотреть файл

@ -5231,9 +5231,6 @@ class MMathFunction : public MUnaryInstruction,
MOZ_MUST_USE bool writeRecoverData(
CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
if (input()->type() == MIRType::SinCosDouble) {
return false;
}
switch (function_) {
case Sin:
case Log:
@ -5801,26 +5798,6 @@ class MStringConvertCase : public MUnaryInstruction,
Mode mode() const { return mode_; }
};
class MSinCos : public MUnaryInstruction, public FloatingPointPolicy<0>::Data {
explicit MSinCos(MDefinition* input) : MUnaryInstruction(classOpcode, input) {
setResultType(MIRType::SinCosDouble);
specialization_ = MIRType::Double;
setMovable();
}
public:
INSTRUCTION_HEADER(SinCos)
static MSinCos* New(TempAllocator& alloc, MDefinition* input) {
return new (alloc) MSinCos(input);
}
AliasSet getAliasSet() const override { return AliasSet::None(); }
bool congruentTo(const MDefinition* ins) const override {
return congruentIfOperandsEqual(ins);
}
bool possiblyCalls() const override { return true; }
};
class MStringSplit : public MBinaryInstruction,
public MixPolicy<StringPolicy<0>, StringPolicy<1>>::Data {
CompilerObjectGroup group_;

Просмотреть файл

@ -88,7 +88,6 @@ class StackSlotAllocator {
#endif
case LDefinition::DOUBLE:
return 8;
case LDefinition::SINCOS:
case LDefinition::SIMD128INT:
case LDefinition::SIMD128FLOAT:
return 16;

Просмотреть файл

@ -601,7 +601,7 @@ template <unsigned Op>
bool DoublePolicy<Op>::staticAdjustInputs(TempAllocator& alloc,
MInstruction* def) {
MDefinition* in = def->getOperand(Op);
if (in->type() == MIRType::Double || in->type() == MIRType::SinCosDouble) {
if (in->type() == MIRType::Double) {
return true;
}

Просмотреть файл

@ -2843,26 +2843,6 @@ class LStringConvertCase : public LCallInstructionHelper<1, 1, 0> {
const LAllocation* string() { return this->getOperand(0); }
};
// Calculates sincos(x) and returns two values (sin/cos).
class LSinCos : public LCallInstructionHelper<2, 1, 2> {
public:
LIR_HEADER(SinCos)
LSinCos(const LAllocation& input, const LDefinition& temp,
const LDefinition& temp2)
: LCallInstructionHelper(classOpcode) {
setOperand(0, input);
setTemp(0, temp);
setTemp(1, temp2);
}
const LAllocation* input() { return getOperand(0); }
const LDefinition* outputSin() { return getDef(0); }
const LDefinition* outputCos() { return getDef(1); }
const LDefinition* temp() { return getTemp(0); }
const LDefinition* temp2() { return getTemp(1); }
const MSinCos* mir() const { return mir_->toSinCos(); }
};
class LStringSplit : public LCallInstructionHelper<1, 2, 0> {
public:
LIR_HEADER(StringSplit)

Просмотреть файл

@ -316,42 +316,6 @@ void LIRGeneratorShared::defineReturn(LInstruction* lir, MDefinition* mir) {
add(lir);
}
template <size_t Ops, size_t Temps>
void LIRGeneratorShared::defineSinCos(LInstructionHelper<2, Ops, Temps>* lir,
MDefinition* mir,
LDefinition::Policy policy) {
MOZ_ASSERT(lir->isCall());
uint32_t vreg = getVirtualRegister();
lir->setDef(
0, LDefinition(vreg, LDefinition::DOUBLE, LFloatReg(ReturnDoubleReg)));
#if defined(JS_CODEGEN_ARM)
lir->setDef(1, LDefinition(vreg + VREG_INCREMENT, LDefinition::DOUBLE,
LFloatReg(FloatRegister(FloatRegisters::d1,
FloatRegister::Double))));
#elif defined(JS_CODEGEN_ARM64)
lir->setDef(1, LDefinition(vreg + VREG_INCREMENT, LDefinition::DOUBLE,
LFloatReg(FloatRegister(FloatRegisters::d1,
FloatRegisters::Double))));
#elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
lir->setDef(1, LDefinition(vreg + VREG_INCREMENT, LDefinition::DOUBLE,
LFloatReg(f2)));
#elif defined(JS_CODEGEN_NONE)
MOZ_CRASH();
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
lir->setDef(1, LDefinition(vreg + VREG_INCREMENT, LDefinition::DOUBLE,
LFloatReg(xmm1)));
#else
# error "Unsupported architecture for SinCos"
#endif
getVirtualRegister();
lir->setMir(mir);
mir->setVirtualRegister(vreg);
add(lir);
}
// In LIR, we treat booleans and integers as the same low-level type (INTEGER).
// When snapshotting, we recover the actual JS type from MIR. This function
// checks that when making redefinitions, we don't accidentally coerce two
@ -367,30 +331,6 @@ static inline bool IsCompatibleLIRCoercion(MIRType to, MIRType from) {
return false;
}
// We can redefine the sin(x) and cos(x) function to return the sincos result.
void LIRGeneratorShared::redefine(MDefinition* def, MDefinition* as,
MMathFunction::Function func) {
MOZ_ASSERT(def->isMathFunction());
MOZ_ASSERT(def->type() == MIRType::Double &&
as->type() == MIRType::SinCosDouble);
MOZ_ASSERT(MMathFunction::Sin == func || MMathFunction::Cos == func);
ensureDefined(as);
MMathFunction* math = def->toMathFunction();
MOZ_ASSERT(math->function() == MMathFunction::Cos ||
math->function() == MMathFunction::Sin);
// The sincos returns two values:
// - VREG: it returns the sin's value of the sincos;
// - VREG + VREG_INCREMENT: it returns the cos' value of the sincos.
if (math->function() == MMathFunction::Sin) {
def->setVirtualRegister(as->virtualRegister());
} else {
def->setVirtualRegister(as->virtualRegister() + VREG_INCREMENT);
}
}
void LIRGeneratorShared::redefine(MDefinition* def, MDefinition* as) {
MOZ_ASSERT(IsCompatibleLIRCoercion(def->type(), as->type()));

Просмотреть файл

@ -181,11 +181,6 @@ class LIRGeneratorShared {
LInstructionHelper<INT64_PIECES, Ops, Temps>* lir, MDefinition* mir,
const LInt64Allocation& output);
template <size_t Ops, size_t Temps>
inline void defineSinCos(LInstructionHelper<2, Ops, Temps>* lir,
MDefinition* mir,
LDefinition::Policy policy = LDefinition::REGISTER);
inline void defineReturn(LInstruction* lir, MDefinition* mir);
template <size_t X>
@ -251,10 +246,6 @@ class LIRGeneratorShared {
// virtual register as |as|.
inline void redefine(MDefinition* ins, MDefinition* as);
// Redefine a sin/cos call to sincos.
inline void redefine(MDefinition* def, MDefinition* as,
MMathFunction::Function func);
template <typename LClass, typename... Args>
inline LClass* allocateVariadic(uint32_t numOperands, Args&&... args);

Просмотреть файл

@ -615,18 +615,6 @@ bool js::math_sin(JSContext* cx, unsigned argc, Value* vp) {
return math_function<math_sin_impl>(cx, argc, vp);
}
void js::math_sincos_impl(double x, double* sin, double* cos) {
AutoUnsafeCallWithABI unsafe;
#if defined(HAVE_SINCOS)
sincos(x, sin, cos);
#elif defined(HAVE___SINCOS)
__sincos(x, sin, cos);
#else
*sin = js::math_sin_impl(x);
*cos = js::math_cos_impl(x);
#endif
}
double js::math_sqrt_impl(double x) {
AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
return sqrt(x);

Просмотреть файл

@ -63,8 +63,6 @@ extern bool math_pow(JSContext* cx, unsigned argc, js::Value* vp);
extern bool minmax_impl(JSContext* cx, bool max, js::HandleValue a,
js::HandleValue b, js::MutableHandleValue res);
extern void math_sincos_impl(double x, double* sin, double* cos);
extern bool math_imul_handle(JSContext* cx, HandleValue lhs, HandleValue rhs,
MutableHandleValue res);

Просмотреть файл

@ -990,8 +990,6 @@ fi
dnl Checks for math functions.
dnl ========================================================
AC_CHECK_LIB(m, sin)
AC_CHECK_LIB(m, sincos, AC_DEFINE(HAVE_SINCOS))
AC_CHECK_LIB(m, __sincos, AC_DEFINE(HAVE___SINCOS))
AC_CACHE_CHECK(
[for res_ninit()],

Просмотреть файл

@ -10333,16 +10333,6 @@ static bool SetContextOptions(JSContext* cx, const OptionParser& op) {
}
}
if (const char* str = op.getStringOption("ion-sincos")) {
if (strcmp(str, "on") == 0) {
jit::JitOptions.disableSincos = false;
} else if (strcmp(str, "off") == 0) {
jit::JitOptions.disableSincos = true;
} else {
return OptionFailure("ion-sincos", str);
}
}
if (const char* str = op.getStringOption("ion-sink")) {
if (strcmp(str, "on") == 0) {
jit::JitOptions.disableSink = false;
@ -10993,15 +10983,6 @@ int main(int argc, char** argv, char** envp) {
"Profile guided optimization (default: on, off to disable)") ||
!op.addStringOption('\0', "ion-range-analysis", "on/off",
"Range analysis (default: on, off to disable)") ||
#if defined(__APPLE__)
!op.addStringOption(
'\0', "ion-sincos", "on/off",
"Replace sin(x)/cos(x) to sincos(x) (default: on, off to disable)") ||
#else
!op.addStringOption(
'\0', "ion-sincos", "on/off",
"Replace sin(x)/cos(x) to sincos(x) (default: off, on to enable)") ||
#endif
!op.addStringOption('\0', "ion-sink", "on/off",
"Sink code motion (default: off, on to enable)") ||
!op.addStringOption('\0', "ion-optimization-levels", "on/off",

Просмотреть файл

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "vm/List-inl.h"
using namespace js;

Просмотреть файл

@ -204,7 +204,6 @@ void TraceLoggerThreadState::enableIonLogging() {
enabledTextIds[TraceLogger_AliasAnalysis] = true;
enabledTextIds[TraceLogger_GVN] = true;
enabledTextIds[TraceLogger_LICM] = true;
enabledTextIds[TraceLogger_Sincos] = true;
enabledTextIds[TraceLogger_RangeAnalysis] = true;
enabledTextIds[TraceLogger_LoopUnrolling] = true;
enabledTextIds[TraceLogger_FoldLinearArithConstants] = true;
@ -1143,7 +1142,7 @@ bool TraceLoggerThreadState::init() {
"ScalarReplacement,\n"
" DominatorTree, PhiAnalysis, MakeLoopsContiguous, "
"ApplyTypes,\n"
" EagerSimdUnbox, AliasAnalysis, GVN, LICM, Sincos, "
" EagerSimdUnbox, AliasAnalysis, GVN, LICM, "
"RangeAnalysis,\n"
" LoopUnrolling, FoldLinearArithConstants, "
"EffectiveAddressAnalysis,\n"

Просмотреть файл

@ -61,7 +61,6 @@
_(AliasAnalysis) \
_(GVN) \
_(LICM) \
_(Sincos) \
_(RangeAnalysis) \
_(LoopUnrolling) \
_(Sink) \

Просмотреть файл

@ -2110,5 +2110,5 @@ skip-if(!asyncPan) == 1544895.html 1544895-ref.html
== 1548809.html 1548809-ref.html
!= 1552789-1.html 1552789-ref-1.html
== 1558937-1.html 1558937-1-ref.html
fuzzy-if(!webrender||!winWidget,254-255,464-1613) == 1562733-rotated-nastaliq-1.html 1562733-rotated-nastaliq-1-ref.html
fuzzy-if(!webrender||!winWidget,254-255,464-1613) fuzzy-if(geckoview&&webrender,253-253,1397-1397) == 1562733-rotated-nastaliq-1.html 1562733-rotated-nastaliq-1-ref.html
== 1562733-rotated-nastaliq-2.html 1562733-rotated-nastaliq-2-ref.html

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше