diff --git a/accessible/generic/HyperTextAccessible.cpp b/accessible/generic/HyperTextAccessible.cpp
index 563ac6fe001..e344599ecde 100644
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -1466,7 +1466,7 @@ HyperTextAccessible::CaretLineNumber()
break;
// Add lines for the sibling frames before the caret
- nsIFrame *sibling = parentFrame->GetFirstPrincipalChild();
+ nsIFrame *sibling = parentFrame->PrincipalChildList().FirstChild();
while (sibling && sibling != caretFrame) {
nsAutoLineIterator lineIterForSibling = sibling->GetLineIterator();
if (lineIterForSibling) {
diff --git a/b2g/app/nsBrowserApp.cpp b/b2g/app/nsBrowserApp.cpp
index ae115bd922d..e7fcc431a5e 100644
--- a/b2g/app/nsBrowserApp.cpp
+++ b/b2g/app/nsBrowserApp.cpp
@@ -281,7 +281,6 @@ int main(int argc, _CONST char* argv[])
int result;
{
ScopedLogging log;
- mozilla::LogModule::Init();
char **_argv;
/*
diff --git a/b2g/config/aries-l/sources.xml b/b2g/config/aries-l/sources.xml
index f1f4f5309d6..c8005201ca6 100644
--- a/b2g/config/aries-l/sources.xml
+++ b/b2g/config/aries-l/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/aries/sources.xml b/b2g/config/aries/sources.xml
index 9d6927bef66..eb1df795c7e 100644
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml
index 4cb3b474895..28e0174330d 100644
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 3bf9286b9bc..5d75798b057 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index ff868d7e0b9..e24a032eb66 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index ebeb02198e9..367e3f91a5e 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/emulator-l/sources.xml b/b2g/config/emulator-l/sources.xml
index 221b8bad201..e1340a00119 100644
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 3bf9286b9bc..5d75798b057 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml
index 9e1d0bde2c0..8158bd0c99b 100644
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
@@ -135,7 +137,7 @@
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 19e3a8dc036..e7ceb76a283 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
{
"git": {
- "git_revision": "77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0",
+ "git_revision": "4f0e2a1a42a2d049b6fe8f4f095cdcdf0fd5465c",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
- "revision": "256902cd676226f40965b353e0ec12e9b0372290",
+ "revision": "07d30dcbe75d2c053a6e98697fd2e362fb786ca9",
"repo_path": "integration/gaia-central"
}
diff --git a/b2g/config/nexus-4-kk/sources.xml b/b2g/config/nexus-4-kk/sources.xml
index 9152e78d1b6..6aa653212b2 100644
--- a/b2g/config/nexus-4-kk/sources.xml
+++ b/b2g/config/nexus-4-kk/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index d56ec7e8f77..9fa8d20e469 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml
index 0cdc8e27acc..852d0aaf307 100644
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -21,10 +21,12 @@
-
+
+
+
diff --git a/browser/config/mozconfigs/linux64/debug b/browser/config/mozconfigs/linux64/debug
index f03930e7384..b74a64e9872 100644
--- a/browser/config/mozconfigs/linux64/debug
+++ b/browser/config/mozconfigs/linux64/debug
@@ -18,6 +18,6 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
-. "$topsrcdir/build/unix/mozconfig.rust"
+. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"
diff --git a/browser/config/mozconfigs/linux64/nightly b/browser/config/mozconfigs/linux64/nightly
index 89c710061e7..41f5c224959 100644
--- a/browser/config/mozconfigs/linux64/nightly
+++ b/browser/config/mozconfigs/linux64/nightly
@@ -10,6 +10,6 @@ STRIP_FLAGS="--strip-debug"
ac_add_options --with-branding=browser/branding/nightly
-. "$topsrcdir/build/unix/mozconfig.rust"
+. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"
diff --git a/browser/config/mozconfigs/whitelist b/browser/config/mozconfigs/whitelist
index 919bb1610a9..4d85bc90d9c 100644
--- a/browser/config/mozconfigs/whitelist
+++ b/browser/config/mozconfigs/whitelist
@@ -40,7 +40,7 @@ whitelist['nightly']['linux64'] += [
'STRIP_FLAGS="--strip-debug"',
'ac_add_options --with-ccache=/usr/bin/ccache',
'. "$topsrcdir/build/mozconfig.cache"',
- '. "$topsrcdir/build/unix/mozconfig.rust"',
+ '. "$topsrcdir/build/mozconfig.rust"',
]
whitelist['nightly']['macosx-universal'] += [
@@ -67,6 +67,7 @@ whitelist['nightly']['win32'] += [
whitelist['nightly']['win64'] += [
'. "$topsrcdir/browser/config/mozconfigs/win64/common-win64"',
'. "$topsrcdir/build/mozconfig.cache"',
+ '. "$topsrcdir/build/mozconfig.rust"',
]
for platform in all_platforms:
diff --git a/browser/config/mozconfigs/win64/debug b/browser/config/mozconfigs/win64/debug
index 80054ba132e..b361a4db204 100644
--- a/browser/config/mozconfigs/win64/debug
+++ b/browser/config/mozconfigs/win64/debug
@@ -30,5 +30,7 @@ ac_add_options --with-branding=browser/branding/nightly
. $topsrcdir/build/win64/mozconfig.vs2013
+. "$topsrcdir/build/mozconfig.rust"
+
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"
diff --git a/browser/config/mozconfigs/win64/nightly b/browser/config/mozconfigs/win64/nightly
index 9c31c44644e..f710aabe3a0 100644
--- a/browser/config/mozconfigs/win64/nightly
+++ b/browser/config/mozconfigs/win64/nightly
@@ -7,5 +7,7 @@ ac_add_options --enable-verify-mar
ac_add_options --with-branding=browser/branding/nightly
+. "$topsrcdir/build/mozconfig.rust"
+
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"
diff --git a/browser/config/tooltool-manifests/win64/releng.manifest b/browser/config/tooltool-manifests/win64/releng.manifest
index 6343fb6d816..b891a301572 100644
--- a/browser/config/tooltool-manifests/win64/releng.manifest
+++ b/browser/config/tooltool-manifests/win64/releng.manifest
@@ -6,6 +6,14 @@
"filename": "mozmake.exe"
},
{
+"size": 72442063,
+"digest": "899da5af9b322ba63ec04de06f92b5bb82a2700f9fe03001e75fdc6f678a435cd66a474190fd93863327456270aef5649d3788aa50d852121059ced99a6004db",
+"algorithm": "sha512",
+"visibility": "public",
+"filename": "rustc.tar.bz2",
+"unpack": true
+},
+{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
diff --git a/build/unix/mozconfig.rust b/build/mozconfig.rust
similarity index 100%
rename from build/unix/mozconfig.rust
rename to build/mozconfig.rust
diff --git a/configure.in b/configure.in
index fd5e5499ecf..37f6f008545 100644
--- a/configure.in
+++ b/configure.in
@@ -3503,7 +3503,7 @@ MOZ_ARG_WITH_BOOL(system-nss,
_USE_SYSTEM_NSS=1 )
if test -n "$_USE_SYSTEM_NSS"; then
- AM_PATH_NSS(3.20.1, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
+ AM_PATH_NSS(3.22, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
fi
if test -n "$MOZ_NATIVE_NSS"; then
@@ -9200,6 +9200,7 @@ export MOZ_APP_NAME
export MOZ_APP_REMOTINGNAME
export DONT_POPULATE_VIRTUALENV=1
export PYTHON
+export RUSTC
export MOZILLA_CENTRAL_PATH=$_topsrcdir
export STLPORT_CPPFLAGS
export STLPORT_LIBS
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index c9f33499f10..60edb8f31fd 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -266,9 +266,9 @@ static uint32_t gValidateOrigin = 0xffffffff;
#define NS_EVENT_STARVATION_DELAY_HINT 2000
#ifdef DEBUG
-static mozilla::LazyLogModule gDocShellLog("nsDocShell");
+static PRLogModuleInfo* gDocShellLog;
#endif
-static mozilla::LazyLogModule gDocShellLeakLog("nsDocShellLeak");;
+static PRLogModuleInfo* gDocShellLeakLog;
const char kBrandBundleURL[] = "chrome://branding/locale/brand.properties";
const char kAppstringsBundleURL[] = "chrome://global/locale/appstrings.properties";
@@ -818,7 +818,17 @@ nsDocShell::nsDocShell()
CallGetService(NS_URIFIXUP_CONTRACTID, &sURIFixup);
}
- MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p created\n", this));
+#ifdef DEBUG
+ if (!gDocShellLog) {
+ gDocShellLog = PR_NewLogModule("nsDocShell");
+ }
+#endif
+ if (!gDocShellLeakLog) {
+ gDocShellLeakLog = PR_NewLogModule("nsDocShellLeak");
+ }
+ if (gDocShellLeakLog) {
+ MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p created\n", this));
+ }
#ifdef DEBUG
// We're counting the number of |nsDocShells| to help find leaks
diff --git a/docshell/shistory/nsSHistory.cpp b/docshell/shistory/nsSHistory.cpp
index 263231c1d70..6400fe64dbd 100644
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -59,9 +59,16 @@ int32_t nsSHistory::sHistoryMaxTotalViewers = -1;
// entries were touched, so that we can evict older entries first.
static uint32_t gTouchCounter = 0;
-static LazyLogModule gSHistoryLog("nsSHistory");
-
-#define LOG(format) MOZ_LOG(gSHistoryLog, mozilla::LogLevel::Debug, format)
+static PRLogModuleInfo*
+GetSHistoryLog()
+{
+ static PRLogModuleInfo* sLog;
+ if (!sLog) {
+ sLog = PR_NewLogModule("nsSHistory");
+ }
+ return sLog;
+}
+#define LOG(format) MOZ_LOG(GetSHistoryLog(), mozilla::LogLevel::Debug, format)
// This macro makes it easier to print a log message which includes a URI's
// spec. Example use:
@@ -71,7 +78,7 @@ static LazyLogModule gSHistoryLog("nsSHistory");
//
#define LOG_SPEC(format, uri) \
PR_BEGIN_MACRO \
- if (MOZ_LOG_TEST(gSHistoryLog, LogLevel::Debug)) { \
+ if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) { \
nsAutoCString _specStr(NS_LITERAL_CSTRING("(null)"));\
if (uri) { \
uri->GetSpec(_specStr); \
@@ -89,7 +96,7 @@ static LazyLogModule gSHistoryLog("nsSHistory");
//
#define LOG_SHENTRY_SPEC(format, shentry) \
PR_BEGIN_MACRO \
- if (MOZ_LOG_TEST(gSHistoryLog, LogLevel::Debug)) { \
+ if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) { \
nsCOMPtr uri; \
shentry->GetURI(getter_AddRefs(uri)); \
LOG_SPEC(format, uri); \
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index 8681aad2e73..3c13f6f0fec 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -11,7 +11,6 @@
#include
#include
-#include "prprf.h"
#include "DecoderTraits.h"
#include "harfbuzz/hb.h"
#include "imgICache.h"
@@ -3525,7 +3524,7 @@ nsContentUtils::ReportToConsoleNonLocalized(const nsAString& aErrorText,
}
void
-nsContentUtils::LogMessageToConsole(const char* aMsg, ...)
+nsContentUtils::LogMessageToConsole(const char* aMsg)
{
if (!sConsoleService) { // only need to bother null-checking here
CallGetService(NS_CONSOLESERVICE_CONTRACTID, &sConsoleService);
@@ -3533,17 +3532,7 @@ nsContentUtils::LogMessageToConsole(const char* aMsg, ...)
return;
}
}
-
- va_list args;
- va_start(args, aMsg);
- char* formatted = PR_vsmprintf(aMsg, args);
- va_end(args);
- if (!formatted) {
- return;
- }
-
- sConsoleService->LogStringMessage(NS_ConvertUTF8toUTF16(formatted).get());
- PR_smprintf_free(formatted);
+ sConsoleService->LogStringMessage(NS_ConvertUTF8toUTF16(aMsg).get());
}
bool
@@ -6928,7 +6917,7 @@ nsContentUtils::GetAdjustedOffsetInTextControl(nsIFrame* aOffsetFrame,
// has the text frames (containing the content) as its children. This will
// be the case if we click to the right of any of the text frames, or at the
// bottom of the text area.
- nsIFrame* firstChild = aOffsetFrame->GetFirstPrincipalChild();
+ nsIFrame* firstChild = aOffsetFrame->PrincipalChildList().FirstChild();
if (firstChild) {
// In this case, the passed-in offset is incorrect, and we want the length
// of the entire content in the text control frame.
@@ -6941,7 +6930,7 @@ nsContentUtils::GetAdjustedOffsetInTextControl(nsIFrame* aOffsetFrame,
// frame. Our offset should therefore be the length of the first child of
// our parent.
int32_t aOutOffset =
- aOffsetFrame->GetParent()->GetFirstPrincipalChild()->GetContent()->Length();
+ aOffsetFrame->GetParent()->PrincipalChildList().FirstChild()->GetContent()->Length();
return aOutOffset;
}
diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h
index c04edd485f3..a714367dad1 100644
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -893,8 +893,8 @@ public:
uint32_t aLineNumber = 0,
uint32_t aColumnNumber = 0);
- static void LogMessageToConsole(const char* aMsg, ...);
-
+ static void LogMessageToConsole(const char* aMsg);
+
/**
* Get the localized string named |aKey| in properties file |aFile|.
*/
diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp
index 76da94771f3..05fcb4d61ab 100644
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -106,7 +106,6 @@
#include "HTMLImageElement.h"
#include "mozilla/css/ImageLoader.h"
#include "mozilla/layers/APZCTreeManager.h" // for layers::ZoomToRectBehavior
-#include "mozilla/dom/Promise.h"
#ifdef XP_WIN
#undef GetClassName
@@ -2151,29 +2150,26 @@ nsDOMWindowUtils::GetLayerManagerRemote(bool* retval)
}
NS_IMETHODIMP
-nsDOMWindowUtils::GetSupportsHardwareH264Decoding(JS::MutableHandle aPromise)
+nsDOMWindowUtils::GetSupportsHardwareH264Decoding(nsAString& aRetval)
{
- nsCOMPtr window = do_QueryReferent(mWindow);
- NS_ENSURE_STATE(window);
- nsCOMPtr parentObject = do_QueryInterface(window);
- NS_ENSURE_STATE(parentObject);
#ifdef MOZ_FMP4
nsCOMPtr widget = GetWidget();
- NS_ENSURE_STATE(widget);
+ if (!widget)
+ return NS_ERROR_FAILURE;
+
LayerManager *mgr = widget->GetLayerManager();
- NS_ENSURE_STATE(mgr);
- RefPtr promise =
- MP4Decoder::IsVideoAccelerated(mgr->GetCompositorBackendType(), parentObject);
- NS_ENSURE_STATE(promise);
- aPromise.setObject(*promise->GetWrapper());
-#else
- ErrorResult rv;
- RefPtr promise = Promise::Create(parentObject, rv);
- if (rv.Failed()) {
- return rv.StealNSResult();
+ if (!mgr)
+ return NS_ERROR_FAILURE;
+
+ nsCString failureReason;
+ if (MP4Decoder::IsVideoAccelerated(mgr->GetCompositorBackendType(), failureReason)) {
+ aRetval.AssignLiteral("Yes");
+ } else {
+ aRetval.AssignLiteral("No; ");
+ AppendUTF8toUTF16(failureReason, aRetval);
}
- promise.MaybeResolve(NS_LITERAL_STRING("No; Compiled without MP4 support."));
- aPromise.setObject(*promise->GetWrapper());
+#else
+ aRetval.AssignLiteral("No; Compiled without MP4 support.");
#endif
return NS_OK;
}
diff --git a/dom/base/nsDocumentEncoder.cpp b/dom/base/nsDocumentEncoder.cpp
index 2e45a3043cc..f100a808d65 100644
--- a/dom/base/nsDocumentEncoder.cpp
+++ b/dom/base/nsDocumentEncoder.cpp
@@ -331,12 +331,10 @@ LineHasNonEmptyContentWorker(nsIFrame* aFrame)
// Look for non-empty frames, but ignore inline and br frames.
// For inline frames, descend into the children, if any.
if (aFrame->GetType() == nsGkAtoms::inlineFrame) {
- nsIFrame* child = aFrame->GetFirstPrincipalChild();
- while (child) {
+ for (nsIFrame* child : aFrame->PrincipalChildList()) {
if (LineHasNonEmptyContentWorker(child)) {
return true;
}
- child = child->GetNextSibling();
}
} else {
if (aFrame->GetType() != nsGkAtoms::brFrame &&
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index cad3985d5a3..97b5db16032 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -9885,13 +9885,11 @@ static nsCanvasFrame* FindCanvasFrame(nsIFrame* aFrame)
return canvasFrame;
}
- nsIFrame* kid = aFrame->GetFirstPrincipalChild();
- while (kid) {
+ for (nsIFrame* kid : aFrame->PrincipalChildList()) {
canvasFrame = FindCanvasFrame(kid);
if (canvasFrame) {
return canvasFrame;
}
- kid = kid->GetNextSibling();
}
return nullptr;
diff --git a/dom/base/nsRange.cpp b/dom/base/nsRange.cpp
index 688f927a9cd..090895092db 100644
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -3335,7 +3335,7 @@ IsLastNonemptyRowGroupOfTable(nsIFrame* aFrame)
}
for (nsIFrame* c = aFrame; c; c = c->GetNextContinuation()) {
for (nsIFrame* next = c->GetNextSibling(); next; next = next->GetNextSibling()) {
- if (next->GetFirstPrincipalChild()) {
+ if (next->PrincipalChildList().FirstChild()) {
return false;
}
}
diff --git a/dom/canvas/WebGLValidateStrings.cpp b/dom/canvas/WebGLValidateStrings.cpp
index 4aa4ad582f9..9df3fef7092 100644
--- a/dom/canvas/WebGLValidateStrings.cpp
+++ b/dom/canvas/WebGLValidateStrings.cpp
@@ -141,7 +141,7 @@ ValidateGLSLVariableName(const nsAString& name, WebGLContext* webgl, const char*
if (name.IsEmpty())
return false;
- const uint32_t maxSize = 256;
+ const uint32_t maxSize = webgl->IsWebGL2() ? 1024 : 256;
if (name.Length() > maxSize) {
webgl->ErrorInvalidValue("%s: Identifier is %d characters long, exceeds the"
" maximum allowed length of %d characters.",
diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp
index 0de79536e4d..259cc1e7058 100644
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -2917,9 +2917,7 @@ HTMLInputElement::Focus(ErrorResult& aError)
// tab to the next one.
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
- for (nsIFrame* childFrame = frame->GetFirstPrincipalChild();
- childFrame;
- childFrame = childFrame->GetNextSibling()) {
+ for (nsIFrame* childFrame : frame->PrincipalChildList()) {
// See if the child is a button control.
nsCOMPtr formCtrl =
do_QueryInterface(childFrame->GetContent());
diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index b9bc0c2f623..df88883d8e4 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3058,41 +3058,36 @@ class HTMLMediaElement::StreamSizeListener : public MediaStreamListener {
public:
explicit StreamSizeListener(HTMLMediaElement* aElement) :
mElement(aElement),
- mMutex("HTMLMediaElement::StreamSizeListener")
+ mInitialSizeFound(false)
{}
void Forget() { mElement = nullptr; }
- void ReceivedSize()
+ void ReceivedSize(gfx::IntSize aSize)
{
if (!mElement) {
return;
}
- gfx::IntSize size;
- {
- MutexAutoLock lock(mMutex);
- size = mInitialSize;
- }
RefPtr deathGrip = mElement;
- mElement->UpdateInitialMediaSize(size);
+ mElement->UpdateInitialMediaSize(aSize);
}
- virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
- StreamTime aTrackOffset,
- uint32_t aTrackEvents,
- const MediaSegment& aQueuedMedia,
- MediaStream* aInputStream,
- TrackID aInputTrackID) override
+
+ void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
+ StreamTime aTrackOffset,
+ uint32_t aTrackEvents,
+ const MediaSegment& aQueuedMedia,
+ MediaStream* aInputStream,
+ TrackID aInputTrackID) override
{
- MutexAutoLock lock(mMutex);
- if (mInitialSize != gfx::IntSize(0,0) ||
- aQueuedMedia.GetType() != MediaSegment::VIDEO) {
+ if (mInitialSizeFound || aQueuedMedia.GetType() != MediaSegment::VIDEO) {
return;
}
const VideoSegment& video = static_cast(aQueuedMedia);
for (VideoSegment::ConstChunkIterator c(video); !c.IsEnded(); c.Next()) {
if (c->mFrame.GetIntrinsicSize() != gfx::IntSize(0,0)) {
- mInitialSize = c->mFrame.GetIntrinsicSize();
nsCOMPtr event =
- NS_NewRunnableMethod(this, &StreamSizeListener::ReceivedSize);
+ NS_NewRunnableMethodWithArgs(
+ this, &StreamSizeListener::ReceivedSize,
+ c->mFrame.GetIntrinsicSize());
aGraph->DispatchToMainThreadAfterStreamStateUpdate(event.forget());
}
}
@@ -3102,9 +3097,8 @@ private:
// These fields may only be accessed on the main thread
HTMLMediaElement* mElement;
- // mMutex protects the fields below; they can be accessed on any thread
- Mutex mMutex;
- gfx::IntSize mInitialSize;
+ // These fields may only be accessed on the MSG thread
+ bool mInitialSizeFound;
};
class HTMLMediaElement::MediaStreamTracksAvailableCallback:
@@ -3174,9 +3168,7 @@ void HTMLMediaElement::UpdateSrcMediaStreamPlaying(uint32_t aFlags)
mMediaStreamListener = new StreamListener(this,
"HTMLMediaElement::mMediaStreamListener");
- mMediaStreamSizeListener = new StreamSizeListener(this);
stream->AddListener(mMediaStreamListener);
- stream->AddListener(mMediaStreamSizeListener);
mWatchManager.Watch(*mMediaStreamListener,
&HTMLMediaElement::UpdateReadyStateInternal);
@@ -3193,7 +3185,6 @@ void HTMLMediaElement::UpdateSrcMediaStreamPlaying(uint32_t aFlags)
mSrcStreamPausedCurrentTime = CurrentTime();
stream->RemoveListener(mMediaStreamListener);
- stream->RemoveListener(mMediaStreamSizeListener);
stream->RemoveAudioOutput(this);
VideoFrameContainer* container = GetVideoFrameContainer();
@@ -3209,8 +3200,6 @@ void HTMLMediaElement::UpdateSrcMediaStreamPlaying(uint32_t aFlags)
mMediaStreamListener->Forget();
mMediaStreamListener = nullptr;
- mMediaStreamSizeListener->Forget();
- mMediaStreamSizeListener = nullptr;
}
}
@@ -3229,6 +3218,9 @@ void HTMLMediaElement::SetupSrcMediaStreamPlayback(DOMMediaStream* aStream)
RefPtr stream = GetSrcMediaStream();
if (stream) {
stream->SetAudioChannelType(mAudioChannel);
+
+ mMediaStreamSizeListener = new StreamSizeListener(this);
+ stream->AddListener(mMediaStreamSizeListener);
}
UpdateSrcMediaStreamPlaying();
@@ -3255,6 +3247,15 @@ void HTMLMediaElement::EndSrcMediaStreamPlayback()
UpdateSrcMediaStreamPlaying(REMOVING_SRC_STREAM);
+ if (mMediaStreamSizeListener) {
+ RefPtr stream = GetSrcMediaStream();
+ if (stream) {
+ stream->RemoveListener(mMediaStreamSizeListener);
+ }
+ mMediaStreamSizeListener->Forget();
+ mMediaStreamSizeListener = nullptr;
+ }
+
mSrcStream->UnregisterTrackListener(mMediaStreamTrackListener);
mMediaStreamTrackListener = nullptr;
@@ -3403,6 +3404,10 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
if (IsVideo() && HasVideo()) {
DispatchAsyncEvent(NS_LITERAL_STRING("resize"));
}
+ NS_ASSERTION(!HasVideo() ||
+ (mMediaInfo.mVideo.mDisplay.width > 0 &&
+ mMediaInfo.mVideo.mDisplay.height > 0),
+ "Video resolution must be known on 'loadedmetadata'");
DispatchAsyncEvent(NS_LITERAL_STRING("loadedmetadata"));
if (mDecoder && mDecoder->IsTransportSeekable() && mDecoder->IsMediaSeekable()) {
ProcessMediaFragmentURI();
@@ -4160,6 +4165,16 @@ void HTMLMediaElement::UpdateInitialMediaSize(const nsIntSize& aSize)
if (!mMediaInfo.HasVideo()) {
UpdateMediaSize(aSize);
}
+
+ if (!mMediaStreamSizeListener) {
+ return;
+ }
+ RefPtr stream = GetSrcMediaStream();
+ if (stream) {
+ stream->RemoveListener(mMediaStreamSizeListener);
+ }
+ mMediaStreamSizeListener->Forget();
+ mMediaStreamSizeListener = nullptr;
}
void HTMLMediaElement::SuspendOrResumeElement(bool aPauseElement, bool aSuspendEvents)
diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp
index f3ca091fb0c..dde6b89dc43 100644
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -1111,7 +1111,7 @@ nsGenericHTMLElement::GetFormControlFrame(bool aFlushFrames)
// If we have generated content, the primary frame will be a
// wrapper frame.. out real frame will be in its child list.
- for (frame = frame->GetFirstPrincipalChild();
+ for (frame = frame->PrincipalChildList().FirstChild();
frame;
frame = frame->GetNextSibling()) {
form_frame = do_QueryFrame(frame);
diff --git a/dom/html/nsTextEditorState.cpp b/dom/html/nsTextEditorState.cpp
index 06c88fac56a..11077c5149c 100644
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -2168,7 +2168,7 @@ nsTextEditorState::InitializeKeyboardEventListeners()
TrustedEventsAtSystemGroupBubble());
}
- mSelCon->SetScrollableFrame(do_QueryFrame(mBoundFrame->GetFirstPrincipalChild()));
+ mSelCon->SetScrollableFrame(do_QueryFrame(mBoundFrame->PrincipalChildList().FirstChild()));
}
void
diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl
index e2cb2b88748..6fdf5aee6bb 100644
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -49,7 +49,7 @@ interface nsIJSRAIIHelper;
interface nsIContentPermissionRequest;
interface nsIObserver;
-[scriptable, uuid(46b44e33-13c2-4eb3-bf80-76a4e0857ccc)]
+[scriptable, uuid(ca6a458c-82e7-4979-886e-6d214eac6f0b)]
interface nsIDOMWindowUtils : nsISupports {
/**
@@ -1334,12 +1334,11 @@ interface nsIDOMWindowUtils : nsISupports {
readonly attribute boolean layerManagerRemote;
/**
- * Returns a Promise that will be resolved with a string once the capabilities
- * of the h264 decoder have been determined.
- * Success does not mean that all h264 video decoding will be done
+ * True if we can initialize a hardware-backed h264 decoder for a simple
+ * test video, does not mean that all h264 video decoding will be done
* in hardware.
*/
- readonly attribute jsval supportsHardwareH264Decoding;
+ readonly attribute AString supportsHardwareH264Decoding;
/**
* Record (and return) frame-intervals for frames which were presented
diff --git a/dom/media/fmp4/MP4Decoder.cpp b/dom/media/fmp4/MP4Decoder.cpp
index f9945f857c3..25ad3adb21b 100644
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -182,46 +182,23 @@ MP4Decoder::IsEnabled()
return Preferences::GetBool("media.mp4.enabled");
}
-// sTestH264ExtraData represents the content of the avcC atom found in
-// an AVC1 h264 video. It contains the H264 SPS and PPS NAL.
-// the structure of the avcC atom is as follow:
-// write(0x1); // version, always 1
-// write(sps[0].data[1]); // profile
-// write(sps[0].data[2]); // compatibility
-// write(sps[0].data[3]); // level
-// write(0xFC | 3); // reserved (6 bits), NULA length size - 1 (2 bits)
-// write(0xE0 | 1); // reserved (3 bits), num of SPS (5 bits)
-// write_word(sps[0].size); // 2 bytes for length of SPS
-// for(size_t i=0 ; i < sps[0].size ; ++i)
-// write(sps[0].data[i]); // data of SPS
-// write(&b, pps.size()); // num of PPS
-// for(size_t i=0 ; i < pps.size() ; ++i) {
-// write_word(pps[i].size); // 2 bytes for length of PPS
-// for(size_t j=0 ; j < pps[i].size ; ++j)
-// write(pps[i].data[j]); // data of PPS
-// }
-// }
-// here we have a h264 Baseline, 640x360
-// We use a 640x360 extradata, as some video framework (Apple VT) will never
-// attempt to use hardware decoding for small videos.
static const uint8_t sTestH264ExtraData[] = {
- 0x01, 0x42, 0xc0, 0x1e, 0xff, 0xe1, 0x00, 0x17, 0x67, 0x42,
- 0xc0, 0x1e, 0xbb, 0x40, 0x50, 0x17, 0xfc, 0xb8, 0x08, 0x80,
- 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b, 0xb5, 0x07, 0x8b, 0x17,
- 0x50, 0x01, 0x00, 0x04, 0x68, 0xce, 0x32, 0xc8
+ 0x01, 0x64, 0x00, 0x0a, 0xff, 0xe1, 0x00, 0x17, 0x67, 0x64,
+ 0x00, 0x0a, 0xac, 0xd9, 0x44, 0x26, 0x84, 0x00, 0x00, 0x03,
+ 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0xc8, 0x3c, 0x48, 0x96,
+ 0x58, 0x01, 0x00, 0x06, 0x68, 0xeb, 0xe3, 0xcb, 0x22, 0xc0
};
static already_AddRefed
CreateTestH264Decoder(layers::LayersBackend aBackend,
- VideoInfo& aConfig,
- FlushableTaskQueue* aTaskQueue)
+ VideoInfo& aConfig)
{
aConfig.mMimeType = "video/avc";
aConfig.mId = 1;
aConfig.mDuration = 40000;
aConfig.mMediaTime = 0;
- aConfig.mDisplay = nsIntSize(640, 360);
- aConfig.mImage = nsIntRect(0, 0, 640, 360);
+ aConfig.mDisplay = nsIntSize(64, 64);
+ aConfig.mImage = nsIntRect(0, 0, 64, 64);
aConfig.mExtraData = new MediaByteBuffer();
aConfig.mExtraData->AppendElements(sTestH264ExtraData,
MOZ_ARRAY_LENGTH(sTestH264ExtraData));
@@ -230,60 +207,23 @@ CreateTestH264Decoder(layers::LayersBackend aBackend,
RefPtr platform = new PDMFactory();
RefPtr decoder(
- platform->CreateDecoder(aConfig, aTaskQueue, nullptr, aBackend, nullptr));
+ platform->CreateDecoder(aConfig, nullptr, nullptr, aBackend, nullptr));
return decoder.forget();
}
-/* static */ already_AddRefed
-MP4Decoder::IsVideoAccelerated(layers::LayersBackend aBackend, nsIGlobalObject* aParent)
+/* static */ bool
+MP4Decoder::IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aFailureReason)
{
- MOZ_ASSERT(NS_IsMainThread());
-
- ErrorResult rv;
- RefPtr promise;
- promise = dom::Promise::Create(aParent, rv);
- if (rv.Failed()) {
- rv.SuppressException();
- return nullptr;
- }
- RefPtr taskQueue =
- new FlushableTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER));
VideoInfo config;
- RefPtr decoder(CreateTestH264Decoder(aBackend, config, taskQueue));
+ RefPtr decoder(CreateTestH264Decoder(aBackend, config));
if (!decoder) {
- promise->MaybeResolve(NS_LITERAL_STRING("No; Failed to create H264 decoder"));
- return promise.forget();
+ aFailureReason.AssignLiteral("Failed to create H264 decoder");
+ return false;
}
-
- decoder->Init()
- ->Then(AbstractThread::MainThread(), __func__,
- [promise, decoder, taskQueue] (TrackInfo::TrackType aTrack) {
- nsCString failureReason;
- bool ok = decoder->IsHardwareAccelerated(failureReason);
- nsAutoString result;
- if (ok) {
- result.AssignLiteral("Yes");
- } else {
- result.AssignLiteral("No");
- if (failureReason.Length()) {
- result.AppendLiteral("; ");
- AppendUTF8toUTF16(failureReason, result);
- }
- }
- promise->MaybeResolve(result);
- decoder->Shutdown();
- taskQueue->BeginShutdown();
- taskQueue->AwaitShutdownAndIdle();
- },
- [promise, decoder, taskQueue] (MediaDataDecoder::DecoderFailureReason aResult) {
- promise->MaybeResolve(NS_LITERAL_STRING("No; Failed to initialize H264 decoder"));
- decoder->Shutdown();
- taskQueue->BeginShutdown();
- taskQueue->AwaitShutdownAndIdle();
- });
-
- return promise.forget();
+ bool result = decoder->IsHardwareAccelerated(aFailureReason);
+ decoder->Shutdown();
+ return result;
}
void
diff --git a/dom/media/fmp4/MP4Decoder.h b/dom/media/fmp4/MP4Decoder.h
index d99eb8e9767..62578ed2348 100644
--- a/dom/media/fmp4/MP4Decoder.h
+++ b/dom/media/fmp4/MP4Decoder.h
@@ -8,7 +8,6 @@
#include "MediaDecoder.h"
#include "MediaFormatReader.h"
-#include "mozilla/dom/Promise.h"
namespace mozilla {
@@ -39,8 +38,7 @@ public:
// Returns true if the MP4 backend is preffed on.
static bool IsEnabled();
- static already_AddRefed
- IsVideoAccelerated(layers::LayersBackend aBackend, nsIGlobalObject* aParent);
+ static bool IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aReason);
void GetMozDebugReaderData(nsAString& aString) override;
diff --git a/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp b/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
index 036dcfc22a5..2922838a36a 100644
--- a/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
@@ -43,6 +43,7 @@ FFVPXRuntimeLinker::Init()
}
MOZ_ASSERT(NS_IsMainThread());
+ sLinkStatus = LinkStatus_FAILED;
// We retrieve the path of the XUL library as this is where mozavcodec and
// mozavutil libs are located.
@@ -85,8 +86,6 @@ FFVPXRuntimeLinker::Init()
sLinkStatus = LinkStatus_SUCCEEDED;
return true;
}
- sLinkStatus = LinkStatus_FAILED;
-
return false;
}
diff --git a/dom/media/tests/mochitest/mochitest.ini b/dom/media/tests/mochitest/mochitest.ini
index d5a050d1b7b..4abdca22dc2 100644
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -54,6 +54,7 @@ skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # debug-only failu
[test_getUserMedia_callbacks.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # Bug 1063290, intermittent timeout # TC: Bug 1144079 - Re-enable Mulet mochitests and reftests taskcluster-specific disables.
[test_getUserMedia_gumWithinGum.html]
+[test_getUserMedia_loadedmetadata.html]
[test_getUserMedia_mediaStreamConstructors.html]
[test_getUserMedia_playAudioTwice.html]
[test_getUserMedia_playVideoAudioTwice.html]
diff --git a/dom/media/tests/mochitest/test_getUserMedia_loadedmetadata.html b/dom/media/tests/mochitest/test_getUserMedia_loadedmetadata.html
new file mode 100644
index 00000000000..3af0ea5ba1b
--- /dev/null
+++ b/dom/media/tests/mochitest/test_getUserMedia_loadedmetadata.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dom/system/gonk/GonkGPSGeolocationProvider.cpp b/dom/system/gonk/GonkGPSGeolocationProvider.cpp
index fa62d30c1d4..5ad23c67d6e 100644
--- a/dom/system/gonk/GonkGPSGeolocationProvider.cpp
+++ b/dom/system/gonk/GonkGPSGeolocationProvider.cpp
@@ -56,6 +56,13 @@
#define FLUSH_AIDE_DATA 0
+#undef LOG
+#undef ERR
+#undef DBG
+#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GonkGPSGeolocationProvider", ## args)
+#define ERR(args...) __android_log_print(ANDROID_LOG_ERROR, "GonkGPSGeolocationProvider", ## args)
+#define DBG(args...) __android_log_print(ANDROID_LOG_DEBUG, "GonkGPSGeolocationProvider" , ## args)
+
using namespace mozilla;
using namespace mozilla::dom;
@@ -139,10 +146,10 @@ GonkGPSGeolocationProvider::LocationCallback(GpsLocation* location)
// set in the DOM JS.
if (gDebug_isLoggingEnabled) {
- nsContentUtils::LogMessageToConsole("geo: GPS got a fix (%f, %f). accuracy: %f",
- location->latitude,
- location->longitude,
- location->accuracy);
+ DBG("geo: GPS got a fix (%f, %f). accuracy: %f",
+ location->latitude,
+ location->longitude,
+ location->accuracy);
}
RefPtr event = new UpdateLocationEvent(somewhere);
@@ -199,7 +206,7 @@ GonkGPSGeolocationProvider::StatusCallback(GpsStatus* status)
break;
}
if (gDebug_isLoggingEnabled){
- nsContentUtils::LogMessageToConsole(msgStream);
+ DBG("%s", msgStream);
}
}
@@ -240,7 +247,7 @@ GonkGPSGeolocationProvider::SvStatusCallback(GpsSvStatus* sv_info)
svEphemerisCount != numEphemeris ||
svUsedCount != numUsedInFix) {
- nsContentUtils::LogMessageToConsole(
+ LOG(
"geo: Number of SVs have (visibility, almanac, ephemeris): (%d, %d, %d)."
" %d of these SVs were used in fix.\n",
sv_info->num_svs, svAlmanacCount, svEphemerisCount, svUsedCount);
@@ -257,8 +264,7 @@ void
GonkGPSGeolocationProvider::NmeaCallback(GpsUtcTime timestamp, const char* nmea, int length)
{
if (gDebug_isLoggingEnabled) {
- nsContentUtils::LogMessageToConsole("geo: NMEA: timestamp:\t%lld, length: %d, %s",
- timestamp, length, nmea);
+ DBG("NMEA: timestamp:\t%lld, length: %d, %s", timestamp, length, nmea);
}
}
@@ -532,15 +538,13 @@ GonkGPSGeolocationProvider::RequestSettingValue(const char* aKey)
nsCOMPtr lock;
nsresult rv = ss->CreateLock(nullptr, getter_AddRefs(lock));
if (NS_FAILED(rv)) {
- nsContentUtils::LogMessageToConsole(
- "geo: error while createLock setting '%s': %d\n", aKey, rv);
+ ERR("error while createLock setting '%s': %d\n", aKey, rv);
return;
}
rv = lock->Get(aKey, this);
if (NS_FAILED(rv)) {
- nsContentUtils::LogMessageToConsole(
- "geo: error while get setting '%s': %d\n", aKey, rv);
+ ERR("error while get setting '%s': %d\n", aKey, rv);
return;
}
}
@@ -639,8 +643,8 @@ ConvertToGpsRefLocationType(const nsAString& aConnectionType)
}
if (gDebug_isLoggingEnabled) {
- nsContentUtils::LogMessageToConsole("geo: Unsupported connection type %s\n",
- NS_ConvertUTF16toUTF8(aConnectionType).get());
+ DBG("geo: Unsupported connection type %s\n",
+ NS_ConvertUTF16toUTF8(aConnectionType).get());
}
return AGPS_REF_LOCATION_TYPE_GSM_CELLID;
}
@@ -744,8 +748,7 @@ GonkGPSGeolocationProvider::InjectLocation(double latitude,
float accuracy)
{
if (gDebug_isLoggingEnabled) {
- nsContentUtils::LogMessageToConsole("geo: injecting location (%f, %f) accuracy: %f",
- latitude, longitude, accuracy);
+ DBG("injecting location (%f, %f) accuracy: %f", latitude, longitude, accuracy);
}
MOZ_ASSERT(NS_IsMainThread());
@@ -947,14 +950,12 @@ GonkGPSGeolocationProvider::NetworkLocationUpdate::Update(nsIDOMGeoPosition *pos
(isGPSTempInactive && delta > kMinMLSCoordChangeInMeters))
{
if (gDebug_isLoggingEnabled) {
- nsContentUtils::LogMessageToConsole("geo: Using MLS, GPS age:%fs, MLS Delta:%fm\n",
- diff_ms / 1000.0, delta);
+ DBG("Using MLS, GPS age:%fs, MLS Delta:%fm\n", diff_ms / 1000.0, delta);
}
provider->mLocationCallback->Update(position);
} else if (provider->mLastGPSPosition) {
if (gDebug_isLoggingEnabled) {
- nsContentUtils::LogMessageToConsole("geo: Using old GPS age:%fs\n",
- diff_ms / 1000.0);
+ DBG("Using old GPS age:%fs\n", diff_ms / 1000.0);
}
// This is a fallback case so that the GPS provider responds with its last
@@ -1185,16 +1186,15 @@ GonkGPSGeolocationProvider::Observe(nsISupports* aSubject,
}
if (setting.mKey.EqualsASCII(kSettingDebugGpsIgnored)) {
- nsContentUtils::LogMessageToConsole("geo: received mozsettings-changed: ignoring\n");
+ LOG("received mozsettings-changed: ignoring\n");
gDebug_isGPSLocationIgnored =
setting.mValue.isBoolean() ? setting.mValue.toBoolean() : false;
if (gDebug_isLoggingEnabled) {
- nsContentUtils::LogMessageToConsole("geo: Debug: GPS ignored %d\n",
- gDebug_isGPSLocationIgnored);
+ DBG("GPS ignored %d\n", gDebug_isGPSLocationIgnored);
}
return NS_OK;
} else if (setting.mKey.EqualsASCII(kSettingDebugEnabled)) {
- nsContentUtils::LogMessageToConsole("geo: received mozsettings-changed: logging\n");
+ LOG("received mozsettings-changed: logging\n");
gDebug_isLoggingEnabled =
setting.mValue.isBoolean() ? setting.mValue.toBoolean() : false;
return NS_OK;
diff --git a/dom/workers/ServiceWorkerRegistrar.cpp b/dom/workers/ServiceWorkerRegistrar.cpp
index 36270d66b73..83348c217ab 100644
--- a/dom/workers/ServiceWorkerRegistrar.cpp
+++ b/dom/workers/ServiceWorkerRegistrar.cpp
@@ -310,8 +310,8 @@ ServiceWorkerRegistrar::ReadData()
}
if (!IsSupportedVersion(version)) {
- nsContentUtils::LogMessageToConsole(
- "Unsupported service worker registrar version: %s", version.get());
+ nsContentUtils::LogMessageToConsole(nsPrintfCString(
+ "Unsupported service worker registrar version: %s", version.get()).get());
return NS_ERROR_FAILURE;
}
diff --git a/extensions/auth/nsAuth.h b/extensions/auth/nsAuth.h
index a32072cdb7b..6abee650e2b 100644
--- a/extensions/auth/nsAuth.h
+++ b/extensions/auth/nsAuth.h
@@ -20,7 +20,7 @@ enum pType {
// set NSPR_LOG_MODULES=negotiateauth:4
// set NSPR_LOG_FILE=negotiateauth.log
//
-extern mozilla::LazyLogModule gNegotiateLog;
+extern PRLogModuleInfo* gNegotiateLog;
#define LOG(args) MOZ_LOG(gNegotiateLog, mozilla::LogLevel::Debug, args)
diff --git a/extensions/auth/nsAuthFactory.cpp b/extensions/auth/nsAuthFactory.cpp
index d97d9ca8597..a6434251f4c 100644
--- a/extensions/auth/nsAuthFactory.cpp
+++ b/extensions/auth/nsAuthFactory.cpp
@@ -220,12 +220,13 @@ static const mozilla::Module::ContractIDEntry kAuthContracts[] = {
};
//-----------------------------------------------------------------------------
-mozilla::LazyLogModule gNegotiateLog("negotiateauth");
+PRLogModuleInfo *gNegotiateLog;
// setup nspr logging ...
static nsresult
InitNegotiateAuth()
{
+ gNegotiateLog = PR_NewLogModule("negotiateauth");
return NS_OK;
}
diff --git a/extensions/gio/nsGIOProtocolHandler.cpp b/extensions/gio/nsGIOProtocolHandler.cpp
index 00d842fba59..71db2d5da3a 100644
--- a/extensions/gio/nsGIOProtocolHandler.cpp
+++ b/extensions/gio/nsGIOProtocolHandler.cpp
@@ -37,7 +37,7 @@
//-----------------------------------------------------------------------------
// NSPR_LOG_MODULES=gio:5
-static mozilla::LazyLogModule sGIOLog("gio");
+static PRLogModuleInfo *sGIOLog;
#define LOG(args) MOZ_LOG(sGIOLog, mozilla::LogLevel::Debug, args)
@@ -911,6 +911,8 @@ NS_IMPL_ISUPPORTS(nsGIOProtocolHandler, nsIProtocolHandler, nsIObserver)
nsresult
nsGIOProtocolHandler::Init()
{
+ sGIOLog = PR_NewLogModule("gio");
+
nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefs)
{
diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.cpp b/extensions/pref/autoconfig/src/nsAutoConfig.cpp
index c8c9b3098d3..56688e6390a 100644
--- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp
@@ -26,7 +26,7 @@
using mozilla::LogLevel;
-mozilla::LazyLogModule MCD("MCD");
+PRLogModuleInfo *MCD;
extern nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length,
const char *filename,
diff --git a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
index c5aafffc3b1..4da1c1fa433 100644
--- a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
+++ b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
@@ -19,7 +19,7 @@
#include "nsIScriptError.h"
#include "jswrapper.h"
-extern mozilla::LazyLogModule MCD;
+extern PRLogModuleInfo *MCD;
using mozilla::AutoSafeJSContext;
//*****************************************************************************
diff --git a/extensions/pref/autoconfig/src/nsReadConfig.cpp b/extensions/pref/autoconfig/src/nsReadConfig.cpp
index fe50f67cfb1..7ac886c7c90 100644
--- a/extensions/pref/autoconfig/src/nsReadConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp
@@ -26,7 +26,7 @@
#include "nsXULAppAPI.h"
#include "nsContentUtils.h"
-extern mozilla::LazyLogModule MCD;
+extern PRLogModuleInfo *MCD;
extern nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length,
const char *filename,
@@ -75,6 +75,8 @@ NS_IMPL_ISUPPORTS(nsReadConfig, nsIReadConfig, nsIObserver)
nsReadConfig::nsReadConfig() :
mRead(false)
{
+ if (!MCD)
+ MCD = PR_NewLogModule("MCD");
}
nsresult nsReadConfig::Init()
diff --git a/hal/Hal.cpp b/hal/Hal.cpp
index b982b0cfbbc..3117721b469 100644
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -61,10 +61,13 @@ using namespace mozilla::dom;
namespace mozilla {
namespace hal {
-mozilla::LogModule *
+PRLogModuleInfo *
GetHalLog()
{
- static mozilla::LazyLogModule sHalLog("hal");
+ static PRLogModuleInfo *sHalLog;
+ if (!sHalLog) {
+ sHalLog = PR_NewLogModule("hal");
+ }
return sHalLog;
}
diff --git a/hal/HalLog.h b/hal/HalLog.h
index 0d72e98d0fd..7cdc9d88794 100644
--- a/hal/HalLog.h
+++ b/hal/HalLog.h
@@ -20,7 +20,7 @@ namespace mozilla {
namespace hal {
-mozilla::LogModule *GetHalLog();
+extern PRLogModuleInfo *GetHalLog();
#define HAL_LOG(...) \
MOZ_LOG(mozilla::hal::GetHalLog(), LogLevel::Debug, (__VA_ARGS__))
#define HAL_ERR(...) \
diff --git a/ipc/chromium/src/base/logging.cc b/ipc/chromium/src/base/logging.cc
index ed7facc96eb..8b0f9d843c3 100644
--- a/ipc/chromium/src/base/logging.cc
+++ b/ipc/chromium/src/base/logging.cc
@@ -42,7 +42,7 @@ Logger::~Logger()
break;
}
- MOZ_LOG(gChromiumPRLog, prlevel, ("%s:%i: %s", mFile, mLine, mMsg ? mMsg : ""));
+ MOZ_LOG(GetLog(), prlevel, ("%s:%i: %s", mFile, mLine, mMsg ? mMsg : ""));
if (xpcomlevel != -1)
NS_DebugBreak(xpcomlevel, mMsg, NULL, mFile, mLine);
@@ -58,7 +58,15 @@ Logger::printf(const char* fmt, ...)
va_end(args);
}
-LazyLogModule Logger::gChromiumPRLog("chromium");
+PRLogModuleInfo* Logger::gChromiumPRLog;
+
+PRLogModuleInfo* Logger::GetLog()
+{
+ if (!gChromiumPRLog)
+ gChromiumPRLog = PR_NewLogModule("chromium");
+ return gChromiumPRLog;
+}
+
} // namespace mozilla
mozilla::Logger&
diff --git a/ipc/chromium/src/base/logging.h b/ipc/chromium/src/base/logging.h
index b8e3c64d9a0..5a9c16655ee 100644
--- a/ipc/chromium/src/base/logging.h
+++ b/ipc/chromium/src/base/logging.h
@@ -45,8 +45,8 @@ public:
void printf(const char* fmt, ...);
private:
- static mozilla::LazyLogModule gChromiumPRLog;
-// static PRLogModuleInfo* GetLog();
+ static PRLogModuleInfo* gChromiumPRLog;
+ static PRLogModuleInfo* GetLog();
LogSeverity mSeverity;
const char* mFile;
diff --git a/js/src/asmjs/AsmJS.cpp b/js/src/asmjs/AsmJS.cpp
index 88791f68ca1..2700af4c280 100644
--- a/js/src/asmjs/AsmJS.cpp
+++ b/js/src/asmjs/AsmJS.cpp
@@ -1674,11 +1674,6 @@ class MOZ_STACK_CLASS ModuleValidator
return sigMap_.add(p, &mg_.sig(*sigIndex), *sigIndex);
}
- // ModuleGeneratorData limits:
- static const unsigned MaxSigs = 4 * 1024;
- static const unsigned MaxFuncs = 512 * 1024;
- static const unsigned MaxImports = 4 * 1024;
-
public:
ModuleValidator(ExclusiveContext* cx, AsmJSParser& parser, ParseNode* moduleFunctionNode)
: cx_(cx),
diff --git a/js/src/asmjs/Wasm.cpp b/js/src/asmjs/Wasm.cpp
index 9a7e9833b86..ba25f5cc05d 100644
--- a/js/src/asmjs/Wasm.cpp
+++ b/js/src/asmjs/Wasm.cpp
@@ -322,11 +322,14 @@ DecodeSignatureSection(JSContext* cx, Decoder& d, ModuleGeneratorData* init)
uint32_t sectionStart;
if (!d.startSection(§ionStart))
- return Fail(cx, d, "expected decl section byte size");
+ return Fail(cx, d, "expected signature section byte size");
uint32_t numSigs;
if (!d.readVarU32(&numSigs))
- return Fail(cx, d, "expected number of declarations");
+ return Fail(cx, d, "expected number of signatures");
+
+ if (numSigs > MaxSigs)
+ return Fail(cx, d, "too many signatures");
if (!init->sigs.resize(numSigs))
return false;
@@ -336,6 +339,9 @@ DecodeSignatureSection(JSContext* cx, Decoder& d, ModuleGeneratorData* init)
if (!d.readVarU32(&numArgs))
return Fail(cx, d, "bad number of signature args");
+ if (numArgs > MaxArgsPerFunc)
+ return Fail(cx, d, "too many arguments in signature");
+
ExprType result;
if (!DecodeExprType(cx, d, &result))
return false;
@@ -387,6 +393,9 @@ DecodeDeclarationSection(JSContext* cx, Decoder& d, ModuleGeneratorData* init)
if (!d.readVarU32(&numDecls))
return Fail(cx, d, "expected number of declarations");
+ if (numDecls > MaxFuncs)
+ return Fail(cx, d, "too many functions");
+
if (!init->funcSigs.resize(numDecls))
return false;
@@ -465,6 +474,9 @@ DecodeImportSection(JSContext* cx, Decoder& d, ModuleGeneratorData* init, Import
if (!d.readVarU32(&numImports))
return Fail(cx, d, "expected number of imports");
+ if (numImports > MaxImports)
+ return Fail(cx, d, "too many imports");
+
for (uint32_t i = 0; i < numImports; i++) {
if (!DecodeImport(cx, d, init, imports))
return false;
@@ -526,6 +538,9 @@ DecodeExportsSection(JSContext* cx, Decoder& d, ModuleGenerator& mg, ExportMap*
if (!d.readVarU32(&numExports))
return Fail(cx, d, "expected number of exports");
+ if (numExports > MaxExports)
+ return Fail(cx, d, "too many exports");
+
for (uint32_t i = 0; i < numExports; i++) {
if (!DecodeExport(cx, d, mg, exportMap))
return false;
diff --git a/js/src/asmjs/WasmBinary.h b/js/src/asmjs/WasmBinary.h
index d9045476037..2c0aaae73cd 100644
--- a/js/src/asmjs/WasmBinary.h
+++ b/js/src/asmjs/WasmBinary.h
@@ -28,6 +28,13 @@ class PropertyName;
namespace wasm {
+// Module generator limits
+static const unsigned MaxSigs = 4 * 1024;
+static const unsigned MaxFuncs = 512 * 1024;
+static const unsigned MaxImports = 4 * 1024;
+static const unsigned MaxExports = 4 * 1024;
+static const unsigned MaxArgsPerFunc = 4 * 1024;
+
// Module header constants
static const uint32_t MagicNumber = 0x6d736100; // "\0asm"
static const uint32_t EncodingVersion = -1; // experimental
diff --git a/js/src/jit-test/tests/wasm/binary.js b/js/src/jit-test/tests/wasm/binary.js
index 719b71d9d1f..1192b34ffbb 100644
--- a/js/src/jit-test/tests/wasm/binary.js
+++ b/js/src/jit-test/tests/wasm/binary.js
@@ -49,6 +49,8 @@ function varU32(u32) {
return [u32];
}
+const U32MAX_LEB = [255, 255, 255, 255, 15];
+
function moduleHeaderThen(...rest) {
return [magic0, magic1, magic2, magic3, ver0, ver1, ver2, ver3, ...rest];
}
@@ -139,6 +141,12 @@ const trivialSigSection = sigSection([{args:[], ret:VoidCode}]);
const trivialDeclSection = declSection([0]);
const trivialCodeSection = codeSection([{locals:[], body:[0, 0]}]);
+assertErrorMessage(() => wasmEval(toBuf(moduleWithSections([ {name: sigSectionStr, body: U32MAX_LEB, } ]))), Error, /too many signatures/);
+assertErrorMessage(() => wasmEval(toBuf(moduleWithSections([ {name: sigSectionStr, body: [1, ...U32MAX_LEB], } ]))), Error, /too many arguments in signature/);
+assertErrorMessage(() => wasmEval(toBuf(moduleWithSections([trivialSigSection, {name: declSectionStr, body: U32MAX_LEB, }]))), Error, /too many functions/);
+assertErrorMessage(() => wasmEval(toBuf(moduleWithSections([trivialSigSection, {name: importSectionStr, body: U32MAX_LEB, }]))), Error, /too many imports/);
+assertErrorMessage(() => wasmEval(toBuf(moduleWithSections([trivialSigSection, {name: exportSectionStr, body: U32MAX_LEB, }]))), Error, /too many exports/);
+
assertThrowsInstanceOf(() => wasmEval(toBuf(moduleWithSections([{name: sigSectionStr, body: [1]}]))), TypeError);
assertThrowsInstanceOf(() => wasmEval(toBuf(moduleWithSections([{name: sigSectionStr, body: [1, 1, 0]}]))), TypeError);
diff --git a/js/src/jit/arm/BaselineIC-arm.cpp b/js/src/jit/arm/BaselineIC-arm.cpp
index 2f56a01b8ef..8534638882e 100644
--- a/js/src/jit/arm/BaselineIC-arm.cpp
+++ b/js/src/jit/arm/BaselineIC-arm.cpp
@@ -31,8 +31,8 @@ ICCompare_Int32::Compiler::generateStubCode(MacroAssembler& masm)
// Compare payload regs of R0 and R1.
Assembler::Condition cond = JSOpToCondition(op, /* signed = */true);
masm.cmp32(R0.payloadReg(), R1.payloadReg());
- masm.ma_mov(Imm32(1), R0.payloadReg(), LeaveCC, cond);
- masm.ma_mov(Imm32(0), R0.payloadReg(), LeaveCC, Assembler::InvertCondition(cond));
+ masm.ma_mov(Imm32(1), R0.payloadReg(), cond);
+ masm.ma_mov(Imm32(0), R0.payloadReg(), Assembler::InvertCondition(cond));
// Result is implicitly boxed already.
masm.tagValue(JSVAL_TYPE_BOOLEAN, R0.payloadReg(), R0);
@@ -59,7 +59,7 @@ ICCompare_Double::Compiler::generateStubCode(MacroAssembler& masm)
masm.compareDouble(FloatReg0, FloatReg1);
masm.ma_mov(Imm32(0), dest);
- masm.ma_mov(Imm32(1), dest, LeaveCC, cond);
+ masm.ma_mov(Imm32(1), dest, cond);
masm.tagValue(JSVAL_TYPE_BOOLEAN, dest, R0);
EmitReturnFromIC(masm);
diff --git a/js/src/jit/arm/CodeGenerator-arm.cpp b/js/src/jit/arm/CodeGenerator-arm.cpp
index 202dc5752b5..f35f9d89976 100644
--- a/js/src/jit/arm/CodeGenerator-arm.cpp
+++ b/js/src/jit/arm/CodeGenerator-arm.cpp
@@ -90,7 +90,7 @@ CodeGeneratorARM::visitCompare(LCompare* comp)
else
masm.ma_cmp(ToRegister(left), ToOperand(right));
masm.ma_mov(Imm32(0), ToRegister(def));
- masm.ma_mov(Imm32(1), ToRegister(def), LeaveCC, cond);
+ masm.ma_mov(Imm32(1), ToRegister(def), cond);
}
void
@@ -1583,8 +1583,8 @@ CodeGeneratorARM::visitNotD(LNotD* ins)
} else {
masm.as_vmrs(pc);
masm.ma_mov(Imm32(0), dest);
- masm.ma_mov(Imm32(1), dest, LeaveCC, Assembler::Equal);
- masm.ma_mov(Imm32(1), dest, LeaveCC, Assembler::Overflow);
+ masm.ma_mov(Imm32(1), dest, Assembler::Equal);
+ masm.ma_mov(Imm32(1), dest, Assembler::Overflow);
}
}
@@ -1611,8 +1611,8 @@ CodeGeneratorARM::visitNotF(LNotF* ins)
} else {
masm.as_vmrs(pc);
masm.ma_mov(Imm32(0), dest);
- masm.ma_mov(Imm32(1), dest, LeaveCC, Assembler::Equal);
- masm.ma_mov(Imm32(1), dest, LeaveCC, Assembler::Overflow);
+ masm.ma_mov(Imm32(1), dest, Assembler::Equal);
+ masm.ma_mov(Imm32(1), dest, Assembler::Overflow);
}
}
@@ -2183,7 +2183,7 @@ CodeGeneratorARM::visitAsmJSLoadHeap(LAsmJSLoadHeap* ins)
if (mir->isAtomicAccess())
masm.ma_b(masm.asmOnOutOfBoundsLabel(), Assembler::AboveOrEqual);
else
- masm.ma_mov(Imm32(0), d, LeaveCC, Assembler::AboveOrEqual);
+ masm.ma_mov(Imm32(0), d, Assembler::AboveOrEqual);
masm.ma_dataTransferN(IsLoad, size, isSigned, HeapReg, ptrReg, d, Offset, Assembler::Below);
}
memoryBarrier(mir->barrierAfter());
diff --git a/js/src/jit/arm/MacroAssembler-arm.cpp b/js/src/jit/arm/MacroAssembler-arm.cpp
index 13a497d2734..2a8e5f7211d 100644
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -272,6 +272,10 @@ void
MacroAssemblerARM::ma_alu(Register src1, Imm32 imm, Register dest,
ALUOp op, SBit s, Condition c)
{
+ // ma_mov should be used for moves.
+ MOZ_ASSERT(op != OpMov);
+ MOZ_ASSERT(op != OpMvn);
+
// As it turns out, if you ask for a compare-like instruction you *probably*
// want it to set condition codes.
if (dest == InvalidReg)
@@ -301,71 +305,18 @@ MacroAssemblerARM::ma_alu(Register src1, Imm32 imm, Register dest,
return;
}
- if (HasMOVWT()) {
- // If the operation is a move-a-like then we can try to use movw to move
- // the bits into the destination. Otherwise, we'll need to fall back on
- // a multi-instruction format :(
- // movw/movt does not set condition codes, so don't hold your breath.
- if (s == LeaveCC && (op == OpMov || op == OpMvn)) {
- // ARMv7 supports movw/movt. movw zero-extends its 16 bit argument,
- // so we can set the register this way. movt leaves the bottom 16
- // bits in tact, so it is unsuitable to move a constant that
- if (op == OpMov && ((imm.value & ~ 0xffff) == 0)) {
- MOZ_ASSERT(src1 == InvalidReg);
- as_movw(dest, Imm16((uint16_t)imm.value), c);
- return;
- }
-
- // If they asked for a mvn rfoo, imm, where ~imm fits into 16 bits
- // then do it.
- if (op == OpMvn && (((~imm.value) & ~ 0xffff) == 0)) {
- MOZ_ASSERT(src1 == InvalidReg);
- as_movw(dest, Imm16((uint16_t)~imm.value), c);
- return;
- }
-
- // TODO: constant dedup may enable us to add dest, r0, 23 *if* we
- // are attempting to load a constant that looks similar to one that
- // already exists. If it can't be done with a single movw then we
- // *need* to use two instructions since this must be some sort of a
- // move operation, we can just use a movw/movt pair and get the
- // whole thing done in two moves. This does not work for ops like
- // add, since we'd need to do: movw tmp; movt tmp; add dest, tmp,
- // src1.
- if (op == OpMvn)
- imm.value = ~imm.value;
- as_movw(dest, Imm16(imm.value & 0xffff), c);
- as_movt(dest, Imm16((imm.value >> 16) & 0xffff), c);
- return;
- }
- // If we weren't doing a movalike, a 16 bit immediate will require 2
- // instructions. With the same amount of space and (less)time, we can do
- // two 8 bit operations, reusing the dest register. e.g.
- // movw tmp, 0xffff; add dest, src, tmp ror 4
- // vs.
- // add dest, src, 0xff0; add dest, dest, 0xf000000f
- //
- // It turns out that there are some immediates that we miss with the
- // second approach. A sample value is: add dest, src, 0x1fffe this can
- // be done by movw tmp, 0xffff; add dest, src, tmp lsl 1 since imm8m's
- // only get even offsets, we cannot encode this. I'll try to encode as
- // two imm8's first, since they are faster. Both operations should take
- // 1 cycle, where as add dest, tmp ror 4 takes two cycles to execute.
- }
-
- // Either a) this isn't ARMv7 b) this isn't a move start by attempting to
- // generate a two instruction form. Some things cannot be made into two-inst
- // forms correctly. Namely, adds dest, src, 0xffff. Since we want the
- // condition codes (and don't know which ones will be checked), we need to
- // assume that the overflow flag will be checked and add{,s} dest, src,
- // 0xff00; add{,s} dest, dest, 0xff is not guaranteed to set the overflow
- // flag the same as the (theoretical) one instruction variant.
+ // Start by attempting to generate a two instruction form. Some things
+ // cannot be made into two-inst forms correctly. Namely, adds dest, src,
+ // 0xffff. Since we want the condition codes (and don't know which ones
+ // will be checked), we need to assume that the overflow flag will be
+ // checked and add{,s} dest, src, 0xff00; add{,s} dest, dest, 0xff is not
+ // guaranteed to set the overflof flag the same as the (theoretical) one
+ // instruction variant.
if (alu_dbl(src1, imm, dest, op, s, c))
return;
// And try with its negative.
- if (negOp != OpInvalid &&
- alu_dbl(src1, negImm, negDest, negOp, s, c))
+ if (negOp != OpInvalid && alu_dbl(src1, negImm, negDest, negOp, s, c))
return;
// Often this code is called with dest as the ScratchRegister. The register
@@ -381,25 +332,7 @@ MacroAssemblerARM::ma_alu(Register src1, Imm32 imm, Register dest,
}
#endif
- // Well, damn. We can use two 16 bit mov's, then do the op or we can do a
- // single load from a pool then op.
- if (HasMOVWT()) {
- // Try to load the immediate into a scratch register then use that
- as_movw(scratch, Imm16(imm.value & 0xffff), c);
- if ((imm.value >> 16) != 0)
- as_movt(scratch, Imm16((imm.value >> 16) & 0xffff), c);
- } else {
- // Going to have to use a load. If the operation is a move, then just
- // move it into the destination register
- if (op == OpMov) {
- as_Imm32Pool(dest, imm.value, c);
- return;
- } else {
- // If this isn't just going into a register, then stick it in a
- // temp, and then proceed.
- as_Imm32Pool(scratch, imm.value, c);
- }
- }
+ ma_mov(imm, scratch, c);
as_alu(dest, src1, O2Reg(scratch), op, s, c);
}
@@ -479,17 +412,44 @@ MacroAssemblerARM::ma_mov(Register src, Register dest, SBit s, Assembler::Condit
}
void
-MacroAssemblerARM::ma_mov(Imm32 imm, Register dest,
- SBit s, Assembler::Condition c)
+MacroAssemblerARM::ma_mov(Imm32 imm, Register dest, Assembler::Condition c)
{
- ma_alu(InvalidReg, imm, dest, OpMov, s, c);
+ // Try mov with Imm8 operand.
+ Imm8 imm8 = Imm8(imm.value);
+ if (!imm8.invalid) {
+ as_alu(dest, InvalidReg, imm8, OpMov, LeaveCC, c);
+ return;
+ }
+
+ // Try mvn with Imm8 operand.
+ Imm32 negImm = imm;
+ Register negDest;
+ ALUOp negOp = ALUNeg(OpMov, dest, &negImm, &negDest);
+ Imm8 negImm8 = Imm8(negImm.value);
+ if (negOp != OpInvalid && !negImm8.invalid) {
+ as_alu(negDest, InvalidReg, negImm8, negOp, LeaveCC, c);
+ return;
+ }
+
+ // Try movw/movt.
+ if (HasMOVWT()) {
+ // ARMv7 supports movw/movt. movw zero-extends its 16 bit argument,
+ // so we can set the register this way. movt leaves the bottom 16
+ // bits in tact, so we always need a movw.
+ as_movw(dest, Imm16(imm.value & 0xffff), c);
+ if (uint32_t(imm.value) >> 16)
+ as_movt(dest, Imm16(uint32_t(imm.value) >> 16), c);
+ return;
+ }
+
+ // If we don't have movw/movt, we need a load.
+ as_Imm32Pool(dest, imm.value, c);
}
void
-MacroAssemblerARM::ma_mov(ImmWord imm, Register dest,
- SBit s, Assembler::Condition c)
+MacroAssemblerARM::ma_mov(ImmWord imm, Register dest, Assembler::Condition c)
{
- ma_alu(InvalidReg, Imm32(imm.value), dest, OpMov, s, c);
+ ma_mov(Imm32(imm.value), dest, c);
}
void
@@ -566,12 +526,6 @@ MacroAssemblerARM::ma_rol(Register shift, Register src, Register dst)
}
// Move not (dest <- ~src)
-void
-MacroAssemblerARM::ma_mvn(Imm32 imm, Register dest, SBit s, Assembler::Condition c)
-{
- ma_alu(InvalidReg, imm, dest, OpMvn, s, c);
-}
-
void
MacroAssemblerARM::ma_mvn(Register src1, Register dest, SBit s, Assembler::Condition c)
{
@@ -1015,7 +969,7 @@ MacroAssemblerARM::ma_mod_mask(Register src, Register dest, Register hold, Regis
ma_mov(Imm32(0), dest);
// Set the hold appropriately.
ma_mov(Imm32(1), hold);
- ma_mov(Imm32(-1), hold, LeaveCC, Signed);
+ ma_mov(Imm32(-1), hold, Signed);
ma_rsb(Imm32(0), tmp, SetCC, Signed);
// Begin the main loop.
@@ -2410,10 +2364,10 @@ MacroAssembler::clampDoubleToUint8(FloatRegister input, Register output)
// Copy the converted value out.
as_vxfer(output, InvalidReg, scratchDouble, FloatToCore);
as_vmrs(pc);
- ma_mov(Imm32(0), output, LeaveCC, Overflow); // NaN => 0
+ ma_mov(Imm32(0), output, Overflow); // NaN => 0
ma_b(&outOfRange, Overflow); // NaN
ma_cmp(output, Imm32(0xff));
- ma_mov(Imm32(0xff), output, LeaveCC, Above);
+ ma_mov(Imm32(0xff), output, Above);
ma_b(&outOfRange, Above);
// Convert it back to see if we got the same value back.
as_vcvt(scratchDouble, VFPRegister(scratchDouble).uintOverlay());
diff --git a/js/src/jit/arm/MacroAssembler-arm.h b/js/src/jit/arm/MacroAssembler-arm.h
index 6b486c637ff..7b6fb5e0f09 100644
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -123,19 +123,12 @@ class MacroAssemblerARM : public Assembler
static void ma_mov_patch(ImmPtr imm, Register dest, Assembler::Condition c,
RelocStyle rs, Instruction* i);
- // These should likely be wrapped up as a set of macros or something like
- // that. I cannot think of a good reason to explicitly have all of this
- // code.
-
// ALU based ops
// mov
- void ma_mov(Register src, Register dest,
- SBit s = LeaveCC, Condition c = Always);
+ void ma_mov(Register src, Register dest, SBit s = LeaveCC, Condition c = Always);
- void ma_mov(Imm32 imm, Register dest,
- SBit s = LeaveCC, Condition c = Always);
- void ma_mov(ImmWord imm, Register dest,
- SBit s = LeaveCC, Condition c = Always);
+ void ma_mov(Imm32 imm, Register dest, Condition c = Always);
+ void ma_mov(ImmWord imm, Register dest, Condition c = Always);
void ma_mov(ImmGCPtr ptr, Register dest);
@@ -145,7 +138,7 @@ class MacroAssemblerARM : public Assembler
void ma_asr(Imm32 shift, Register src, Register dst);
void ma_ror(Imm32 shift, Register src, Register dst);
void ma_rol(Imm32 shift, Register src, Register dst);
- // Shifts (just a move with a shifting op2)
+
void ma_lsl(Register shift, Register src, Register dst);
void ma_lsr(Register shift, Register src, Register dst);
void ma_asr(Register shift, Register src, Register dst);
@@ -153,12 +146,7 @@ class MacroAssemblerARM : public Assembler
void ma_rol(Register shift, Register src, Register dst);
// Move not (dest <- ~src)
- void ma_mvn(Imm32 imm, Register dest,
- SBit s = LeaveCC, Condition c = Always);
-
-
- void ma_mvn(Register src1, Register dest,
- SBit s = LeaveCC, Condition c = Always);
+ void ma_mvn(Register src1, Register dest, SBit s = LeaveCC, Condition c = Always);
// Negate (dest <- -src) implemented as rsb dest, src, 0
void ma_neg(Register src, Register dest,
@@ -177,8 +165,6 @@ class MacroAssemblerARM : public Assembler
void ma_and(Imm32 imm, Register src1, Register dest,
SBit s = LeaveCC, Condition c = Always);
-
-
// Bit clear (dest <- dest & ~imm) or (dest <- src1 & ~src2)
void ma_bic(Imm32 imm, Register dest,
SBit s = LeaveCC, Condition c = Always);
@@ -1595,8 +1581,8 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
// <0, then we want to clamp to 0, otherwise, we wish to clamp to 255
ScratchRegisterScope scratch(asMasm());
as_mov(scratch, asr(reg, 8), SetCC);
- ma_mov(Imm32(0xff), reg, LeaveCC, NotEqual);
- ma_mov(Imm32(0), reg, LeaveCC, Signed);
+ ma_mov(Imm32(0xff), reg, NotEqual);
+ ma_mov(Imm32(0), reg, Signed);
}
inline void incrementInt32Value(const Address& addr);
@@ -1648,7 +1634,7 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
emitSet(Assembler::Condition cond, Register dest)
{
ma_mov(Imm32(0), dest);
- ma_mov(Imm32(1), dest, LeaveCC, cond);
+ ma_mov(Imm32(1), dest, cond);
}
template
diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp
index 0e5c2b32fb0..1a095a922b1 100644
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -71,7 +71,7 @@ static const char kJSCachePrefix[] = "jsloader";
#define XPC_DESERIALIZATION_BUFFER_SIZE (12 * 8192)
// NSPR_LOG_MODULES=JSComponentLoader:5
-static LazyLogModule gJSCLLog("JSComponentLoader");
+static PRLogModuleInfo* gJSCLLog;
#define LOG(args) MOZ_LOG(gJSCLLog, mozilla::LogLevel::Debug, args)
@@ -198,6 +198,10 @@ mozJSComponentLoader::mozJSComponentLoader()
{
MOZ_ASSERT(!sSelf, "mozJSComponentLoader should be a singleton");
+ if (!gJSCLLog) {
+ gJSCLLog = PR_NewLogModule("JSComponentLoader");
+ }
+
sSelf = this;
}
diff --git a/js/xpconnect/src/XPCLog.cpp b/js/xpconnect/src/XPCLog.cpp
index 515af2a4786..5624587c788 100644
--- a/js/xpconnect/src/XPCLog.cpp
+++ b/js/xpconnect/src/XPCLog.cpp
@@ -25,12 +25,13 @@
static char* g_Spaces;
static int g_InitState = 0;
static int g_Indent = 0;
-static mozilla::LazyLogModule g_LogMod("xpclog");
+static PRLogModuleInfo* g_LogMod = nullptr;
static bool Init()
{
+ g_LogMod = PR_NewLogModule("xpclog");
g_Spaces = new char[SPACE_COUNT+1];
- if (!g_Spaces || !MOZ_LOG_TEST(g_LogMod,LogLevel::Error)) {
+ if (!g_LogMod || !g_Spaces || !MOZ_LOG_TEST(g_LogMod,LogLevel::Error)) {
g_InitState = 1;
XPC_Log_Finish();
return false;
@@ -46,6 +47,8 @@ XPC_Log_Finish()
{
if (g_InitState == 1) {
delete [] g_Spaces;
+ // we'd like to properly cleanup the LogModule, but nspr owns that
+ g_LogMod = nullptr;
}
g_InitState = -1;
}
diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp
index b3ac37a6dad..cf5c614b01c 100644
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -202,7 +202,7 @@ xpc::ErrorReport::Init(JSErrorReport* aReport, const char* aFallbackMessage,
mIsMuted = aReport->isMuted;
}
-static LazyLogModule gJSDiagnostics("JSDiagnostics");
+static PRLogModuleInfo* gJSDiagnostics;
void
xpc::ErrorReport::LogToConsole()
@@ -232,10 +232,15 @@ xpc::ErrorReport::LogToConsoleWithStack(JS::HandleObject aStack)
fflush(stderr);
}
- MOZ_LOG(gJSDiagnostics,
- JSREPORT_IS_WARNING(mFlags) ? LogLevel::Warning : LogLevel::Error,
- ("file %s, line %u\n%s", NS_LossyConvertUTF16toASCII(mFileName).get(),
- mLineNumber, NS_LossyConvertUTF16toASCII(mErrorMsg).get()));
+ // Log to the PR Log Module.
+ if (!gJSDiagnostics)
+ gJSDiagnostics = PR_NewLogModule("JSDiagnostics");
+ if (gJSDiagnostics) {
+ MOZ_LOG(gJSDiagnostics,
+ JSREPORT_IS_WARNING(mFlags) ? LogLevel::Warning : LogLevel::Error,
+ ("file %s, line %u\n%s", NS_LossyConvertUTF16toASCII(mFileName).get(),
+ mLineNumber, NS_LossyConvertUTF16toASCII(mErrorMsg).get()));
+ }
// Log to the console. We do this last so that we can simply return if
// there's no console service without affecting the other reporting
diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp
index be559cd075a..947048132da 100644
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -223,13 +223,13 @@ GetFrameForChildrenOnlyTransformHint(nsIFrame *aFrame)
// This happens if the root-