summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/basilisk/locales/en-US/chrome/browser-region/region.properties7
-rw-r--r--application/palemoon/locales/en-US/chrome/browser-region/region.properties24
-rw-r--r--config/milestone.txt2
-rw-r--r--docs/CONTRIBUTING.md42
-rw-r--r--dom/base/nsNodeInfoManager.cpp31
-rw-r--r--dom/base/nsNodeInfoManager.h3
-rw-r--r--dom/indexedDB/ActorsParent.cpp46
-rw-r--r--dom/media/AudioConverter.cpp108
-rw-r--r--embedding/components/find/nsFind.cpp5
-rw-r--r--js/src/jit/arm/Assembler-arm.cpp7
-rw-r--r--js/src/jit/arm/MacroAssembler-arm.cpp5
-rw-r--r--media/libpng/png.c3
-rw-r--r--parser/html/nsHtml5Portability.cpp2
-rw-r--r--xpcom/base/nsCycleCollector.cpp5
-rw-r--r--xpcom/ds/nsAtomTable.cpp8
-rw-r--r--xpcom/ds/nsIAtom.idl10
16 files changed, 206 insertions, 102 deletions
diff --git a/application/basilisk/locales/en-US/chrome/browser-region/region.properties b/application/basilisk/locales/en-US/chrome/browser-region/region.properties
index e35fc7497..8782ae46f 100644
--- a/application/basilisk/locales/en-US/chrome/browser-region/region.properties
+++ b/application/basilisk/locales/en-US/chrome/browser-region/region.properties
@@ -9,6 +9,7 @@ browser.search.defaultenginename=DuckDuckGo
browser.search.order.1=DuckDuckGo
browser.search.order.2=Yahoo
browser.search.order.3=Bing
+browser.search.order.4=Ecosia
# This is the default set of web based feed handlers shown in the reader
# selection UI
@@ -20,11 +21,7 @@ browser.contentHandlers.types.0.uri=https://add.my.yahoo.com/rss?url=%s
# profile database. Note that "new" is defined as "has a different URL"; this
# means that it's not possible to update the name of existing handler, so
# don't make any spelling errors here.
-gecko.handlerService.defaultHandlersVersion=4
-
-# The default set of protocol handlers for webcal:
-gecko.handlerService.schemes.webcal.0.name=30 Boxes
-gecko.handlerService.schemes.webcal.0.uriTemplate=https://30boxes.com/external/widget?refer=ff&url=%s
+gecko.handlerService.defaultHandlersVersion=5
# The default set of protocol handlers for mailto:
gecko.handlerService.schemes.mailto.0.name=Yahoo! Mail
diff --git a/application/palemoon/locales/en-US/chrome/browser-region/region.properties b/application/palemoon/locales/en-US/chrome/browser-region/region.properties
index ad6c1342f..8782ae46f 100644
--- a/application/palemoon/locales/en-US/chrome/browser-region/region.properties
+++ b/application/palemoon/locales/en-US/chrome/browser-region/region.properties
@@ -14,29 +14,25 @@ browser.search.order.4=Ecosia
# This is the default set of web based feed handlers shown in the reader
# selection UI
browser.contentHandlers.types.0.title=My Yahoo!
-browser.contentHandlers.types.0.uri=http://add.my.yahoo.com/rss?url=%s
+browser.contentHandlers.types.0.uri=https://add.my.yahoo.com/rss?url=%s
# increment this number when anything gets changed in the list below. This will
# cause Firefox to re-read these prefs and inject any new handlers into the
# profile database. Note that "new" is defined as "has a different URL"; this
# means that it's not possible to update the name of existing handler, so
# don't make any spelling errors here.
-goanna.handlerService.defaultHandlersVersion=3
-
-# The default set of protocol handlers for webcal:
-goanna.handlerService.schemes.webcal.0.name=30 Boxes
-goanna.handlerService.schemes.webcal.0.uriTemplate=http://30boxes.com/external/widget?refer=ff&url=%s
+gecko.handlerService.defaultHandlersVersion=5
# The default set of protocol handlers for mailto:
-goanna.handlerService.schemes.mailto.0.name=Yahoo! Mail
-goanna.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s
-goanna.handlerService.schemes.mailto.1.name=Gmail
-goanna.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s
+gecko.handlerService.schemes.mailto.0.name=Yahoo! Mail
+gecko.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s
+gecko.handlerService.schemes.mailto.1.name=Gmail
+gecko.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s
# The default set of protocol handlers for irc:
-goanna.handlerService.schemes.irc.0.name=Mibbit
-goanna.handlerService.schemes.irc.0.uriTemplate=https://www.mibbit.com/?url=%s
+gecko.handlerService.schemes.irc.0.name=Mibbit
+gecko.handlerService.schemes.irc.0.uriTemplate=https://www.mibbit.com/?url=%s
# The default set of protocol handlers for ircs:
-goanna.handlerService.schemes.ircs.0.name=Mibbit
-goanna.handlerService.schemes.ircs.0.uriTemplate=https://www.mibbit.com/?url=%s
+gecko.handlerService.schemes.ircs.0.name=Mibbit
+gecko.handlerService.schemes.ircs.0.uriTemplate=https://www.mibbit.com/?url=%s
diff --git a/config/milestone.txt b/config/milestone.txt
index 7aab8cfcb..cf45e1d05 100644
--- a/config/milestone.txt
+++ b/config/milestone.txt
@@ -10,4 +10,4 @@
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------
-4.2.0
+4.2.1
diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md
index 7acdedb4f..9379ea45a 100644
--- a/docs/CONTRIBUTING.md
+++ b/docs/CONTRIBUTING.md
@@ -84,3 +84,45 @@ Important when editing/adding code:
```
3. Comment your code where prudent! Documenting what you're doing, especially in a complex piece of code, is very important to keep it easy to debug.
4. Try not to write "as compact as possible" source code. Many languages have facilities to write very compact source code by gluing a lot of statements together on single lines, but you should avoid this to keep it readable. Other people than yourself will be looking at and trying to understand your code, and it's important to keep proper paragraphing, whitespace and above all logical names for variables and functions.
+
+## Commit Message Style
+
+With rare exception, it is advisable to use the following style for commit messages. This ensures proper tracking and linking of commits to issues.
+
+### Commits with existing issue
+
+This would directly apply to anyone making a pull request.
+
+- Single Commit: `Issue #xxx - Cited issue title or appropriate direct description of changes`
+ - *`Issue #1083 - Deprecate FUEL extension helper javascript library`*
+- Multi-Part Commits: `Issue #xxx - Part Number: Appropriate direct description of changes`
+ - *`Issue #492 - Part 1: Remove files`*
+ - *`Issue #492 - Part 2: Build system, Installer/Packaging`*
+ - *`Issue #492 - Part 3: nsUpdateService.js, updater.cpp, nsUpdateDriver.cpp`*
+ - *`Issue #492 - Part 4: Remove superfluous brackets in nsUpdateService.js and updater.cpp`*
+
+An exception exists for multi-part commits where the issue is anticipated or ends up being long term such as "Stop using unified compilation of sources". In these instances the multi-part form is not required.
+
+### Commits with no issue
+
+Sometimes developers with direct push access will commit without an issue being created. You should, where applicable, prefix the commit message with the application, component, or lib you are working on in square brackets.
+
+- `[COMPONENT] Description of what is being changed`
+ - *`[TychoAM] Give the second <hbox> an ID so it can be targeted in extensions.xul`*
+ - *`[Pale Moon] Use generic application icon for external applications in about:feeds`*
+
+Multi-part changes by definition are not trival and should have a corresponding issue.
+
+### Additional information in commit messages
+
+It may be benefical to include supplementary information such as a longer description, caveats, specific Mozilla bug numbers, links to forum posts or other such references. If you do add additional information, you should seperate it from the main commit message by a blank line.
+
+*Example: (This happens to also be an example of the long term multi-part exception)*
+```
+Issue #80 - Stop building /accessible unified and fix deprot
+
+Note: excludes changes to Mac-specific code because I can't build
+for OS X to check and fix deprot there.
+```
+
+In general, if you have a question about commit message form or content, please ask.
diff --git a/dom/base/nsNodeInfoManager.cpp b/dom/base/nsNodeInfoManager.cpp
index 985d540b4..1f751ea71 100644
--- a/dom/base/nsNodeInfoManager.cpp
+++ b/dom/base/nsNodeInfoManager.cpp
@@ -112,7 +112,8 @@ nsNodeInfoManager::nsNodeInfoManager()
mNonDocumentNodeInfos(0),
mTextNodeInfo(nullptr),
mCommentNodeInfo(nullptr),
- mDocumentNodeInfo(nullptr)
+ mDocumentNodeInfo(nullptr),
+ mRecentlyUsedNodeInfos{}
{
nsLayoutStatics::AddRef();
@@ -232,11 +233,19 @@ nsNodeInfoManager::GetNodeInfo(nsIAtom *aName, nsIAtom *aPrefix,
NodeInfo::NodeInfoInner tmpKey(aName, aPrefix, aNamespaceID, aNodeType,
aExtraName);
+ uint32_t index =
+ GetNodeInfoInnerHashValue(&tmpKey) % RECENTLY_USED_NODEINFOS_SIZE;
+ NodeInfo* ni = mRecentlyUsedNodeInfos[index];
+ if (ni && NodeInfoInnerKeyCompare(&(ni->mInner), &tmpKey)) {
+ RefPtr<NodeInfo> nodeInfo = ni;
+ return nodeInfo.forget();
+ }
+
void *node = PL_HashTableLookup(mNodeInfoHash, &tmpKey);
if (node) {
RefPtr<NodeInfo> nodeInfo = static_cast<NodeInfo*>(node);
-
+ mRecentlyUsedNodeInfos[index] = nodeInfo;
return nodeInfo.forget();
}
@@ -254,6 +263,7 @@ nsNodeInfoManager::GetNodeInfo(nsIAtom *aName, nsIAtom *aPrefix,
NS_IF_ADDREF(mDocument);
}
+ mRecentlyUsedNodeInfos[index] = newNodeInfo;
return newNodeInfo.forget();
}
@@ -272,10 +282,20 @@ nsNodeInfoManager::GetNodeInfo(const nsAString& aName, nsIAtom *aPrefix,
NodeInfo::NodeInfoInner tmpKey(aName, aPrefix, aNamespaceID, aNodeType);
+ uint32_t index =
+ GetNodeInfoInnerHashValue(&tmpKey) % RECENTLY_USED_NODEINFOS_SIZE;
+ NodeInfo* ni = mRecentlyUsedNodeInfos[index];
+ if (ni && NodeInfoInnerKeyCompare(&(ni->mInner), &tmpKey)) {
+ RefPtr<NodeInfo> nodeInfo = ni;
+ nodeInfo.forget(aNodeInfo);
+ return NS_OK;
+ }
+
void *node = PL_HashTableLookup(mNodeInfoHash, &tmpKey);
if (node) {
RefPtr<NodeInfo> nodeInfo = static_cast<NodeInfo*>(node);
+ mRecentlyUsedNodeInfos[index] = nodeInfo;
nodeInfo.forget(aNodeInfo);
return NS_OK;
@@ -297,6 +317,7 @@ nsNodeInfoManager::GetNodeInfo(const nsAString& aName, nsIAtom *aPrefix,
NS_IF_ADDREF(mDocument);
}
+ mRecentlyUsedNodeInfos[index] = newNodeInfo;
newNodeInfo.forget(aNodeInfo);
return NS_OK;
@@ -421,6 +442,12 @@ nsNodeInfoManager::RemoveNodeInfo(NodeInfo *aNodeInfo)
}
}
+ uint32_t index =
+ GetNodeInfoInnerHashValue(&aNodeInfo->mInner) % RECENTLY_USED_NODEINFOS_SIZE;
+ if (mRecentlyUsedNodeInfos[index] == aNodeInfo) {
+ mRecentlyUsedNodeInfos[index] = nullptr;
+ }
+
#ifdef DEBUG
bool ret =
#endif
diff --git a/dom/base/nsNodeInfoManager.h b/dom/base/nsNodeInfoManager.h
index 6ece66577..759dd391e 100644
--- a/dom/base/nsNodeInfoManager.h
+++ b/dom/base/nsNodeInfoManager.h
@@ -32,6 +32,8 @@ class NodeInfo;
} // namespace dom
} // namespace mozilla
+#define RECENTLY_USED_NODEINFOS_SIZE 31
+
class nsNodeInfoManager final
{
private:
@@ -137,6 +139,7 @@ private:
mozilla::dom::NodeInfo * MOZ_NON_OWNING_REF mCommentNodeInfo; // WEAK to avoid circular ownership
mozilla::dom::NodeInfo * MOZ_NON_OWNING_REF mDocumentNodeInfo; // WEAK to avoid circular ownership
RefPtr<nsBindingManager> mBindingManager;
+ mozilla::dom::NodeInfo* mRecentlyUsedNodeInfos[RECENTLY_USED_NODEINFOS_SIZE];
};
#endif /* nsNodeInfoManager_h___ */
diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp
index 38621cee3..cd998c31c 100644
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -23717,32 +23717,38 @@ TransactionDatabaseOperationBase::SendPreprocessInfoOrResults(
MOZ_ASSERT(mTransaction);
if (NS_WARN_IF(IsActorDestroyed())) {
- // Don't send any notifications if the actor was destroyed already.
+ // Normally we wouldn't need to send any notifications if the actor was
+ // already destroyed, but this can be a VersionChangeOp which needs to
+ // notify its parent operation (OpenDatabaseOp) about the failure.
+ // So SendFailureResult needs to be called even when the actor was
+ // destroyed. Normal operations redundantly check if the actor was
+ // destroyed in SendSuccessResult and SendFailureResult, therefore it's
+ // ok to call it in all cases here.
if (NS_SUCCEEDED(mResultCode)) {
IDB_REPORT_INTERNAL_ERR();
mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
}
- } else {
- if (mTransaction->IsInvalidated() || mTransaction->IsAborted()) {
- // Aborted transactions always see their requests fail with ABORT_ERR,
- // even if the request succeeded or failed with another error.
- mResultCode = NS_ERROR_DOM_INDEXEDDB_ABORT_ERR;
- } else if (NS_SUCCEEDED(mResultCode)) {
- if (aSendPreprocessInfo) {
- // This should not release the IPDL reference.
- mResultCode = SendPreprocessInfo();
- } else {
- // This may release the IPDL reference.
- mResultCode = SendSuccessResult();
- }
+ } else if (mTransaction->IsInvalidated() || mTransaction->IsAborted()) {
+ // Aborted transactions always see their requests fail with ABORT_ERR,
+ // even if the request succeeded or failed with another error.
+ mResultCode = NS_ERROR_DOM_INDEXEDDB_ABORT_ERR;
+ }
+
+ if (NS_SUCCEEDED(mResultCode)) {
+ if (aSendPreprocessInfo) {
+ // This should not release the IPDL reference.
+ mResultCode = SendPreprocessInfo();
+ } else {
+ // This may release the IPDL reference.
+ mResultCode = SendSuccessResult();
}
+ }
- if (NS_FAILED(mResultCode)) {
- // This should definitely release the IPDL reference.
- if (!SendFailureResult(mResultCode)) {
- // Abort the transaction.
- mTransaction->Abort(mResultCode, /* aForce */ false);
- }
+ if (NS_FAILED(mResultCode)) {
+ // This should definitely release the IPDL reference.
+ if (!SendFailureResult(mResultCode)) {
+ // Abort the transaction.
+ mTransaction->Abort(mResultCode, /* aForce */ false);
}
}
diff --git a/dom/media/AudioConverter.cpp b/dom/media/AudioConverter.cpp
index 25b981f43..002e79108 100644
--- a/dom/media/AudioConverter.cpp
+++ b/dom/media/AudioConverter.cpp
@@ -5,8 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "AudioConverter.h"
-#include <string.h>
#include <speex/speex_resampler.h>
+#include <string.h>
#include <cmath>
/*
@@ -140,24 +140,28 @@ static inline int16_t clipTo15(int32_t aX)
size_t
AudioConverter::DownmixAudio(void* aOut, const void* aIn, size_t aFrames) const
{
- MOZ_ASSERT(mIn.Format() == AudioConfig::FORMAT_S16 ||
- mIn.Format() == AudioConfig::FORMAT_FLT);
- MOZ_ASSERT(mIn.Channels() >= mOut.Channels());
- MOZ_ASSERT(mIn.Layout() == AudioConfig::ChannelLayout(mIn.Channels()),
- "Can only downmix input data in SMPTE layout");
- MOZ_ASSERT(mOut.Layout() == AudioConfig::ChannelLayout(2) ||
- mOut.Layout() == AudioConfig::ChannelLayout(1));
+ MOZ_DIAGNOSTIC_ASSERT(mIn.Format() == AudioConfig::FORMAT_S16 ||
+ mIn.Format() == AudioConfig::FORMAT_FLT);
+ MOZ_DIAGNOSTIC_ASSERT(mIn.Channels() >= mOut.Channels());
+ MOZ_DIAGNOSTIC_ASSERT(
+ mIn.Layout() == AudioConfig::ChannelLayout(mIn.Channels()),
+ "Can only downmix input data in SMPTE layout");
+ MOZ_DIAGNOSTIC_ASSERT(mOut.Layout() == AudioConfig::ChannelLayout(2) ||
+ mOut.Layout() == AudioConfig::ChannelLayout(1),
+ "Can only downmix to stereo or mono");
- uint32_t channels = mIn.Channels();
+ uint32_t inChannels = mIn.Channels();
+ uint32_t outChannels = mOut.Channels();
- if (channels == 1 && mOut.Channels() == 1) {
+ if (inChannels == outChannels) {
+ // Number of channels is equal; no processing needed, just move data.
if (aOut != aIn) {
memmove(aOut, aIn, FramesOutToBytes(aFrames));
}
return aFrames;
}
- if (channels > 2) {
+ if (inChannels > 2) {
if (mIn.Format() == AudioConfig::FORMAT_FLT) {
// Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows 5-8.
static const float dmatrix[6][8][2]= {
@@ -174,12 +178,18 @@ AudioConverter::DownmixAudio(void* aOut, const void* aIn, size_t aFrames) const
for (uint32_t i = 0; i < aFrames; i++) {
float sampL = 0.0;
float sampR = 0.0;
- for (uint32_t j = 0; j < channels; j++) {
- sampL += in[i*mIn.Channels()+j]*dmatrix[mIn.Channels()-3][j][0];
- sampR += in[i*mIn.Channels()+j]*dmatrix[mIn.Channels()-3][j][1];
+ for (uint32_t j = 0; j < inChannels; j++) {
+ sampL += in[i * inChannels + j] * dmatrix[inChannels - 3][j][0];
+ sampR += in[i * inChannels + j] * dmatrix[inChannels - 3][j][1];
+ }
+ if (outChannels == 2) {
+ // Stereo
+ *out++ = sampL;
+ *out++ = sampR;
+ } else {
+ // Mono
+ *out++ = (sampL + sampR) * 0.5;
}
- *out++ = sampL;
- *out++ = sampR;
}
} else if (mIn.Format() == AudioConfig::FORMAT_S16) {
// Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows 5-8.
@@ -198,45 +208,51 @@ AudioConverter::DownmixAudio(void* aOut, const void* aIn, size_t aFrames) const
for (uint32_t i = 0; i < aFrames; i++) {
int32_t sampL = 0;
int32_t sampR = 0;
- for (uint32_t j = 0; j < channels; j++) {
- sampL+=in[i*channels+j]*dmatrix[channels-3][j][0];
- sampR+=in[i*channels+j]*dmatrix[channels-3][j][1];
+ for (uint32_t j = 0; j < inChannels; j++) {
+ sampL += in[i * inChannels + j] * dmatrix[inChannels - 3][j][0];
+ sampR += in[i * inChannels + j] * dmatrix[inChannels - 3][j][1];
+ }
+ sampL = clipTo15((sampL + 8192) >> 14);
+ sampR = clipTo15((sampR + 8192) >> 14);
+ if (outChannels == 2) {
+ // Stereo
+ *out++ = sampL;
+ *out++ = sampR;
+ } else {
+ // Mono
+ *out++ = (sampL + sampR) * 0.5;
}
- *out++ = clipTo15((sampL + 8192)>>14);
- *out++ = clipTo15((sampR + 8192)>>14);
}
} else {
MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type");
}
- // If we are to continue downmixing to mono, start working on the output
- // buffer.
- aIn = aOut;
- channels = 2;
+ return aFrames;
}
- if (mOut.Channels() == 1) {
- if (mIn.Format() == AudioConfig::FORMAT_FLT) {
- const float* in = static_cast<const float*>(aIn);
- float* out = static_cast<float*>(aOut);
- for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) {
- float sample = 0.0;
- // The sample of the buffer would be interleaved.
- sample = (in[fIdx*channels] + in[fIdx*channels + 1]) * 0.5;
- *out++ = sample;
- }
- } else if (mIn.Format() == AudioConfig::FORMAT_S16) {
- const int16_t* in = static_cast<const int16_t*>(aIn);
- int16_t* out = static_cast<int16_t*>(aOut);
- for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) {
- int32_t sample = 0.0;
- // The sample of the buffer would be interleaved.
- sample = (in[fIdx*channels] + in[fIdx*channels + 1]) * 0.5;
- *out++ = sample;
- }
- } else {
- MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type");
+ // If we get here, we're doing a stereo -> mono conversion.
+ MOZ_DIAGNOSTIC_ASSERT(inChannels == 2 && outChannels == 1);
+
+ if (mIn.Format() == AudioConfig::FORMAT_FLT) {
+ const float* in = static_cast<const float*>(aIn);
+ float* out = static_cast<float*>(aOut);
+ for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) {
+ float sample = 0.0;
+ // The sample of the buffer would be interleaved.
+ sample = (in[fIdx * inChannels] + in[fIdx * inChannels + 1]) * 0.5;
+ *out++ = sample;
}
+ } else if (mIn.Format() == AudioConfig::FORMAT_S16) {
+ const int16_t* in = static_cast<const int16_t*>(aIn);
+ int16_t* out = static_cast<int16_t*>(aOut);
+ for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) {
+ int32_t sample = 0.0;
+ // The sample of the buffer would be interleaved.
+ sample = (in[fIdx * inChannels] + in[fIdx * inChannels + 1]) * 0.5;
+ *out++ = sample;
+ }
+ } else {
+ MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type");
}
return aFrames;
}
diff --git a/embedding/components/find/nsFind.cpp b/embedding/components/find/nsFind.cpp
index 5fc1f9db6..6987c11d3 100644
--- a/embedding/components/find/nsFind.cpp
+++ b/embedding/components/find/nsFind.cpp
@@ -966,6 +966,11 @@ nsFind::Find(const char16_t* aPatText, nsIDOMRange* aSearchRange,
const char16_t* patStr = patAutoStr.get();
int32_t patLen = patAutoStr.Length() - 1;
+
+ // If this function is called with an empty string, we should early exit.
+ if (patLen < 0) {
+ return NS_OK;
+ }
// current offset into the pattern -- reset to beginning/end:
int32_t pindex = (mFindBackward ? patLen : 0);
diff --git a/js/src/jit/arm/Assembler-arm.cpp b/js/src/jit/arm/Assembler-arm.cpp
index 2830f0695..1e20da1c8 100644
--- a/js/src/jit/arm/Assembler-arm.cpp
+++ b/js/src/jit/arm/Assembler-arm.cpp
@@ -2401,7 +2401,12 @@ Assembler::as_b(Label* l, Condition c)
if (oom())
return BufferOffset();
- as_b(BufferOffset(l).diffB<BOffImm>(ret), c, ret);
+ BOffImm off = BufferOffset(l).diffB<BOffImm>(ret);
+ if (off.isInvalid()) {
+ m_buffer.fail_bail();
+ return BufferOffset();
+ }
+ as_b(off, c, ret);
#ifdef JS_DISASM_ARM
spewBranch(m_buffer.getInstOrNull(ret), l);
#endif
diff --git a/js/src/jit/arm/MacroAssembler-arm.cpp b/js/src/jit/arm/MacroAssembler-arm.cpp
index d40578514..a4161ab00 100644
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -5012,7 +5012,10 @@ void
MacroAssembler::patchCall(uint32_t callerOffset, uint32_t calleeOffset)
{
BufferOffset inst(callerOffset - 4);
- as_bl(BufferOffset(calleeOffset).diffB<BOffImm>(inst), Always, inst);
+ BOffImm off = BufferOffset(calleeOffset).diffB<BOffImm>(inst);
+ MOZ_RELEASE_ASSERT(!off.isInvalid(),
+ "Failed to insert necessary far jump islands");
+ as_bl(off, Always, inst);
}
CodeOffset
diff --git a/media/libpng/png.c b/media/libpng/png.c
index e6fe51722..3630b1f73 100644
--- a/media/libpng/png.c
+++ b/media/libpng/png.c
@@ -4517,8 +4517,7 @@ png_image_free(png_imagep image)
if (image != NULL && image->opaque != NULL &&
image->opaque->error_buf == NULL)
{
- /* Ignore errors here: */
- (void)png_safe_execute(image, png_image_free_function, image);
+ png_image_free_function(image);
image->opaque = NULL;
}
}
diff --git a/parser/html/nsHtml5Portability.cpp b/parser/html/nsHtml5Portability.cpp
index 36c7e758a..0a7c6f845 100644
--- a/parser/html/nsHtml5Portability.cpp
+++ b/parser/html/nsHtml5Portability.cpp
@@ -91,7 +91,7 @@ nsHtml5Portability::releaseString(nsString* str)
bool
nsHtml5Portability::localEqualsBuffer(nsIAtom* local, char16_t* buf, int32_t offset, int32_t length)
{
- return local->Equals(nsDependentSubstring(buf + offset, buf + offset + length));
+ return local->Equals(buf + offset, length);
}
bool
diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp
index 06ed42326..5dffa7409 100644
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -2832,6 +2832,11 @@ nsCycleCollector::ForgetSkippable(bool aRemoveChildlessNodes,
{
CheckThreadSafety();
+ // Avoid this when we're aleady dealing with snow-white objects.
+ if (mFreeingSnowWhite) {
+ return;
+ }
+
mozilla::Maybe<mozilla::AutoGlobalTimelineMarker> marker;
if (NS_IsMainThread()) {
marker.emplace("nsCycleCollector::ForgetSkippable", MarkerStackRequest::NO_STACK);
diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp
index 4c93625ae..c2e77e31f 100644
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -325,13 +325,7 @@ AtomTableMatchKey(const PLDHashEntryHdr* aEntry, const void* aKey)
nsDependentAtomString(he->mAtom)) == 0;
}
- uint32_t length = he->mAtom->GetLength();
- if (length != k->mLength) {
- return false;
- }
-
- return memcmp(he->mAtom->GetUTF16String(),
- k->mUTF16String, length * sizeof(char16_t)) == 0;
+ return he->mAtom->Equals(k->mUTF16String, k->mLength);
}
static void
diff --git a/xpcom/ds/nsIAtom.idl b/xpcom/ds/nsIAtom.idl
index 6e8602c42..ce4cff485 100644
--- a/xpcom/ds/nsIAtom.idl
+++ b/xpcom/ds/nsIAtom.idl
@@ -37,9 +37,15 @@ interface nsIAtom : nsISupports
size_t SizeOfIncludingThis(in MallocSizeOf aMallocSizeOf);
%{C++
- // note this is NOT virtual so this won't muck with the vtable!
+ // note these are NOT virtual so they won't muck with the vtable!
+ inline bool Equals(char16ptr_t aString, uint32_t aLength) const
+ {
+ return mLength == aLength &&
+ memcmp(mString, aString, mLength * sizeof(char16_t)) == 0;
+ }
+
inline bool Equals(const nsAString& aString) const {
- return aString.Equals(nsDependentString(mString, mLength));
+ return Equals(aString.BeginReading(), aString.Length());
}
inline bool IsStaticAtom() const {