merge mozilla-central to autoland. r=merge a=merge

This commit is contained in:
Sebastian Hengst 2017-09-15 00:01:52 +02:00
Родитель cc8a228ea1 71720207e1
Коммит 220e7cecae
82 изменённых файлов: 2562 добавлений и 2402 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -407,15 +407,17 @@ var ClickEventHandler = {
}
// Handle click events from about pages
if (ownerDoc.documentURI.startsWith("about:certerror")) {
this.onCertError(originalTarget, ownerDoc);
return;
} else if (ownerDoc.documentURI.startsWith("about:blocked")) {
this.onAboutBlocked(originalTarget, ownerDoc);
return;
} else if (ownerDoc.documentURI.startsWith("about:neterror")) {
this.onAboutNetError(event, ownerDoc.documentURI);
return;
if (event.button == 0) {
if (ownerDoc.documentURI.startsWith("about:certerror")) {
this.onCertError(originalTarget, ownerDoc);
return;
} else if (ownerDoc.documentURI.startsWith("about:blocked")) {
this.onAboutBlocked(originalTarget, ownerDoc);
return;
} else if (ownerDoc.documentURI.startsWith("about:neterror")) {
this.onAboutNetError(event, ownerDoc.documentURI);
return;
}
}
let [href, node, principal] = this._hrefAndLinkNodeForClickEvent(event);

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

@ -67,6 +67,7 @@ let onClick = evt => {
};
let overlay = document.getElementById("onboarding-overlay");
overlay.addEventListener("submit", e => e.preventDefault());
overlay.addEventListener("click", onClick);
overlay.addEventListener("keypress", e => {
let { target, key } = e;

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

@ -28,6 +28,7 @@
justify-content: center;
padding: 4px 8px;
border: 1px solid transparent;
font-size: 12px;
text-decoration: none;
white-space: nowrap;
}
@ -96,7 +97,7 @@
.theme-dark .tabs .tabs-menu-item a,
.theme-light .tabs .tabs-menu-item a {
padding: 3px 15px;
padding: 3px 10px;
}
.theme-dark .tabs .tabs-menu-item:hover,
@ -109,20 +110,6 @@
background-color: var(--theme-toolbar-hover-active);
}
/* Dark Theme */
.theme-dark .tabs .tabs-menu-item {
color: var(--theme-body-color-alt);
}
.theme-dark .tabs .tabs-menu-item:hover:not(.is-active) {
color: var(--theme-focus-outline-color);
}
.theme-dark .tabs .tabs-menu-item:hover:active {
color: var(--theme-selection-color);
}
/* Firebug Theme */
.theme-firebug .tabs .tabs-navigation {

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

@ -41,7 +41,7 @@ body {
.theme-link,
.cm-s-mozilla .cm-link,
.CodeMirror-Tern-type {
color: var(--theme-highlight-purple);
color: var(--theme-comment);
}
/*

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

@ -163,6 +163,7 @@
}
.ruleview-propertyvaluecontainer a {
color: var(--theme-highlight-purple);
cursor: pointer;
}

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

@ -82,6 +82,8 @@ const ErrorDocs = {
JSMSG_DEPRECATED_DELETE_OPERAND: "Delete_in_strict_mode",
JSMSG_MISSING_FORMAL: "Missing_formal_parameter",
JSMSG_CANT_TRUNCATE_ARRAY: "Non_configurable_array_element",
JSMSG_INCOMPATIBLE_PROTO: "Called_on_incompatible_type",
JSMSG_INCOMPATIBLE_METHOD: "Called_on_incompatible_type",
};
const MIXED_CONTENT_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Mixed_content";

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

@ -8,10 +8,11 @@
#include "IPCBlobInputStreamChild.h"
#include "IPCBlobInputStreamStorage.h"
#include "mozilla/ipc/InputStreamParams.h"
#include "IPCBlobInputStreamThread.h"
#include "nsIAsyncInputStream.h"
#include "nsIStreamTransportService.h"
#include "nsITransport.h"
#include "nsNetCID.h"
#include "nsIAsyncOutputStream.h"
#include "nsIPipe.h"
#include "nsStreamUtils.h"
#include "nsStringStream.h"
#include "SlicedInputStream.h"
@ -20,25 +21,27 @@ namespace dom {
namespace {
static NS_DEFINE_CID(kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID);
class InputStreamCallbackRunnable final : public CancelableRunnable
{
public:
// Note that the execution can be synchronous in case the event target is
// null.
static void
Execute(nsIInputStreamCallback* aCallback,
nsIEventTarget* aEventTarget,
IPCBlobInputStream* aStream)
{
MOZ_ASSERT(aCallback);
RefPtr<InputStreamCallbackRunnable> runnable =
new InputStreamCallbackRunnable(aCallback, aStream);
nsCOMPtr<nsIEventTarget> target = aEventTarget;
if (!target) {
target = NS_GetCurrentThread();
if (aEventTarget) {
target->Dispatch(runnable, NS_DISPATCH_NORMAL);
} else {
runnable->Run();
}
target->Dispatch(runnable, NS_DISPATCH_NORMAL);
}
NS_IMETHOD
@ -73,14 +76,13 @@ public:
nsIEventTarget* aEventTarget,
IPCBlobInputStream* aStream)
{
MOZ_ASSERT(aCallback);
MOZ_ASSERT(aEventTarget);
RefPtr<FileMetadataCallbackRunnable> runnable =
new FileMetadataCallbackRunnable(aCallback, aStream);
nsCOMPtr<nsIEventTarget> target = aEventTarget;
if (!target) {
target = NS_GetCurrentThread();
}
target->Dispatch(runnable, NS_DISPATCH_NORMAL);
}
@ -508,7 +510,9 @@ IPCBlobInputStream::OnInputStreamReady(nsIAsyncInputStream* aStream)
nsCOMPtr<nsIEventTarget> callbackEventTarget;
callbackEventTarget.swap(mInputStreamCallbackEventTarget);
// This must be the last operation because the execution of the callback can
// be synchronous.
InputStreamCallbackRunnable::Execute(callback, callbackEventTarget, this);
return NS_OK;
}
@ -547,6 +551,13 @@ NS_IMETHODIMP
IPCBlobInputStream::AsyncWait(nsIFileMetadataCallback* aCallback,
nsIEventTarget* aEventTarget)
{
MOZ_ASSERT(!!aCallback == !!aEventTarget);
// If we have the callback, we must have the event target.
if (NS_WARN_IF(!!aCallback != !!aEventTarget)) {
return NS_ERROR_FAILURE;
}
// See IPCBlobInputStream.h for more information about this state machine.
switch (mState) {
@ -639,32 +650,30 @@ IPCBlobInputStream::EnsureAsyncRemoteStream()
nsCOMPtr<nsIAsyncInputStream> asyncStream = do_QueryInterface(mRemoteStream);
if (!asyncStream || !nonBlocking) {
nsCOMPtr<nsIStreamTransportService> sts =
do_GetService(kStreamTransportServiceCID, &rv);
// Let's make the stream async using the DOMFile thread.
nsCOMPtr<nsIAsyncInputStream> pipeIn;
nsCOMPtr<nsIAsyncOutputStream> pipeOut;
rv = NS_NewPipe2(getter_AddRefs(pipeIn),
getter_AddRefs(pipeOut),
true, true);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCOMPtr<nsITransport> transport;
rv = sts->CreateInputTransport(mRemoteStream,
/* aStartOffset */ 0,
/* aReadLimit */ -1,
/* aCloseWhenDone */ true,
getter_AddRefs(transport));
RefPtr<IPCBlobInputStreamThread> thread =
IPCBlobInputStreamThread::GetOrCreate();
if (NS_WARN_IF(!thread)) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIEventTarget> target = thread->EventTarget();
rv = NS_AsyncCopy(mRemoteStream, pipeOut, target,
NS_ASYNCCOPY_VIA_WRITESEGMENTS);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCOMPtr<nsIInputStream> wrapper;
rv = transport->OpenInputStream(/* aFlags */ 0,
/* aSegmentSize */ 0,
/* aSegmentCount */ 0,
getter_AddRefs(wrapper));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
asyncStream = do_QueryInterface(wrapper);
asyncStream = pipeIn;
}
MOZ_ASSERT(asyncStream);

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

@ -187,6 +187,8 @@ IPCBlobInputStreamChild::ActorDestroy(IProtocol::ActorDestroyReason aReason)
// thread.
RefPtr<IPCBlobInputStreamThread> thread =
IPCBlobInputStreamThread::GetOrCreate();
MOZ_ASSERT(thread, "We cannot continue without DOMFile thread.");
ResetManager();
thread->MigrateActor(this);
return;
@ -277,7 +279,7 @@ IPCBlobInputStreamChild::StreamNeeded(IPCBlobInputStream* aStream,
PendingOperation* opt = mPendingOperations.AppendElement();
opt->mStream = aStream;
opt->mEventTarget = aEventTarget ? aEventTarget : NS_GetCurrentThread();
opt->mEventTarget = aEventTarget;
if (mState == eActiveMigrating || mState == eInactiveMigrating) {
// This operation will be continued when the migration is completed.
@ -316,7 +318,16 @@ IPCBlobInputStreamChild::RecvStreamReady(const OptionalIPCStream& aStream)
RefPtr<StreamReadyRunnable> runnable =
new StreamReadyRunnable(pendingStream, stream);
eventTarget->Dispatch(runnable, NS_DISPATCH_NORMAL);
// If IPCBlobInputStream::AsyncWait() has been executed without passing an
// event target, we run the callback synchronous because any thread could be
// result to be the wrong one. See more in nsIAsyncInputStream::asyncWait
// documentation.
if (eventTarget) {
eventTarget->Dispatch(runnable, NS_DISPATCH_NORMAL);
} else {
runnable->Run();
}
return IPC_OK();
}

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

@ -36,7 +36,7 @@ public:
{
mozilla::StaticMutexAutoLock lock(gIPCBlobThreadMutex);
MOZ_ASSERT(gIPCBlobThread);
gIPCBlobThread->Initialize();
gIPCBlobThread->InitializeOnMainThread();
return NS_OK;
}
};
@ -115,36 +115,21 @@ IPCBlobInputStreamThread::GetOrCreate()
if (!gIPCBlobThread) {
gIPCBlobThread = new IPCBlobInputStreamThread();
gIPCBlobThread->Initialize();
if (!gIPCBlobThread->Initialize()) {
return nullptr;
}
}
return gIPCBlobThread;
}
void
bool
IPCBlobInputStreamThread::Initialize()
{
if (!NS_IsMainThread()) {
RefPtr<Runnable> runnable = new ThreadInitializeRunnable();
SystemGroup::Dispatch(TaskCategory::Other, runnable.forget());
return;
}
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
if (NS_WARN_IF(!obs)) {
return;
}
nsresult rv =
obs->AddObserver(this, NS_XPCOM_SHUTDOWN_THREADS_OBSERVER_ID, false);
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
nsCOMPtr<nsIThread> thread;
rv = NS_NewNamedThread("DOM File", getter_AddRefs(thread));
nsresult rv = NS_NewNamedThread("DOM File", getter_AddRefs(thread));
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
return false;
}
mThread = thread;
@ -156,6 +141,38 @@ IPCBlobInputStreamThread::Initialize()
mPendingActors.Clear();
}
if (!NS_IsMainThread()) {
RefPtr<Runnable> runnable = new ThreadInitializeRunnable();
SystemGroup::Dispatch(TaskCategory::Other, runnable.forget());
return true;
}
InitializeOnMainThread();
return true;
}
void
IPCBlobInputStreamThread::InitializeOnMainThread()
{
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
if (NS_WARN_IF(!obs)) {
return;
}
nsresult rv =
obs->AddObserver(this, NS_XPCOM_SHUTDOWN_THREADS_OBSERVER_ID, false);
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
}
nsIEventTarget*
IPCBlobInputStreamThread::EventTarget() const
{
return mThread;
}
NS_IMETHODIMP

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

@ -31,9 +31,15 @@ public:
void
MigrateActor(IPCBlobInputStreamChild* aActor);
void
bool
Initialize();
void
InitializeOnMainThread();
nsIEventTarget*
EventTarget() const;
private:
~IPCBlobInputStreamThread() = default;

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

@ -161,6 +161,7 @@ skip-if = os == 'linux' || os == 'mac' || os == 'win' || toolkit == 'android' #
skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_forwarding_basicAudioVideoCombined.html]
skip-if = toolkit == 'android' # Bug 1189784
[test_peerConnection_maxFsConstraint.html]
[test_peerConnection_noTrickleAnswer.html]
skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_noTrickleOffer.html]

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

@ -0,0 +1,96 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({
bug: "1393687",
title: "Enforce max-fs constraint on a PeerConnection",
visible: true
});
const pushPrefs = (...p) => SpecialPowers.pushPrefEnv({set: p});
var mustRejectWith = (msg, reason, f) =>
f().then(() => ok(false, msg),
e => is(e.name, reason, msg));
var removeAllButCodec = (d, codec) =>
(d.sdp = d.sdp.replace(/m=video (\w) UDP\/TLS\/RTP\/SAVPF \w.*\r\n/,
"m=video $1 UDP/TLS/RTP/SAVPF " + codec + "\r\n"), d);
var mungeSDP = (d, forceH264) => {
if (forceH264) {
removeAllButCodec(d, 126);
d.sdp = d.sdp.replace(/a=fmtp:126 (.*);packetization-mode=1/, "a=fmtp:126 $1;packetization-mode=1;max-fs=100");
} else {
d.sdp = d.sdp.replace(/max-fs=\d+/, "max-fs=100");
}
return d;
};
function testScale(codec) {
var v1 = createMediaElement('video', 'v1');
var v2 = createMediaElement('video', 'v2');
var pc1 = new RTCPeerConnection();
var pc2 = new RTCPeerConnection();
var add = (pc, can, failed) => can && pc.addIceCandidate(can).catch(failed);
pc1.onicecandidate = e => add(pc2, e.candidate, generateErrorCallback());
pc2.onicecandidate = e => add(pc1, e.candidate, generateErrorCallback());
info("testing max-fs with" + codec);
pc1.onnegotiationneeded = e =>
pc1.createOffer()
.then(d => pc1.setLocalDescription(mungeSDP(d, codec == "H264")))
.then(() => pc2.setRemoteDescription(pc1.localDescription))
.then(() => pc2.createAnswer()).then(d => pc2.setLocalDescription(mungeSDP(d, codec =="H264")))
.then(() => pc1.setRemoteDescription(pc2.localDescription))
.catch(generateErrorCallback());
pc2.ontrack = e => {
v2.srcObject = e.streams[0];
};
var stream;
return navigator.mediaDevices.getUserMedia({ video: true })
.then(s => {
stream = s;
v1.srcObject = stream;
let track = stream.getVideoTracks()[0];
let sender = pc1.addTrack(track, stream);
is(v2.currentTime, 0, "v2.currentTime is zero at outset");
})
.then(() => wait(5000))
.then(() => {
if (v2.videoWidth == 0 && v2.videoHeight == 0) {
info("Skipping test, insufficient time for video to start.");
} else {
is(v2.videoWidth, 160, "sink width should be 160 for " + codec);
is(v2.videoHeight, 120, "sink height should be 120 for " + codec);
}})
.then(() => {
stream.getTracks().forEach(track => track.stop());
v1.srcObject = v2.srcObject = null;
}).catch(generateErrorCallback());
}
pushPrefs(['media.peerconnection.video.lock_scaling', true]).then(() => {
if (!navigator.appVersion.includes("Android")) {
runNetworkTest(() => testScale("VP8").then(() => testScale("H264"))
.then(networkTestFinished));
} else {
// No support for H.264 on Android in automation, see Bug 1355786
runNetworkTest(() => testScale("VP8").then(networkTestFinished));
}
});
</script>
</pre>
</body>
</html>

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

@ -54,6 +54,10 @@ nsContentSecurityManager::AllowTopLevelNavigationToDataURI(
!StringBeginsWith(filePath, NS_LITERAL_CSTRING("image/svg+xml"))) {
return true;
}
// Whitelist data: PDFs
if (StringBeginsWith(filePath, NS_LITERAL_CSTRING("application/pdf"))) {
return true;
}
if (!aLoadFromExternal &&
nsContentUtils::IsSystemPrincipal(aTriggeringPrincipal)) {
return true;

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

@ -15,3 +15,5 @@ support-files =
skip-if = toolkit == 'android' # intermittent failure
[test_block_toplevel_data_img_navigation.html]
skip-if = toolkit == 'android' # intermittent failure
[test_allow_opening_data_pdf.html]
skip-if = toolkit == 'android'

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

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Bug 1398692: Allow toplevel navigation to a data:application/pdf</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
function test_toplevel_data_pdf() {
// The PDF contains one page and it is a 3/72" square, the minimum allowed by the spec
const DATA_PDF =
"data:application/pdf;base64,JVBERi0xLjANCjEgMCBvYmo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PmVuZG9iaiAyIDAgb2JqPDwvVHlwZS9QYWdlcy9LaWRzWzMgMCBSXS9Db3VudCAxPj5lbmRvYmogMyAwIG9iajw8L1R5cGUvUGFnZS9NZWRpYUJveFswIDAgMyAzXT4+ZW5kb2JqDQp4cmVmDQowIDQNCjAwMDAwMDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAxMCAwMDAwMCBuDQowMDAwMDAwMDUzIDAwMDAwIG4NCjAwMDAwMDAxMDIgMDAwMDAgbg0KdHJhaWxlcjw8L1NpemUgNC9Sb290IDEgMCBSPj4NCnN0YXJ0eHJlZg0KMTQ5DQolRU9G";
let win = window.open(DATA_PDF);
let wrappedWin = SpecialPowers.wrap(win);
// Unfortunately we can't detect whether the PDF has loaded or not using some
// event, hence we are constantly polling location.href till we see that
// the data: URI appears. Test times out on failure.
var pdfLoaded = setInterval(function() {
if (wrappedWin.document.location.href.startsWith("data:application/pdf")) {
clearInterval(pdfLoaded);
ok(true, "navigating to data:application/pdf allowed");
wrappedWin.close();
SimpleTest.finish();
}
}, 200);
}
SpecialPowers.pushPrefEnv({
set: [["security.data_uri.block_toplevel_data_uri_navigations", true]]
}, test_toplevel_data_pdf);
</script>
</body>
</html>

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

@ -37,6 +37,7 @@ enum class CommandType : int8_t {
POPCLIP,
POPLAYER,
SETTRANSFORM,
SETPERMITSUBPIXELAA,
FLUSH
};
@ -675,6 +676,25 @@ private:
Matrix mTransform;
};
class SetPermitSubpixelAACommand : public DrawingCommand
{
friend class DrawTargetCaptureImpl;
public:
explicit SetPermitSubpixelAACommand(bool aPermitSubpixelAA)
: DrawingCommand(CommandType::SETPERMITSUBPIXELAA)
, mPermitSubpixelAA(aPermitSubpixelAA)
{
}
virtual void ExecuteOnDT(DrawTarget* aDT, const Matrix* aMatrix) const
{
aDT->SetPermitSubpixelAA(mPermitSubpixelAA);
}
private:
bool mPermitSubpixelAA;
};
class FlushCommand : public DrawingCommand
{
public:

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

@ -77,6 +77,17 @@ DrawTargetCaptureImpl::DetachAllSnapshots()
#define AppendCommand(arg) new (AppendToCommandList<arg>()) arg
void
DrawTargetCaptureImpl::SetPermitSubpixelAA(bool aPermitSubpixelAA)
{
AppendCommand(SetPermitSubpixelAACommand)(aPermitSubpixelAA);
// Have to update mPermitSubpixelAA for this DT
// because some code paths query the current setting
// to determine subpixel AA eligibility.
DrawTarget::SetPermitSubpixelAA(aPermitSubpixelAA);
}
void
DrawTargetCaptureImpl::DrawSurface(SourceSurface *aSurface,
const Rect &aDest,

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

@ -27,6 +27,7 @@ public:
virtual DrawTargetType GetType() const override { return mRefDT->GetType(); }
virtual bool IsCaptureDT() const override { return true; }
virtual already_AddRefed<SourceSurface> Snapshot() override;
virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) override;
virtual void DetachAllSnapshots() override;
virtual IntSize GetSize() override { return mSize; }
virtual void Flush() override {}

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

@ -2160,6 +2160,7 @@ BorderLayer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
CanvasLayer::CanvasLayer(LayerManager* aManager, void* aImplData)
: Layer(aManager, aImplData)
, mSamplingFilter(SamplingFilter::GOOD)
{
}

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

@ -9,12 +9,14 @@
#include "mozilla/layers/CompositorBridgeParent.h"
#include "mozilla/layers/CrossProcessCompositorBridgeParent.h"
#include "mozilla/layers/CompositorThread.h"
#include "nsAutoPtr.h"
#include "VsyncSource.h"
namespace mozilla {
namespace layers {
StaticRefPtr<CompositorManagerParent> CompositorManagerParent::sInstance;
StaticAutoPtr<nsTArray<CompositorManagerParent*>> CompositorManagerParent::sActiveActors;
StaticMutex CompositorManagerParent::sMutex;
/* static */ already_AddRefed<CompositorManagerParent>
@ -44,6 +46,11 @@ CompositorManagerParent::CreateSameProcess()
// we don't use that in the same process case.
parent.get()->AddRef();
sInstance = parent;
if (!sActiveActors) {
sActiveActors = new nsTArray<CompositorManagerParent*>();
}
sActiveActors->AppendElement(parent);
return parent.forget();
}
@ -127,6 +134,12 @@ CompositorManagerParent::Bind(Endpoint<PCompositorManagerParent>&& aEndpoint)
// Add the IPDL reference to ourself, so we can't get freed until IPDL is
// done with us.
AddRef();
StaticMutexAutoLock lock(sMutex);
if (!sActiveActors) {
sActiveActors = new nsTArray<CompositorManagerParent*>();
}
sActiveActors->AppendElement(this);
}
void
@ -146,6 +159,10 @@ CompositorManagerParent::DeallocPCompositorManagerParent()
this,
&CompositorManagerParent::DeferredDestroy));
StaticMutexAutoLock lock(sMutex);
if (sActiveActors) {
sActiveActors->RemoveElement(this);
}
Release();
}
@ -155,6 +172,36 @@ CompositorManagerParent::DeferredDestroy()
mCompositorThreadHolder = nullptr;
}
/* static */ void
CompositorManagerParent::ShutdownInternal()
{
nsAutoPtr<nsTArray<CompositorManagerParent*>> actors;
// We move here because we may attempt to acquire the same lock during the
// destroy to remove the reference in sActiveActors.
{
StaticMutexAutoLock lock(sMutex);
actors = sActiveActors.forget();
}
if (actors) {
for (auto& actor : *actors) {
actor->Close();
}
}
}
/* static */ void
CompositorManagerParent::Shutdown()
{
MOZ_ASSERT(NS_IsMainThread());
CompositorThreadHolder::Loop()->PostTask(
NS_NewRunnableFunction("layers::CompositorManagerParent::Shutdown", []() -> void {
CompositorManagerParent::ShutdownInternal();
}));
}
PCompositorBridgeParent*
CompositorManagerParent::AllocPCompositorBridgeParent(const CompositorBridgeOptions& aOpt)
{

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

@ -27,6 +27,7 @@ class CompositorManagerParent final : public PCompositorManagerParent
public:
static already_AddRefed<CompositorManagerParent> CreateSameProcess();
static void Create(Endpoint<PCompositorManagerParent>&& aEndpoint);
static void Shutdown();
static already_AddRefed<CompositorBridgeParent>
CreateSameProcessWidgetCompositorBridge(CSSToLayoutDeviceScale aScale,
@ -41,8 +42,11 @@ public:
private:
static StaticRefPtr<CompositorManagerParent> sInstance;
static StaticAutoPtr<nsTArray<CompositorManagerParent*>> sActiveActors;
static StaticMutex sMutex;
static void ShutdownInternal();
CompositorManagerParent();
~CompositorManagerParent() override;

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

@ -159,6 +159,7 @@ CompositorThreadHolder::Shutdown()
ReleaseImageBridgeParentSingleton();
gfx::ReleaseVRManagerParentSingleton();
MediaSystemResourceService::Shutdown();
CompositorManagerParent::Shutdown();
sCompositorThreadHolder = nullptr;

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

@ -1573,7 +1573,7 @@ js::RegExpPrototypeOptimizable(JSContext* cx, unsigned argc, Value* vp)
bool
js::RegExpPrototypeOptimizableRaw(JSContext* cx, JSObject* proto)
{
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
AutoAssertNoPendingException aanpe(cx);
if (!proto->isNative())
return false;
@ -1666,7 +1666,7 @@ js::RegExpInstanceOptimizable(JSContext* cx, unsigned argc, Value* vp)
bool
js::RegExpInstanceOptimizableRaw(JSContext* cx, JSObject* obj, JSObject* proto)
{
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
AutoAssertNoPendingException aanpe(cx);
RegExpObject* rx = &obj->as<RegExpObject>();

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

@ -40,6 +40,8 @@ int
irregexp::CaseInsensitiveCompareStrings(const CharT* substring1, const CharT* substring2,
size_t byteLength)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(byteLength % sizeof(CharT) == 0);
size_t length = byteLength / sizeof(CharT);
@ -70,6 +72,8 @@ int
irregexp::CaseInsensitiveCompareUCStrings(const CharT* substring1, const CharT* substring2,
size_t byteLength)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(byteLength % sizeof(CharT) == 0);
size_t length = byteLength / sizeof(CharT);

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

@ -47,6 +47,7 @@ RegExpStackScope::~RegExpStackScope()
int
irregexp::GrowBacktrackStack(JSRuntime* rt)
{
AutoUnsafeCallWithABI unsafe;
return TlsContext.get()->regexpStack.ref().grow();
}

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

@ -153,6 +153,11 @@ testComparison32('gt_u', 40, 40, 0);
testComparison32('ge_s', 40, 40, 1);
testComparison32('ge_u', 40, 40, 1);
// On 32-bit debug builds, with --ion-eager, this test can run into our
// per-process JIT code limits and OOM. Trigger a GC to discard code.
if (getJitCompilerOptions()["ion.warmup.trigger"] === 0)
gc();
// Test MTest's GVN branch inversion.
var testTrunc = wasmEvalText(`(module (func (param f32) (result i32) (if i32 (i32.eqz (i32.trunc_s/f32 (get_local 0))) (i32.const 0) (i32.const 1))) (export "" 0))`).exports[""];
assertEq(testTrunc(0), 0);

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

@ -29,6 +29,8 @@ using mozilla::IsInRange;
uint32_t
jit::Bailout(BailoutStack* sp, BaselineBailoutInfo** bailoutInfo)
{
AutoUnsafeCallWithABI unsafe;
JSContext* cx = TlsContext.get();
MOZ_ASSERT(bailoutInfo);
@ -104,6 +106,8 @@ uint32_t
jit::InvalidationBailout(InvalidationBailoutStack* sp, size_t* frameSizeOut,
BaselineBailoutInfo** bailoutInfo)
{
AutoUnsafeCallWithABI unsafe;
sp->checkInvariants();
JSContext* cx = TlsContext.get();

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

@ -988,6 +988,7 @@ EmitBranchIsReturningFromCallVM(MacroAssembler& masm, Register entry, Label* lab
static void
SyncBaselineDebugModeOSRInfo(BaselineFrame* frame, Value* vp, bool rv)
{
AutoUnsafeCallWithABI unsafe;
BaselineDebugModeOSRInfo* info = frame->debugModeOSRInfo();
MOZ_ASSERT(info);
MOZ_ASSERT(frame->script()->baselineScript()->containsCodeAddress(info->resumeAddr));
@ -1022,6 +1023,7 @@ SyncBaselineDebugModeOSRInfo(BaselineFrame* frame, Value* vp, bool rv)
static void
FinishBaselineDebugModeOSR(BaselineFrame* frame)
{
AutoUnsafeCallWithABI unsafe;
frame->deleteDebugModeOSRInfo();
// We will return to JIT code now so we have to clear the override pc.

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

@ -1591,12 +1591,14 @@ CreateDependentString::generate(MacroAssembler& masm, const JSAtomState& names,
static void*
AllocateString(JSContext* cx)
{
AutoUnsafeCallWithABI unsafe;
return js::Allocate<JSString, NoGC>(cx);
}
static void*
AllocateFatInlineString(JSContext* cx)
{
AutoUnsafeCallWithABI unsafe;
return js::Allocate<JSFatInlineString, NoGC>(cx);
}
@ -1629,6 +1631,7 @@ CreateDependentString::generateFallback(MacroAssembler& masm, LiveRegisterSet re
static void*
CreateMatchResultFallbackFunc(JSContext* cx, gc::AllocKind kind, size_t nDynamicSlots)
{
AutoUnsafeCallWithABI unsafe;
return js::Allocate<JSObject, NoGC>(cx, kind, nDynamicSlots, gc::DefaultHeap,
&ArrayObject::class_);
}
@ -4000,7 +4003,8 @@ CodeGenerator::visitCallNative(LCallNative* call)
if (jitInfo && jitInfo->type() == JSJitInfo::IgnoresReturnValueNative)
native = jitInfo->ignoresReturnValueMethod;
}
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, native));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, native), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
emitTracelogStopEvent(TraceLogger_Call);
@ -4123,7 +4127,8 @@ CodeGenerator::visitCallDOMNative(LCallDOMNative* call)
masm.passABIArg(argObj);
masm.passABIArg(argPrivate);
masm.passABIArg(argArgs);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->jitInfo()->method));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->jitInfo()->method), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
if (target->jitInfo()->isInfallible) {
masm.loadValue(Address(masm.getStackPointer(), IonDOMMethodExitFrameLayout::offsetOfResult()),
@ -7057,15 +7062,24 @@ CodeGenerator::visitMathFunctionF(LMathFunctionF* ins)
masm.passABIArg(input, MoveOp::FLOAT32);
void* funptr = nullptr;
CheckUnsafeCallWithABI check = CheckUnsafeCallWithABI::Check;
switch (ins->mir()->function()) {
case MMathFunction::Floor: funptr = JS_FUNC_TO_DATA_PTR(void*, floorf); break;
case MMathFunction::Round: funptr = JS_FUNC_TO_DATA_PTR(void*, math_roundf_impl); break;
case MMathFunction::Ceil: funptr = JS_FUNC_TO_DATA_PTR(void*, ceilf); break;
case MMathFunction::Floor:
funptr = JS_FUNC_TO_DATA_PTR(void*, floorf);
check = CheckUnsafeCallWithABI::DontCheckOther;
break;
case MMathFunction::Round:
funptr = JS_FUNC_TO_DATA_PTR(void*, math_roundf_impl);
break;
case MMathFunction::Ceil:
funptr = JS_FUNC_TO_DATA_PTR(void*, ceilf);
check = CheckUnsafeCallWithABI::DontCheckOther;
break;
default:
MOZ_CRASH("Unknown or unsupported float32 math function");
}
masm.callWithABI(funptr, MoveOp::FLOAT32);
masm.callWithABI(funptr, MoveOp::FLOAT32, check);
}
void
@ -7958,7 +7972,8 @@ JitRuntime::generateFreeStub(JSContext* cx)
masm.setupUnalignedABICall(regTemp);
masm.passABIArg(regSlots);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, js_free));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, js_free), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
masm.PopRegsInMask(save);
@ -7996,7 +8011,8 @@ JitRuntime::generateLazyLinkStub(JSContext* cx)
masm.setupUnalignedABICall(temp0);
masm.passABIArg(temp0);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, LazyLinkTopActivation));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, LazyLinkTopActivation), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.leaveExitFrame(/* stub code */ sizeof(JitCode*));
@ -11797,7 +11813,8 @@ CodeGenerator::visitGetDOMProperty(LGetDOMProperty* ins)
masm.passABIArg(ObjectReg);
masm.passABIArg(PrivateReg);
masm.passABIArg(ValueReg);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
if (ins->mir()->isInfallible()) {
masm.loadValue(Address(masm.getStackPointer(), IonDOMExitFrameLayout::offsetOfResult()),
@ -11895,7 +11912,8 @@ CodeGenerator::visitSetDOMProperty(LSetDOMProperty* ins)
masm.passABIArg(ObjectReg);
masm.passABIArg(PrivateReg);
masm.passABIArg(ValueReg);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());

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

@ -1078,7 +1078,8 @@ IonCacheIRCompiler::emitCallNativeGetterResult()
masm.passABIArg(argJSContext);
masm.passABIArg(argUintN);
masm.passABIArg(argVp);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
// Test for failure.
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
@ -1136,7 +1137,8 @@ IonCacheIRCompiler::emitCallProxyGetResult()
masm.passABIArg(argProxy);
masm.passABIArg(argId);
masm.passABIArg(argVp);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ProxyGetProperty));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ProxyGetProperty), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
// Test for failure.
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
@ -1324,6 +1326,7 @@ IonCacheIRCompiler::emitCallStringSplitResult()
static bool
GroupHasPropertyTypes(ObjectGroup* group, jsid* id, Value* v)
{
AutoUnsafeCallWithABI unsafe;
if (group->unknownProperties())
return true;
HeapTypeSet* propTypes = group->maybeGetProperty(*id);
@ -1991,7 +1994,8 @@ IonCacheIRCompiler::emitCallNativeSetter()
masm.passABIArg(argJSContext);
masm.passABIArg(argUintN);
masm.passABIArg(argVp);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
// Test for failure.
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());

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

@ -126,8 +126,22 @@ MacroAssembler::passABIArg(FloatRegister reg, MoveOp::Type type)
passABIArg(MoveOperand(reg), type);
}
template <typename T> void
MacroAssembler::callWithABI(const T& fun, MoveOp::Type result)
void
MacroAssembler::callWithABI(void* fun, MoveOp::Type result, CheckUnsafeCallWithABI check)
{
AutoProfilerCallInstrumentation profiler(*this);
callWithABINoProfiler(fun, result, check);
}
void
MacroAssembler::callWithABI(Register fun, MoveOp::Type result)
{
AutoProfilerCallInstrumentation profiler(*this);
callWithABINoProfiler(fun, result);
}
void
MacroAssembler::callWithABI(const Address& fun, MoveOp::Type result)
{
AutoProfilerCallInstrumentation profiler(*this);
callWithABINoProfiler(fun, result);

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

@ -1043,7 +1043,7 @@ FindStartOfUninitializedAndUndefinedSlots(NativeObject* templateObj, uint32_t ns
static void
AllocateObjectBufferWithInit(JSContext* cx, TypedArrayObject* obj, int32_t count)
{
JS::AutoCheckCannotGC nogc(cx);
AutoUnsafeCallWithABI unsafe;
obj->initPrivate(nullptr);
@ -1550,7 +1550,8 @@ MacroAssembler::generateBailoutTail(Register scratch, Register bailoutInfo)
loadJSContext(ReturnReg);
setupUnalignedABICall(scratch);
passABIArg(ReturnReg);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, BailoutReportOverRecursed));
callWithABI(JS_FUNC_TO_DATA_PTR(void*, BailoutReportOverRecursed), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
jump(exceptionLabel());
}
@ -1615,7 +1616,8 @@ MacroAssembler::generateBailoutTail(Register scratch, Register bailoutInfo)
// Call a stub to free allocated memory and create arguments objects.
setupUnalignedABICall(temp);
passABIArg(bailoutInfo);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, FinishBailoutToBaseline));
callWithABI(JS_FUNC_TO_DATA_PTR(void*, FinishBailoutToBaseline),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
branchTest32(Zero, ReturnReg, ReturnReg, exceptionLabel());
// Restore values where they need to be and resume execution.
@ -1653,7 +1655,8 @@ MacroAssembler::generateBailoutTail(Register scratch, Register bailoutInfo)
// Call a stub to free allocated memory and create arguments objects.
setupUnalignedABICall(temp);
passABIArg(bailoutInfo);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, FinishBailoutToBaseline));
callWithABI(JS_FUNC_TO_DATA_PTR(void*, FinishBailoutToBaseline),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
branchTest32(Zero, ReturnReg, ReturnReg, exceptionLabel());
// Restore values where they need to be and resume execution.
@ -1729,7 +1732,9 @@ MacroAssembler::assumeUnreachable(const char* output)
setupUnalignedABICall(temp);
movePtr(ImmPtr(output), temp);
passABIArg(temp);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, AssumeUnreachable_));
callWithABI(JS_FUNC_TO_DATA_PTR(void*, AssumeUnreachable_),
MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
PopRegsInMask(save);
}
@ -1753,7 +1758,10 @@ MacroAssembler::assertTestInt32(Condition cond, const T& value, const char* outp
template void MacroAssembler::assertTestInt32(Condition, const Address&, const char*);
static void
Printf0_(const char* output) {
Printf0_(const char* output)
{
AutoUnsafeCallWithABI unsafe;
// Use stderr instead of stdout because this is only used for debug
// output. stderr is less likely to interfere with the program's normal
// output, and it's always unbuffered.
@ -1778,7 +1786,9 @@ MacroAssembler::printf(const char* output)
}
static void
Printf1_(const char* output, uintptr_t value) {
Printf1_(const char* output, uintptr_t value)
{
AutoUnsafeCallWithABI unsafe;
AutoEnterOOMUnsafeRegion oomUnsafe;
js::UniqueChars line = JS_sprintf_append(nullptr, output, value);
if (!line)
@ -1824,7 +1834,8 @@ MacroAssembler::tracelogStartId(Register logger, uint32_t textId, bool force)
passABIArg(logger);
move32(Imm32(textId), temp);
passABIArg(temp);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStartEventPrivate));
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStartEventPrivate), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
PopRegsInMask(save);
}
@ -1843,7 +1854,8 @@ MacroAssembler::tracelogStartId(Register logger, Register textId)
setupUnalignedABICall(temp);
passABIArg(logger);
passABIArg(textId);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStartEventPrivate));
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStartEventPrivate), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
PopRegsInMask(save);
}
@ -1864,7 +1876,8 @@ MacroAssembler::tracelogStartEvent(Register logger, Register event)
setupUnalignedABICall(temp);
passABIArg(logger);
passABIArg(event);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogFunc));
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogFunc), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
PopRegsInMask(save);
}
@ -1887,7 +1900,8 @@ MacroAssembler::tracelogStopId(Register logger, uint32_t textId, bool force)
move32(Imm32(textId), temp);
passABIArg(temp);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStopEventPrivate));
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStopEventPrivate), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
PopRegsInMask(save);
}
@ -1906,7 +1920,8 @@ MacroAssembler::tracelogStopId(Register logger, Register textId)
setupUnalignedABICall(temp);
passABIArg(logger);
passABIArg(textId);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStopEventPrivate));
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStopEventPrivate), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
PopRegsInMask(save);
}
@ -2107,7 +2122,8 @@ MacroAssembler::outOfLineTruncateSlow(FloatRegister src, Register dest, bool wid
} else {
setupUnalignedABICall(dest);
passABIArg(src, MoveOp::DOUBLE);
callWithABI(mozilla::BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
callWithABI(mozilla::BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
}
storeCallWordResult(dest);
@ -2801,7 +2817,7 @@ MacroAssembler::passABIArg(const MoveOperand& from, MoveOp::Type type)
}
void
MacroAssembler::callWithABINoProfiler(void* fun, MoveOp::Type result)
MacroAssembler::callWithABINoProfiler(void* fun, MoveOp::Type result, CheckUnsafeCallWithABI check)
{
appendSignatureType(result);
#ifdef JS_SIMULATOR
@ -2810,8 +2826,33 @@ MacroAssembler::callWithABINoProfiler(void* fun, MoveOp::Type result)
uint32_t stackAdjust;
callWithABIPre(&stackAdjust);
#ifdef DEBUG
if (check == CheckUnsafeCallWithABI::Check) {
push(ReturnReg);
loadJSContext(ReturnReg);
Address flagAddr(ReturnReg, JSContext::offsetOfInUnsafeCallWithABI());
store32(Imm32(1), flagAddr);
pop(ReturnReg);
}
#endif
call(ImmPtr(fun));
callWithABIPost(stackAdjust, result);
#ifdef DEBUG
if (check == CheckUnsafeCallWithABI::Check) {
Label ok;
push(ReturnReg);
loadJSContext(ReturnReg);
Address flagAddr(ReturnReg, JSContext::offsetOfInUnsafeCallWithABI());
branch32(Assembler::Equal, flagAddr, Imm32(0), &ok);
assumeUnreachable("callWithABI: callee did not use AutoInUnsafeCallWithABI");
bind(&ok);
pop(ReturnReg);
}
#endif
}
void

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

@ -193,6 +193,20 @@ enum class ExitFrameToken : uint8_t;
class AutoSaveLiveRegisters;
enum class CheckUnsafeCallWithABI {
// Require the callee to use AutoUnsafeCallWithABI.
Check,
// We pushed an exit frame so this callWithABI can safely GC and walk the
// stack.
DontCheckHasExitFrame,
// Don't check this callWithABI uses AutoUnsafeCallWithABI, for instance
// because we're calling a simple helper function (like malloc or js_free)
// that we can't change and/or that we know won't GC.
DontCheckOther,
};
// The public entrypoint for emitting assembly. Note that a MacroAssembler can
// use cx->lifoAlloc, so take care not to interleave masm use with other
// lifoAlloc use if one will be destroyed before the other.
@ -565,8 +579,10 @@ class MacroAssembler : public MacroAssemblerSpecific
inline void passABIArg(Register reg);
inline void passABIArg(FloatRegister reg, MoveOp::Type type);
template <typename T>
inline void callWithABI(const T& fun, MoveOp::Type result = MoveOp::GENERAL);
inline void callWithABI(void* fun, MoveOp::Type result = MoveOp::GENERAL,
CheckUnsafeCallWithABI check = CheckUnsafeCallWithABI::Check);
inline void callWithABI(Register fun, MoveOp::Type result = MoveOp::GENERAL);
inline void callWithABI(const Address& fun, MoveOp::Type result = MoveOp::GENERAL);
void callWithABI(wasm::BytecodeOffset offset, wasm::SymbolicAddress fun,
MoveOp::Type result = MoveOp::GENERAL);
@ -580,7 +596,7 @@ class MacroAssembler : public MacroAssemblerSpecific
void callWithABIPre(uint32_t* stackAdjust, bool callFromWasm = false) PER_ARCH;
// Emits a call to a C/C++ function, resolving all argument moves.
void callWithABINoProfiler(void* fun, MoveOp::Type result);
void callWithABINoProfiler(void* fun, MoveOp::Type result, CheckUnsafeCallWithABI check);
void callWithABINoProfiler(Register fun, MoveOp::Type result) PER_ARCH;
void callWithABINoProfiler(const Address& fun, MoveOp::Type result) PER_ARCH;

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

@ -1205,7 +1205,8 @@ ICBinaryArith_DoubleWithInt32::Compiler::generateStubCode(MacroAssembler& masm)
masm.push(intReg);
masm.setupUnalignedABICall(scratchReg);
masm.passABIArg(FloatReg0, MoveOp::DOUBLE);
masm.callWithABI(mozilla::BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
masm.callWithABI(mozilla::BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
masm.storeCallWordResult(scratchReg);
masm.pop(intReg);
@ -1358,7 +1359,8 @@ ICUnaryArith_Double::Compiler::generateStubCode(MacroAssembler& masm)
masm.bind(&truncateABICall);
masm.setupUnalignedABICall(scratchReg);
masm.passABIArg(FloatReg0, MoveOp::DOUBLE);
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
masm.storeCallWordResult(scratchReg);
masm.bind(&doneTruncate);

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

@ -544,6 +544,7 @@ InterruptCheck(JSContext* cx)
void*
MallocWrapper(JSRuntime* rt, size_t nbytes)
{
AutoUnsafeCallWithABI unsafe;
return rt->pod_malloc<uint8_t>(nbytes);
}
@ -649,6 +650,8 @@ GetDynamicName(JSContext* cx, JSObject* envChain, JSString* str, Value* vp)
// undefined through rval. This function is infallible, and cannot GC or
// invalidate.
AutoUnsafeCallWithABI unsafe;
JSAtom* atom;
if (str->isAtom()) {
atom = &str->asAtom();
@ -679,7 +682,7 @@ GetDynamicName(JSContext* cx, JSObject* envChain, JSString* str, Value* vp)
void
PostWriteBarrier(JSRuntime* rt, JSObject* obj)
{
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(!IsInsideNursery(obj));
rt->gc.storeBuffer().putWholeCell(obj);
}
@ -690,7 +693,7 @@ template <IndexInBounds InBounds>
void
PostWriteElementBarrier(JSRuntime* rt, JSObject* obj, int32_t index)
{
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(!IsInsideNursery(obj));
@ -744,7 +747,7 @@ int32_t
GetIndexFromString(JSString* str)
{
// We shouldn't GC here as this is called directly from IC code.
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
if (!str->isFlat())
return -1;
@ -760,7 +763,7 @@ JSObject*
WrapObjectPure(JSContext* cx, JSObject* obj)
{
// IC code calls this directly so we shouldn't GC.
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(obj);
MOZ_ASSERT(cx->compartment() != obj->compartment());
@ -864,6 +867,7 @@ DebugEpilogue(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool ok)
void
FrameIsDebuggeeCheck(BaselineFrame* frame)
{
AutoUnsafeCallWithABI unsafe;
if (frame->script()->isDebuggee())
frame->setIsDebuggee();
}
@ -1140,6 +1144,7 @@ OnDebuggerStatement(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool* m
bool
GlobalHasLiveOnDebuggerStatement(JSContext* cx)
{
AutoUnsafeCallWithABI unsafe;
return cx->compartment()->isDebuggee() &&
Debugger::hasLiveHook(cx->global(), Debugger::OnDebuggerStatement);
}
@ -1232,6 +1237,7 @@ bool
InitBaselineFrameForOsr(BaselineFrame* frame, InterpreterFrame* interpFrame,
uint32_t numStackValues)
{
AutoUnsafeCallWithABI unsafe;
return frame->initForOsr(interpFrame, numStackValues);
}
@ -1318,6 +1324,7 @@ AutoDetectInvalidation::setReturnOverride()
void
AssertValidObjectPtr(JSContext* cx, JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
#ifdef DEBUG
// Check what we can, so that we'll hopefully assert/crash if we get a
// bogus object (pointer).
@ -1339,6 +1346,7 @@ AssertValidObjectPtr(JSContext* cx, JSObject* obj)
void
AssertValidObjectOrNullPtr(JSContext* cx, JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
if (obj)
AssertValidObjectPtr(cx, obj);
}
@ -1346,6 +1354,7 @@ AssertValidObjectOrNullPtr(JSContext* cx, JSObject* obj)
void
AssertValidStringPtr(JSContext* cx, JSString* str)
{
AutoUnsafeCallWithABI unsafe;
#ifdef DEBUG
// We can't closely inspect strings from another runtime.
if (str->runtimeFromAnyThread() != cx->runtime()) {
@ -1382,6 +1391,8 @@ AssertValidStringPtr(JSContext* cx, JSString* str)
void
AssertValidSymbolPtr(JSContext* cx, JS::Symbol* sym)
{
AutoUnsafeCallWithABI unsafe;
// We can't closely inspect symbols from another runtime.
if (sym->runtimeFromAnyThread() != cx->runtime()) {
MOZ_ASSERT(sym->isWellKnownSymbol());
@ -1401,6 +1412,7 @@ AssertValidSymbolPtr(JSContext* cx, JS::Symbol* sym)
void
AssertValidValue(JSContext* cx, Value* v)
{
AutoUnsafeCallWithABI unsafe;
if (v->isObject())
AssertValidObjectPtr(cx, &v->toObject());
else if (v->isString())
@ -1412,24 +1424,28 @@ AssertValidValue(JSContext* cx, Value* v)
bool
ObjectIsCallable(JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
return obj->isCallable();
}
bool
ObjectIsConstructor(JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
return obj->isConstructor();
}
void
MarkValueFromIon(JSRuntime* rt, Value* vp)
{
AutoUnsafeCallWithABI unsafe;
TraceManuallyBarrieredEdge(&rt->gc.marker, vp, "write barrier");
}
void
MarkStringFromIon(JSRuntime* rt, JSString** stringp)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(*stringp);
TraceManuallyBarrieredEdge(&rt->gc.marker, stringp, "write barrier");
}
@ -1437,6 +1453,7 @@ MarkStringFromIon(JSRuntime* rt, JSString** stringp)
void
MarkObjectFromIon(JSRuntime* rt, JSObject** objp)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(*objp);
TraceManuallyBarrieredEdge(&rt->gc.marker, objp, "write barrier");
}
@ -1444,12 +1461,14 @@ MarkObjectFromIon(JSRuntime* rt, JSObject** objp)
void
MarkShapeFromIon(JSRuntime* rt, Shape** shapep)
{
AutoUnsafeCallWithABI unsafe;
TraceManuallyBarrieredEdge(&rt->gc.marker, shapep, "write barrier");
}
void
MarkObjectGroupFromIon(JSRuntime* rt, ObjectGroup** groupp)
{
AutoUnsafeCallWithABI unsafe;
TraceManuallyBarrieredEdge(&rt->gc.marker, groupp, "write barrier");
}
@ -1551,7 +1570,7 @@ bool
EqualStringsHelper(JSString* str1, JSString* str2)
{
// IC code calls this directly so we shouldn't GC.
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(str1->isAtom());
MOZ_ASSERT(!str2->isAtom());
@ -1581,7 +1600,7 @@ GetNativeDataProperty(JSContext* cx, NativeObject* obj, jsid id, Value* vp)
// lookup paths, this is optimized to be as fast as possible for simple
// data property lookups.
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(JSID_IS_ATOM(id) || JSID_IS_SYMBOL(id));
@ -1633,7 +1652,7 @@ GetNativeDataProperty<false>(JSContext* cx, JSObject* obj, PropertyName* name, V
static MOZ_ALWAYS_INLINE bool
ValueToAtomOrSymbol(JSContext* cx, Value& idVal, jsid* id)
{
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
if (MOZ_LIKELY(idVal.isString())) {
JSString* s = idVal.toString();
@ -1666,7 +1685,7 @@ template <bool HandleMissing>
bool
GetNativeDataPropertyByValue(JSContext* cx, JSObject* obj, Value* vp)
{
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
// Condition checked by caller.
MOZ_ASSERT(obj->isNative());
@ -1691,7 +1710,7 @@ template <bool NeedsTypeBarrier>
bool
SetNativeDataProperty(JSContext* cx, JSObject* obj, PropertyName* name, Value* val)
{
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
if (MOZ_UNLIKELY(!obj->isNative()))
return false;
@ -1723,7 +1742,7 @@ SetNativeDataProperty<false>(JSContext* cx, JSObject* obj, PropertyName* name, V
bool
ObjectHasGetterSetter(JSContext* cx, JSObject* objArg, Shape* propShape)
{
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(propShape->hasGetterObject() || propShape->hasSetterObject());
@ -1766,7 +1785,7 @@ ObjectHasGetterSetter(JSContext* cx, JSObject* objArg, Shape* propShape)
bool
HasOwnNativeDataProperty(JSContext* cx, JSObject* obj, Value* vp)
{
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
// vp[0] contains the id, result will be stored in vp[1].
Value idVal = vp[0];
@ -1803,6 +1822,7 @@ HasOwnNativeDataProperty(JSContext* cx, JSObject* obj, Value* vp)
JSString*
TypeOfObject(JSObject* obj, JSRuntime* rt)
{
AutoUnsafeCallWithABI unsafe;
JSType type = js::TypeOfObject(obj);
return TypeName(type, *rt->commonNames);
}

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

@ -630,7 +630,8 @@ CodeGeneratorARM::visitSoftDivI(LSoftDivI* ins)
masm.setupAlignedABICall();
masm.passABIArg(lhs);
masm.passABIArg(rhs);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
}
// idivmod returns the quotient in r0, and the remainder in r1.
@ -819,7 +820,8 @@ CodeGeneratorARM::visitSoftModI(LSoftModI* ins)
masm.setupAlignedABICall();
masm.passABIArg(lhs);
masm.passABIArg(rhs);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
}
MOZ_ASSERT(r1 != output);
@ -2841,7 +2843,8 @@ CodeGeneratorARM::visitSoftUDivOrMod(LSoftUDivOrMod* ins)
masm.setupAlignedABICall();
masm.passABIArg(lhs);
masm.passABIArg(rhs);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_uidivmod));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_uidivmod), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
}
if (mod) {

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

@ -3598,7 +3598,7 @@ MacroAssemblerARMCompat::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(r1);
asMasm().passABIArg(r0);
asMasm().callWithABI(handler);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
Label entryFrame;
Label catch_;

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

@ -94,7 +94,8 @@ ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm)
masm.setupAlignedABICall();
masm.passABIArg(R0.payloadReg());
masm.passABIArg(R1.payloadReg());
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod));
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
// idivmod returns the quotient in r0, and the remainder in r1.
if (op_ == JSOP_DIV) {

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

@ -882,7 +882,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (outReg != InvalidReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -145,7 +145,7 @@ MacroAssemblerCompat::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(r1);
asMasm().passABIArg(r0);
asMasm().callWithABI(handler);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
Label entryFrame;
Label catch_;

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

@ -677,7 +677,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (outReg != InvalidReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -1848,7 +1848,7 @@ MacroAssemblerMIPSCompat::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(a1);
asMasm().passABIArg(a0);
asMasm().callWithABI(handler);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
Label entryFrame;
Label catch_;

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

@ -847,7 +847,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
MoveOp::GENERAL);
}
masm.callWithABI(f.wrapped);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -2030,7 +2030,7 @@ MacroAssemblerMIPS64Compat::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(a1);
asMasm().passABIArg(a0);
asMasm().callWithABI(handler);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
Label entryFrame;
Label catch_;

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

@ -793,7 +793,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (InvalidReg != outReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -307,7 +307,7 @@ MacroAssemblerX64::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(rcx);
asMasm().passABIArg(rax);
asMasm().callWithABI(handler);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
Label entryFrame;
Label catch_;

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

@ -765,7 +765,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (outReg != InvalidReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -744,7 +744,8 @@ CodeGeneratorX86::visitOutOfLineTruncate(OutOfLineTruncate* ool)
} else {
masm.setupUnalignedABICall(output);
masm.passABIArg(input, MoveOp::DOUBLE);
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
}
masm.storeCallWordResult(output);
@ -831,10 +832,12 @@ CodeGeneratorX86::visitOutOfLineTruncateFloat32(OutOfLineTruncateFloat32* ool)
masm.vcvtss2sd(input, input, input);
masm.passABIArg(input.asDouble(), MoveOp::DOUBLE);
if (gen->compilingWasm())
if (gen->compilingWasm()) {
masm.callWithABI(ins->mir()->bytecodeOffset(), wasm::SymbolicAddress::ToInt32);
else
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
} else {
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
}
masm.storeCallWordResult(output);
masm.Pop(input);

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

@ -206,7 +206,7 @@ MacroAssemblerX86::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(ecx);
asMasm().passABIArg(eax);
asMasm().callWithABI(handler);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
Label entryFrame;
Label catch_;

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

@ -795,7 +795,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (outReg != InvalidReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -1157,7 +1157,11 @@ class JS_PUBLIC_API(ContextOptions) {
werror_(false),
strictMode_(false),
extraWarnings_(false),
forEachStatement_(false)
forEachStatement_(false),
streams_(false)
#ifdef FUZZING
, fuzzing_(false)
#endif
{
}

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

@ -2424,6 +2424,7 @@ DefineBoxedOrUnboxedFunctor1(ShiftMoveBoxedOrUnboxedDenseElements, JSObject*);
void
js::ArrayShiftMoveElements(JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT_IF(obj->is<ArrayObject>(), obj->as<ArrayObject>().lengthIsWritable());
ShiftMoveBoxedOrUnboxedDenseElementsFunctor functor(obj);

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

@ -9,6 +9,8 @@
#include "jsbool.h"
#include "jscntxt.h"
#include "vm/BooleanObject.h"
#include "vm/WrapperObject.h"
@ -19,6 +21,7 @@ EmulatesUndefined(JSObject* obj)
{
// This may be called off the main thread. It's OK not to expose the object
// here as it doesn't escape.
AutoUnsafeCallWithABI unsafe;
JSObject* actual = MOZ_LIKELY(!obj->is<WrapperObject>()) ? obj : UncheckedUnwrapWithoutExpose(obj);
return actual->getClass()->emulatesUndefined();
}

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

@ -1293,6 +1293,8 @@ JSContext::JSContext(JSRuntime* runtime, const JS::ContextOptions& options)
requestDepth(0),
#ifdef DEBUG
checkRequestDepth(0),
inUnsafeCallWithABI(false),
hasAutoUnsafeCallWithABI(false),
#endif
#ifdef JS_SIMULATOR
simulator_(nullptr),
@ -1668,3 +1670,21 @@ AutoEnterOOMUnsafeRegion::crash(size_t size, const char* reason)
}
crash(reason);
}
#ifdef DEBUG
AutoUnsafeCallWithABI::AutoUnsafeCallWithABI()
: cx_(TlsContext.get()),
nested_(cx_->hasAutoUnsafeCallWithABI)
{
cx_->hasAutoUnsafeCallWithABI = true;
}
AutoUnsafeCallWithABI::~AutoUnsafeCallWithABI()
{
MOZ_ASSERT(cx_->hasAutoUnsafeCallWithABI);
if (!nested_) {
cx_->hasAutoUnsafeCallWithABI = false;
cx_->inUnsafeCallWithABI = false;
}
}
#endif

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

@ -379,6 +379,12 @@ struct JSContext : public JS::RootingContext,
return offsetof(JSContext, profilingActivation_);
}
#ifdef DEBUG
static size_t offsetOfInUnsafeCallWithABI() {
return offsetof(JSContext, inUnsafeCallWithABI);
}
#endif
private:
/* Space for interpreter frames. */
js::ThreadLocalData<js::InterpreterStack> interpreterStack_;
@ -419,6 +425,8 @@ struct JSContext : public JS::RootingContext,
#ifdef DEBUG
js::ThreadLocalData<unsigned> checkRequestDepth;
js::ThreadLocalData<uint32_t> inUnsafeCallWithABI;
js::ThreadLocalData<bool> hasAutoUnsafeCallWithABI;
#endif
#ifdef JS_SIMULATOR
@ -1286,6 +1294,23 @@ class MOZ_RAII AutoEnterIonCompilation
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
// Should be used in functions called directly from JIT code (with
// masm.callWithABI) to assert invariants in debug builds.
class MOZ_RAII AutoUnsafeCallWithABI
{
JS::AutoCheckCannotGC nogc;
#ifdef DEBUG
JSContext* cx_;
bool nested_;
#endif
public:
#ifdef DEBUG
AutoUnsafeCallWithABI();
~AutoUnsafeCallWithABI();
#endif
};
namespace gc {
// In debug builds, set/unset the performing GC flag for the current thread.

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

@ -354,8 +354,7 @@ class JSFunction : public js::NativeObject
MOZ_ASSERT(atom);
MOZ_ASSERT(!hasGuessedAtom());
MOZ_ASSERT(!isClassConstructor());
MOZ_ASSERT(js::AtomIsMarked(zone(), atom));
atom_ = atom;
setAtom(atom);
flags_ |= HAS_COMPILE_TIME_NAME;
}
JSAtom* compileTimeName() const {
@ -370,15 +369,14 @@ class JSFunction : public js::NativeObject
MOZ_ASSERT(!hasCompileTimeName());
MOZ_ASSERT(!hasGuessedAtom());
MOZ_ASSERT(!isBoundFunction());
MOZ_ASSERT(js::AtomIsMarked(zone(), atom));
atom_ = atom;
setAtom(atom);
flags_ |= HAS_GUESSED_ATOM;
}
void clearGuessedAtom() {
MOZ_ASSERT(hasGuessedAtom());
MOZ_ASSERT(!isBoundFunction());
MOZ_ASSERT(atom_);
atom_ = nullptr;
setAtom(nullptr);
flags_ &= ~HAS_GUESSED_ATOM;
}
@ -386,7 +384,7 @@ class JSFunction : public js::NativeObject
MOZ_ASSERT(!hasBoundFunctionNamePrefix());
MOZ_ASSERT(atom);
flags_ |= HAS_BOUND_FUNCTION_NAME_PREFIX;
atom_ = atom;
setAtom(atom);
}
/* uint16_t representation bounds number of call object dynamic slots. */

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

@ -11,6 +11,7 @@
#include <math.h>
#include "jscntxt.h"
#include "jsnum.h"
/*
@ -48,6 +49,7 @@ namespace js {
inline double
NumberDiv(double a, double b)
{
AutoUnsafeCallWithABI unsafe;
if (b == 0) {
if (a == 0 || mozilla::IsNaN(a)
#ifdef XP_WIN
@ -65,7 +67,9 @@ NumberDiv(double a, double b)
}
inline double
NumberMod(double a, double b) {
NumberMod(double a, double b)
{
AutoUnsafeCallWithABI unsafe;
if (b == 0)
return JS::GenericNaN();
return js_fmod(a, b);

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

@ -183,12 +183,14 @@ js::math_abs(JSContext* cx, unsigned argc, Value* vp)
double
js::math_acos_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::acos, x, MathCache::Acos);
}
double
js::math_acos_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::acos(x);
}
@ -218,12 +220,14 @@ js::math_acos(JSContext* cx, unsigned argc, Value* vp)
double
js::math_asin_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::asin, x, MathCache::Asin);
}
double
js::math_asin_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::asin(x);
}
@ -253,12 +257,14 @@ js::math_asin(JSContext* cx, unsigned argc, Value* vp)
double
js::math_atan_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::atan, x, MathCache::Atan);
}
double
js::math_atan_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::atan(x);
}
@ -288,6 +294,7 @@ js::math_atan(JSContext* cx, unsigned argc, Value* vp)
double
js::ecmaAtan2(double y, double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::atan2(y, x);
}
@ -318,6 +325,7 @@ js::math_atan2(JSContext* cx, unsigned argc, Value* vp)
double
js::math_ceil_impl(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::ceil(x);
}
@ -372,12 +380,14 @@ js::math_clz32(JSContext* cx, unsigned argc, Value* vp)
double
js::math_cos_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(cos, x, MathCache::Cos);
}
double
js::math_cos_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return cos(x);
}
@ -407,12 +417,14 @@ js::math_cos(JSContext* cx, unsigned argc, Value* vp)
double
js::math_exp_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::exp, x, MathCache::Exp);
}
double
js::math_exp_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::exp(x);
}
@ -442,6 +454,7 @@ js::math_exp(JSContext* cx, unsigned argc, Value* vp)
double
js::math_floor_impl(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::floor(x);
}
@ -532,12 +545,14 @@ js::math_fround(JSContext* cx, unsigned argc, Value* vp)
double
js::math_log_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(math_log_uncached, x, MathCache::Log);
}
double
js::math_log_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::log(x);
}
@ -573,6 +588,8 @@ js::math_log(JSContext* cx, unsigned argc, Value* vp)
double
js::math_max_impl(double x, double y)
{
AutoUnsafeCallWithABI unsafe;
// Math.max(num, NaN) => NaN, Math.max(-0, +0) => +0
if (x > y || IsNaN(x) || (x == y && IsNegative(y)))
return x;
@ -598,6 +615,8 @@ js::math_max(JSContext* cx, unsigned argc, Value* vp)
double
js::math_min_impl(double x, double y)
{
AutoUnsafeCallWithABI unsafe;
// Math.min(num, NaN) => NaN, Math.min(-0, +0) => -0
if (x < y || IsNaN(x) || (x == y && IsNegativeZero(x)))
return x;
@ -641,6 +660,7 @@ js::minmax_impl(JSContext* cx, bool max, HandleValue a, HandleValue b, MutableHa
double
js::powi(double x, int y)
{
AutoUnsafeCallWithABI unsafe;
unsigned n = (y < 0) ? -y : y;
double m = x;
double p = 1;
@ -669,6 +689,8 @@ js::powi(double x, int y)
double
js::ecmaPow(double x, double y)
{
AutoUnsafeCallWithABI unsafe;
/*
* Use powi if the exponent is an integer-valued double. We don't have to
* check for NaN since a comparison with NaN is always false.
@ -825,6 +847,8 @@ template float js::GetBiggestNumberLessThan<>(float x);
double
js::math_round_impl(double x)
{
AutoUnsafeCallWithABI unsafe;
int32_t ignored;
if (NumberIsInt32(x, &ignored))
return x;
@ -840,6 +864,8 @@ js::math_round_impl(double x)
float
js::math_roundf_impl(float x)
{
AutoUnsafeCallWithABI unsafe;
int32_t ignored;
if (NumberIsInt32(x, &ignored))
return x;
@ -868,12 +894,14 @@ js::math_round(JSContext* cx, unsigned argc, Value* vp)
double
js::math_sin_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(math_sin_uncached, x, MathCache::Sin);
}
double
js::math_sin_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
#ifdef _WIN64
// Workaround MSVC bug where sin(-0) is +0 instead of -0 on x64 on
// CPUs without FMA3 (pre-Haswell). See bug 1076670.
@ -915,6 +943,7 @@ js::math_sin(JSContext* cx, unsigned argc, Value* vp)
void
js::math_sincos_uncached(double x, double *sin, double *cos)
{
AutoUnsafeCallWithABI unsafe;
#if defined(HAVE_SINCOS)
sincos(x, sin, cos);
#elif defined(HAVE___SINCOS)
@ -928,6 +957,7 @@ js::math_sincos_uncached(double x, double *sin, double *cos)
void
js::math_sincos_impl(MathCache* mathCache, double x, double *sin, double *cos)
{
AutoUnsafeCallWithABI unsafe;
unsigned indexSin;
unsigned indexCos;
bool hasSin = mathCache->isCached(x, MathCache::Sin, sin, &indexSin);
@ -978,12 +1008,14 @@ js::math_sqrt(JSContext* cx, unsigned argc, Value* vp)
double
js::math_tan_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(tan, x, MathCache::Tan);
}
double
js::math_tan_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return tan(x);
}
@ -1037,12 +1069,14 @@ static bool math_function(JSContext* cx, unsigned argc, Value* vp)
double
js::math_log10_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::log10, x, MathCache::Log10);
}
double
js::math_log10_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::log10(x);
}
@ -1055,12 +1089,14 @@ js::math_log10(JSContext* cx, unsigned argc, Value* vp)
double
js::math_log2_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::log2, x, MathCache::Log2);
}
double
js::math_log2_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::log2(x);
}
@ -1073,12 +1109,14 @@ js::math_log2(JSContext* cx, unsigned argc, Value* vp)
double
js::math_log1p_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::log1p, x, MathCache::Log1p);
}
double
js::math_log1p_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::log1p(x);
}
@ -1091,12 +1129,14 @@ js::math_log1p(JSContext* cx, unsigned argc, Value* vp)
double
js::math_expm1_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::expm1, x, MathCache::Expm1);
}
double
js::math_expm1_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::expm1(x);
}
@ -1109,12 +1149,14 @@ js::math_expm1(JSContext* cx, unsigned argc, Value* vp)
double
js::math_cosh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::cosh, x, MathCache::Cosh);
}
double
js::math_cosh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::cosh(x);
}
@ -1127,12 +1169,14 @@ js::math_cosh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_sinh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::sinh, x, MathCache::Sinh);
}
double
js::math_sinh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::sinh(x);
}
@ -1145,12 +1189,14 @@ js::math_sinh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_tanh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::tanh, x, MathCache::Tanh);
}
double
js::math_tanh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::tanh(x);
}
@ -1163,12 +1209,14 @@ js::math_tanh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_acosh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::acosh, x, MathCache::Acosh);
}
double
js::math_acosh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::acosh(x);
}
@ -1181,12 +1229,14 @@ js::math_acosh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_asinh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::asinh, x, MathCache::Asinh);
}
double
js::math_asinh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::asinh(x);
}
@ -1199,12 +1249,14 @@ js::math_asinh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_atanh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::atanh, x, MathCache::Atanh);
}
double
js::math_atanh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::atanh(x);
}
@ -1218,6 +1270,7 @@ js::math_atanh(JSContext* cx, unsigned argc, Value* vp)
double
js::ecmaHypot(double x, double y)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::hypot(x, y);
}
@ -1237,6 +1290,8 @@ hypot_step(double& scale, double& sumsq, double x)
double
js::hypot4(double x, double y, double z, double w)
{
AutoUnsafeCallWithABI unsafe;
/* Check for infinity or NaNs so that we can return immediatelly.
* Does not need to be WIN_XP specific as ecmaHypot
*/
@ -1262,6 +1317,7 @@ js::hypot4(double x, double y, double z, double w)
double
js::hypot3(double x, double y, double z)
{
AutoUnsafeCallWithABI unsafe;
return hypot4(x, y, z, 0.0);
}
@ -1318,12 +1374,14 @@ js::math_hypot_handle(JSContext* cx, HandleValueArray args, MutableHandleValue r
double
js::math_trunc_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::trunc, x, MathCache::Trunc);
}
double
js::math_trunc_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::trunc(x);
}
@ -1344,12 +1402,14 @@ static double sign(double x)
double
js::math_sign_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(sign, x, MathCache::Sign);
}
double
js::math_sign_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return sign(x);
}
@ -1362,12 +1422,14 @@ js::math_sign(JSContext* cx, unsigned argc, Value* vp)
double
js::math_cbrt_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::cbrt, x, MathCache::Cbrt);
}
double
js::math_cbrt_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::cbrt(x);
}

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

@ -371,7 +371,7 @@ ArgumentsObject::finishForIon(JSContext* cx, jit::JitFrameLayout* frame,
{
// JIT code calls this directly (no callVM), because it's faster, so we're
// not allowed to GC in here.
JS::AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
JSFunction* callee = jit::CalleeTokenToFunction(frame->calleeToken());
RootedObject callObj(cx, scopeChain->is<CallObject>() ? scopeChain : nullptr);

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

@ -406,7 +406,7 @@ NativeObject::growSlots(JSContext* cx, uint32_t oldCount, uint32_t newCount)
NativeObject::growSlotsDontReportOOM(JSContext* cx, NativeObject* obj, uint32_t newCount)
{
// IC code calls this directly.
AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
if (!obj->growSlots(cx, obj->numDynamicSlots(), newCount)) {
cx->recoverFromOutOfMemory();
@ -419,7 +419,7 @@ NativeObject::growSlotsDontReportOOM(JSContext* cx, NativeObject* obj, uint32_t
NativeObject::addDenseElementDontReportOOM(JSContext* cx, NativeObject* obj)
{
// IC code calls this directly.
AutoCheckCannotGC nogc;
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(obj->getDenseInitializedLength() == obj->getDenseCapacity());
MOZ_ASSERT(!obj->denseElementsAreCopyOnWrite());

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

@ -269,8 +269,12 @@ private:
return size;
}
size += (mURL.SizeOfExcludingThisEvenIfShared(mallocSizeOf) +
// Note: mURL and mCachePath use the same string for scripts loaded
// by the message manager. The following statement avoids
// double-measuring in that case.
size += (mURL.SizeOfExcludingThisIfUnshared(mallocSizeOf) +
mCachePath.SizeOfExcludingThisEvenIfShared(mallocSizeOf));
return size;
}

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

@ -86,8 +86,8 @@ random-if(winWidget) == 305643-1.html 305643-1-ref.html # depends on windows ver
== 409375.html 409375-ref.html
== 413542-1.html 413542-1-ref.html
== 413542-2.html 413542-2-ref.html
fails-if(webrender) == 413928-1.html 413928-1-ref.html
fails-if(webrender) == 413928-2.html 413928-2-ref.html
== 413928-1.html 413928-1-ref.html
== 413928-2.html 413928-2-ref.html
== 425338-1a.html 425338-1-ref.html
== 425338-1b.html 425338-1-ref.html
== 489517-1.html 489517-1-ref.html

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

@ -1,33 +1,33 @@
fails-if(webrender) == system-cyclic.html system-cyclic-ref.html
fails-if(webrender) == system-fixed.html system-fixed-ref.html
fails-if(webrender) == system-symbolic.html system-symbolic-ref.html
fails-if(webrender) == system-alphabetic.html system-alphabetic-ref.html
fails-if(webrender) == system-numeric.html system-numeric-ref.html
fails-if(webrender) == system-additive.html system-additive-ref.html
fails-if(webrender) == system-extends.html system-extends-ref.html
== system-cyclic.html system-cyclic-ref.html
== system-fixed.html system-fixed-ref.html
== system-symbolic.html system-symbolic-ref.html
== system-alphabetic.html system-alphabetic-ref.html
== system-numeric.html system-numeric-ref.html
== system-additive.html system-additive-ref.html
== system-extends.html system-extends-ref.html
== system-cyclic-invalid.html system-common-invalid-ref.html
== system-fixed-invalid.html system-common-invalid2-ref.html
== system-symbolic-invalid.html system-common-invalid-ref.html
== system-alphabetic-invalid.html system-common-invalid2-ref.html
== system-numeric-invalid.html system-common-invalid2-ref.html
== system-additive-invalid.html system-common-invalid-ref.html
fails-if(webrender) == system-extends-invalid.html system-extends-invalid-ref.html
fails-if(webrender) == descriptor-negative.html descriptor-negative-ref.html
fails-if(webrender) == descriptor-prefix.html descriptor-prefix-ref.html
fails-if(webrender) == descriptor-suffix.html descriptor-suffix-ref.html
fails-if(webrender) == descriptor-range.html descriptor-range-ref.html
fails-if(webrender) == descriptor-pad.html descriptor-pad-ref.html
fails-if(webrender) == descriptor-fallback.html descriptor-fallback-ref.html
fails-if(webrender) == descriptor-symbols.html descriptor-symbols-ref.html
fails-if(webrender) == descriptor-negative-invalid.html descriptor-negative-invalid-ref.html
fails-if(webrender) == descriptor-prefix-invalid.html descriptor-prefix-invalid-ref.html
fails-if(webrender) == descriptor-suffix-invalid.html descriptor-suffix-invalid-ref.html
fails-if(webrender) == descriptor-range-invalid.html descriptor-range-invalid-ref.html
fails-if(webrender) == descriptor-pad-invalid.html descriptor-pad-invalid-ref.html
fails-if(webrender) == descriptor-fallback.html descriptor-fallback-ref.html
fails-if(webrender) == descriptor-symbols-invalid.html descriptor-symbols-invalid-ref.html
== system-extends-invalid.html system-extends-invalid-ref.html
== descriptor-negative.html descriptor-negative-ref.html
== descriptor-prefix.html descriptor-prefix-ref.html
== descriptor-suffix.html descriptor-suffix-ref.html
== descriptor-range.html descriptor-range-ref.html
== descriptor-pad.html descriptor-pad-ref.html
== descriptor-fallback.html descriptor-fallback-ref.html
== descriptor-symbols.html descriptor-symbols-ref.html
== descriptor-negative-invalid.html descriptor-negative-invalid-ref.html
== descriptor-prefix-invalid.html descriptor-prefix-invalid-ref.html
== descriptor-suffix-invalid.html descriptor-suffix-invalid-ref.html
== descriptor-range-invalid.html descriptor-range-invalid-ref.html
== descriptor-pad-invalid.html descriptor-pad-invalid-ref.html
== descriptor-fallback.html descriptor-fallback-ref.html
== descriptor-symbols-invalid.html descriptor-symbols-invalid-ref.html
== name-case-sensitivity.html name-case-sensitivity-ref.html
fails-if(webrender) == dependent-builtin.html dependent-builtin-ref.html
== dependent-builtin.html dependent-builtin-ref.html
== redefine-builtin.html redefine-builtin-ref.html
== redefine-attr-mapping.html redefine-attr-mapping-ref.html
== disclosure-styles.html disclosure-styles-ref.html

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

@ -68,7 +68,7 @@ fails-if(xulRuntime.XPCOMABI.match(/arm/)) == counter-ua-limits-02.html counter-
== counter-ua-limits-list-00.html counter-ua-limits-list-00-ref.html
== counter-ua-limits-list-01.html counter-ua-limits-list-01-ref.html
== multiple-thai-counters.html multiple-thai-counters-ref.html
fails-if(webrender) == counter-suffix.html counter-suffix-ref.html
== counter-suffix.html counter-suffix-ref.html
== counter-cjk-decimal.html counter-cjk-decimal-ref.html
== counter-japanese-informal.html counter-japanese-informal-ref.html
== counter-japanese-formal.html counter-japanese-formal-ref.html

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

@ -2,7 +2,7 @@ fuzzy-if(OSX,55,4) == numbering-1.html numbering-1-ref.html
== numbering-2.html numbering-2-ref.html
pref(layout.css.grid.enabled,true) fuzzy-if(OSX,8,1) == numbering-3.html numbering-3-ref.html
fuzzy-if(OSX,72,2) == numbering-4.html numbering-4-ref.html
fails-if(webrender) == numbering-5.html numbering-5-ref.html
== numbering-5.html numbering-5-ref.html
== ol-reversed-1a.html ol-reversed-1-ref.html
asserts(1) == ol-reversed-1b.html ol-reversed-1-ref.html # bug 478135
== ol-reversed-1c.html ol-reversed-1-ref.html
@ -11,4 +11,4 @@ asserts(1) == ol-reversed-1b.html ol-reversed-1-ref.html # bug 478135
== bullet-space-1.html bullet-space-1-ref.html
== bullet-space-2.html bullet-space-2-ref.html
== bullet-intrinsic-isize-1.html bullet-intrinsic-isize-1-ref.html
fails-if(webrender) == bullet-intrinsic-isize-2.html bullet-intrinsic-isize-2-ref.html
== bullet-intrinsic-isize-2.html bullet-intrinsic-isize-2-ref.html

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

@ -1,4 +1,4 @@
fails-if(webrender) == counter-style-rule-clone.html glyphs-ref.html # passes trivially
== counter-style-rule-clone.html glyphs-ref.html # passes trivially
# because "Dynamic change on @counter-style not yet supported"
== document-rule-clone.html shouldbegreen-ref.html
== media-rule-clone.html shouldbegreen-ref.html

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

@ -1,3 +1,3 @@
# Tests for list-style-type
fails-if(webrender) == list-style-type-string-001a.html list-style-type-string-001-ref.html
fails-if(webrender) == list-style-type-string-001b.html list-style-type-string-001-ref.html
== list-style-type-string-001a.html list-style-type-string-001-ref.html
== list-style-type-string-001b.html list-style-type-string-001-ref.html

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

@ -31,7 +31,7 @@ fails == 1102175-1a.html 1102175-1-ref.html
== 1105268-2-min-max-dimensions.html 1105268-2-min-max-dimensions-ref.html
== 1106669-1-intrinsic-for-container.html 1106669-1-intrinsic-for-container-ref.html
== 1108923-1-percentage-margins.html 1108923-1-percentage-margins-ref.html
fails-if(webrender) == 1111944-1-list-marker.html 1111944-1-list-marker-ref.html
== 1111944-1-list-marker.html 1111944-1-list-marker-ref.html
fuzzy(116,94) fuzzy-if(winWidget,135,124) HTTP(..) == 1115916-1-vertical-metrics.html 1115916-1-vertical-metrics-ref.html
== 1117210-1-vertical-baseline-snap.html 1117210-1-vertical-baseline-snap-ref.html
== 1117227-1-text-overflow.html 1117227-1-text-overflow-ref.html

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

@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
The cubeb git repository is: git://github.com/kinetiknz/cubeb.git
The git commit ID used was 2e5814de4fd9830d201d61b9d35ed24c2bba6d0f (2017-08-31 13:51:29 +0300)
The git commit ID used was 09a90a7817bc3d76723065fdc6b53c542fbed402 (2017-09-13 18:39:50 +0200)

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

@ -673,12 +673,33 @@ audiounit_reinit_stream(cubeb_stream * stm, device_flags_value flags)
return CUBEB_OK;
}
static char const *
event_addr_to_string(AudioObjectPropertySelector selector)
{
switch(selector) {
case kAudioHardwarePropertyDefaultOutputDevice:
return "kAudioHardwarePropertyDefaultOutputDevice";
case kAudioHardwarePropertyDefaultInputDevice:
return "kAudioHardwarePropertyDefaultInputDevice";
case kAudioDevicePropertyDeviceIsAlive:
return "kAudioDevicePropertyDeviceIsAlive";
case kAudioDevicePropertyDataSource:
return "kAudioDevicePropertyDataSource";
default:
return "Unknown";
}
}
static OSStatus
audiounit_property_listener_callback(AudioObjectID /* id */, UInt32 address_count,
audiounit_property_listener_callback(AudioObjectID id, UInt32 address_count,
const AudioObjectPropertyAddress * addresses,
void * user)
{
cubeb_stream * stm = (cubeb_stream*) user;
if (stm->switching_device) {
LOG("Switching is already taking place. Skip Event %s for id=%d", event_addr_to_string(addresses[0].mSelector), id);
return noErr;
}
stm->switching_device = true;
device_flags_value switch_side = DEV_UKNOWN;
@ -686,23 +707,24 @@ audiounit_property_listener_callback(AudioObjectID /* id */, UInt32 address_coun
for (UInt32 i = 0; i < address_count; i++) {
switch(addresses[i].mSelector) {
case kAudioHardwarePropertyDefaultOutputDevice: {
LOG("Event[%u] - mSelector == kAudioHardwarePropertyDefaultOutputDevice", (unsigned int) i);
LOG("Event[%u] - mSelector == kAudioHardwarePropertyDefaultOutputDevice for id=%d", (unsigned int) i, id);
// Allow restart to choose the new default
switch_side |= DEV_OUTPUT;
}
break;
case kAudioHardwarePropertyDefaultInputDevice: {
LOG("Event[%u] - mSelector == kAudioHardwarePropertyDefaultInputDevice", (unsigned int) i);
LOG("Event[%u] - mSelector == kAudioHardwarePropertyDefaultInputDevice for id=%d", (unsigned int) i, id);
// Allow restart to choose the new default
switch_side |= DEV_INPUT;
}
break;
case kAudioDevicePropertyDeviceIsAlive: {
LOG("Event[%u] - mSelector == kAudioDevicePropertyDeviceIsAlive", (unsigned int) i);
LOG("Event[%u] - mSelector == kAudioDevicePropertyDeviceIsAlive for id=%d", (unsigned int) i, id);
// If this is the default input device ignore the event,
// kAudioHardwarePropertyDefaultInputDevice will take care of the switch
if (stm->input_device.flags & DEV_SYSTEM_DEFAULT) {
LOG("It's the default input device, ignore the event");
stm->switching_device = false;
return noErr;
}
// Allow restart to choose the new default. Event register only for input.
@ -710,11 +732,13 @@ audiounit_property_listener_callback(AudioObjectID /* id */, UInt32 address_coun
}
break;
case kAudioDevicePropertyDataSource: {
LOG("Event[%u] - mSelector == kAudioHardwarePropertyDataSource", (unsigned int) i);
return noErr;
LOG("Event[%u] - mSelector == kAudioHardwarePropertyDataSource for id=%d", (unsigned int) i, id);
switch_side |= DEV_INPUT;
}
break;
default:
LOG("Event[%u] - mSelector == Unexpected Event id %d, return", (unsigned int) i, addresses[i].mSelector);
stm->switching_device = false;
return noErr;
}
}

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

@ -194,7 +194,8 @@ EncoderParameters VideoSender::UpdateEncoderParameters(
uint32_t target_bitrate_bps) {
uint32_t video_target_rate_bps = _mediaOpt.SetTargetRates(target_bitrate_bps);
uint32_t input_frame_rate = _mediaOpt.InputFrameRate();
if (input_frame_rate == 0)
if (input_frame_rate == 0 || input_frame_rate > current_codec_.maxFramerate)
input_frame_rate = current_codec_.maxFramerate;
BitrateAllocation bitrate_allocation;

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

@ -29,10 +29,16 @@ if CONFIG['OS_TARGET'] == 'WINNT':
UNIFIED_SOURCES += [
'mozalloc.cpp',
'mozalloc_abort.cpp',
'mozalloc_oom.cpp',
]
SOURCES += [
'mozalloc_abort.cpp',
]
if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['CC_TYPE'] == 'clang':
SOURCES['mozalloc_abort.cpp'].flags += ['-Wno-infinite-recursion']
FINAL_LIBRARY = 'mozglue'
# The strndup declaration in string.h is in an ifdef __USE_GNU section

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

@ -25,8 +25,12 @@ using namespace mozilla::Compression;
namespace {
extern "C" {
#include "lz4.c"
}
}/* anonymous namespace */
/* Our wrappers */

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

@ -1318,12 +1318,8 @@ pref("dom.forms.number", true);
// platforms which don't have a color picker implemented yet.
pref("dom.forms.color", true);
// Support for input type=date and type=time. Enabled by default on Nightly.
#ifdef NIGHTLY_BUILD
// Support for input type=date and type=time.
pref("dom.forms.datetime", true);
#else
pref("dom.forms.datetime", false);
#endif
// Support for input type=month, type=week and type=datetime-local. By default,
// disabled.
@ -1826,7 +1822,7 @@ pref("network.http.enforce-framing.soft", true);
pref("network.http.max_response_header_size", 393216);
// If we should attempt to race the cache and network
pref("network.http.rcwn.enabled", false);
pref("network.http.rcwn.enabled", true);
pref("network.http.rcwn.cache_queue_normal_threshold", 8);
pref("network.http.rcwn.cache_queue_priority_threshold", 2);
// We might attempt to race the cache with the network only if a resource

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

@ -222,6 +222,13 @@ interface nsIAsyncFileMetadata : nsIFileMetadata
{
/**
* Asynchronously wait for the object to be ready.
*
* @param aCallback The callback will be used when the stream is ready to
* return File metadata. Use a nullptr to cancel a
* previous operation.
*
* @param aEventTarget The event target where aCallback will be executed.
* If aCallback is passed, aEventTarget cannot be null.
*/
void asyncWait(in nsIFileMetadataCallback aCallback,
in nsIEventTarget aEventTarget);

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

@ -3858,6 +3858,8 @@ nsHttpChannel::OpenCacheEntry(bool isHttps)
uint32_t cacheEntryOpenFlags;
bool offline = gIOService->IsOffline();
bool maybeRCWN = false;
nsAutoCString cacheControlRequestHeader;
Unused << mRequestHead.GetHeader(nsHttp::Cache_Control, cacheControlRequestHeader);
CacheControlParser cacheControlRequest(cacheControlRequestHeader);
@ -3906,9 +3908,13 @@ nsHttpChannel::OpenCacheEntry(bool isHttps)
getter_AddRefs(cacheStorage));
}
else {
rv = cacheStorageService->DiskCacheStorage(info,
!mPostID && (mChooseApplicationCache || (mLoadFlags & LOAD_CHECK_OFFLINE_CACHE)),
getter_AddRefs(cacheStorage));
bool lookupAppCache = !mPostID && (mChooseApplicationCache ||
(mLoadFlags & LOAD_CHECK_OFFLINE_CACHE));
// Try to race only if we use disk cache storage and we don't lookup
// app cache first
maybeRCWN = !lookupAppCache;
rv = cacheStorageService->DiskCacheStorage(
info, lookupAppCache, getter_AddRefs(cacheStorage));
}
NS_ENSURE_SUCCESS(rv, rv);
@ -3959,17 +3965,20 @@ nsHttpChannel::OpenCacheEntry(bool isHttps)
mCacheOpenWithPriority = cacheEntryOpenFlags & nsICacheStorage::OPEN_PRIORITY;
mCacheQueueSizeWhenOpen = CacheStorageService::CacheQueueSize(mCacheOpenWithPriority);
bool hasAltData = false;
uint32_t sizeInKb = 0;
rv = cacheStorage->GetCacheIndexEntryAttrs(openURI, extension,
&hasAltData, &sizeInKb);
if (sRCWNEnabled && maybeRCWN && !mApplicationCacheForWrite &&
mInterceptCache != INTERCEPTED) {
bool hasAltData = false;
uint32_t sizeInKb = 0;
rv = cacheStorage->GetCacheIndexEntryAttrs(openURI, extension,
&hasAltData, &sizeInKb);
// We will attempt to race the network vs the cache if we've found this
// entry in the cache index, and it has appropriate
// attributes (doesn't have alt-data, and has a small size)
if (sRCWNEnabled && mInterceptCache != INTERCEPTED &&
NS_SUCCEEDED(rv) && !hasAltData && sizeInKb < sRCWNSmallResourceSizeKB) {
MaybeRaceCacheWithNetwork();
// We will attempt to race the network vs the cache if we've found
// this entry in the cache index, and it has appropriate attributes
// (doesn't have alt-data, and has a small size)
if (NS_SUCCEEDED(rv) && !hasAltData &&
sizeInKb < sRCWNSmallResourceSizeKB) {
MaybeRaceCacheWithNetwork();
}
}
if (!mCacheOpenDelay) {

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

@ -1140,4 +1140,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1513790406370000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1513877942565000);

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,5 +1,8 @@
#include "HangStack.h"
#ifdef MOZ_GECKO_PROFILER
#include "shared-libraries.h"
#endif
namespace mozilla {
@ -99,6 +102,7 @@ HangStack::ReadModuleInformation()
// mModules should be empty when we start filling it.
mModules.Clear();
#ifdef MOZ_GECKO_PROFILER
// Create a sorted list of the PCs in the current stack.
AutoTArray<Frame*, 100> frames;
for (auto& frame : *this) {
@ -155,6 +159,7 @@ HangStack::ReadModuleInformation()
mModules.AppendElement(module);
}
}
#endif
}
} // namespace mozilla

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

@ -10,6 +10,7 @@
#include "nsIClassInfoImpl.h"
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsXULAppAPI.h"
#include "LabeledEventQueue.h"
#include "MainThreadQueue.h"
#include "mozilla/AbstractThread.h"