Merge latest green fx-team changeset and mozilla-central; a=merge

This commit is contained in:
Ed Morley 2014-08-13 16:53:58 +01:00
commit 76da7b9ce5
165 changed files with 2477 additions and 1256 deletions

View File

@ -9,6 +9,7 @@
#include "nsAccessibilityService.h"
#include "DocAccessible.h"
#include "mozilla/dom/ChildIterator.h"
#include "mozilla/dom/Element.h"
using namespace mozilla::a11y;
@ -22,13 +23,12 @@ namespace a11y {
struct WalkState
{
WalkState(nsIContent *aContent) :
content(aContent), childIdx(0), prevState(nullptr) {}
WalkState(nsIContent *aContent, uint32_t aFilter) :
content(aContent), prevState(nullptr), iter(aContent, aFilter) {}
nsCOMPtr<nsIContent> content;
nsCOMPtr<nsINodeList> childList;
uint32_t childIdx;
WalkState *prevState;
dom::AllChildrenIterator iter;
};
} // namespace a11y
@ -45,14 +45,13 @@ TreeWalker::
{
NS_ASSERTION(aContent, "No node for the accessible tree walker!");
if (aContent)
mState = new WalkState(aContent);
mChildFilter = mContext->CanHaveAnonChildren() ?
nsIContent::eAllChildren : nsIContent::eAllButXBL;
mChildFilter |= nsIContent::eSkipPlaceholderContent;
if (aContent)
mState = new WalkState(aContent, mChildFilter);
MOZ_COUNT_CTOR(TreeWalker);
}
@ -74,17 +73,7 @@ TreeWalker::NextChildInternal(bool aNoWalkUp)
if (!mState || !mState->content)
return nullptr;
if (!mState->childList)
mState->childList = mState->content->GetChildren(mChildFilter);
uint32_t length = 0;
if (mState->childList)
mState->childList->GetLength(&length);
while (mState->childIdx < length) {
nsIContent* childNode = mState->childList->Item(mState->childIdx);
mState->childIdx++;
while (nsIContent* childNode = mState->iter.GetNextChild()) {
bool isSubtreeHidden = false;
Accessible* accessible = mFlags & eWalkCache ?
mDoc->GetAccessible(childNode) :
@ -95,7 +84,7 @@ TreeWalker::NextChildInternal(bool aNoWalkUp)
return accessible;
// Walk down into subtree to find accessibles.
if (!isSubtreeHidden) {
if (!isSubtreeHidden && childNode->IsElement()) {
PushState(childNode);
accessible = NextChildInternal(true);
if (accessible)
@ -123,14 +112,7 @@ TreeWalker::NextChildInternal(bool aNoWalkUp)
return nullptr;
PushState(parentNode->AsElement());
mState->childList = mState->content->GetChildren(mChildFilter);
length = 0;
if (mState->childList)
mState->childList->GetLength(&length);
while (mState->childIdx < length) {
nsIContent* childNode = mState->childList->Item(mState->childIdx);
mState->childIdx++;
while (nsIContent* childNode = mState->iter.GetNextChild()) {
if (childNode == anchorNode)
return NextChildInternal(false);
}
@ -153,7 +135,7 @@ TreeWalker::PopState()
void
TreeWalker::PushState(nsIContent* aContent)
{
WalkState* nextToLastState = new WalkState(aContent);
WalkState* nextToLastState = new WalkState(aContent, mChildFilter);
nextToLastState->prevState = mState;
mState = nextToLastState;
}

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9f35fca9d818b26c06aa6b7e5c0bef25886f8f20"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2864a8d4413746a5359bbcc5042ef776ed06009a"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9f35fca9d818b26c06aa6b7e5c0bef25886f8f20"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2864a8d4413746a5359bbcc5042ef776ed06009a"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="71f5a35e3bc1801847413cff1f14fc3b5cd991ca"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="7945ca73e687be5edbc7b928dc7fe3a208242144">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9f35fca9d818b26c06aa6b7e5c0bef25886f8f20"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2864a8d4413746a5359bbcc5042ef776ed06009a"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9f35fca9d818b26c06aa6b7e5c0bef25886f8f20"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2864a8d4413746a5359bbcc5042ef776ed06009a"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9f35fca9d818b26c06aa6b7e5c0bef25886f8f20"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2864a8d4413746a5359bbcc5042ef776ed06009a"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="71f5a35e3bc1801847413cff1f14fc3b5cd991ca"/>
@ -133,7 +133,7 @@
<project name="platform_external_libnfc-nci" path="external/libnfc-nci" remote="t2m" revision="4186bdecb4dae911b39a8202252cc2310d91b0be"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="320b05a5761eb2a4816f7529c91ea49422979b55"/>
<project name="platform/frameworks/av" path="frameworks/av" revision="0f7829661cd7125de9dc2c90eca2fa1dbc68dfbf"/>
<project name="platform/frameworks/base" path="frameworks/base" revision="c1019aa8ff3d7f1aa9e3439d3b26ec5f7ef68205"/>
<project name="platform/frameworks/base" path="frameworks/base" revision="f9309b4463abd80e0876cd113c892e31d62113b1"/>
<project name="platform/frameworks/native" path="frameworks/native" revision="268d569074237b53617db8211400d4e3c947ae73"/>
<project name="platform/hardware/libhardware" path="hardware/libhardware" revision="484802559ed106bac4811bd01c024ca64f741e60"/>
<project name="platform/hardware/qcom/audio" path="hardware/qcom/audio" revision="de4ade568b273781416638fbbce13ff31b636ada"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "ac2ad84f3387c493bc6c2b1c0496b0fc10a49a49",
"revision": "c3b71e7993bb9ed0f45994f70552601e0466f0e3",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9f35fca9d818b26c06aa6b7e5c0bef25886f8f20"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2864a8d4413746a5359bbcc5042ef776ed06009a"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9f35fca9d818b26c06aa6b7e5c0bef25886f8f20"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2864a8d4413746a5359bbcc5042ef776ed06009a"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9f35fca9d818b26c06aa6b7e5c0bef25886f8f20"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2864a8d4413746a5359bbcc5042ef776ed06009a"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="71f5a35e3bc1801847413cff1f14fc3b5cd991ca"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9f35fca9d818b26c06aa6b7e5c0bef25886f8f20"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2864a8d4413746a5359bbcc5042ef776ed06009a"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -1488,11 +1488,8 @@ NS_IMETHOD SetAttributeNode(nsIDOMAttr* newAttr, \
if (!newAttr) { \
return NS_ERROR_INVALID_POINTER; \
} \
mozilla::dom::Attr* attr = mozilla::dom::Attr::FromDOMAttr(newAttr); \
if (!attr) { \
return NS_ERROR_INVALID_POINTER; \
} \
mozilla::ErrorResult rv; \
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
*_retval = Element::SetAttributeNode(*attr, rv).take(); \
return rv.ErrorCode(); \
} \
@ -1502,11 +1499,8 @@ NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* oldAttr, \
if (!oldAttr) { \
return NS_ERROR_INVALID_POINTER; \
} \
mozilla::dom::Attr* attr = mozilla::dom::Attr::FromDOMAttr(oldAttr); \
if (!attr) { \
return NS_ERROR_INVALID_POINTER; \
} \
mozilla::ErrorResult rv; \
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(oldAttr); \
*_retval = Element::RemoveAttributeNode(*attr, rv).take(); \
return rv.ErrorCode(); \
} \
@ -1521,11 +1515,8 @@ NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI, \
NS_IMETHOD SetAttributeNodeNS(nsIDOMAttr* newAttr, \
nsIDOMAttr** _retval) MOZ_FINAL \
{ \
mozilla::dom::Attr* attr = mozilla::dom::Attr::FromDOMAttr(newAttr); \
if (!attr) { \
return NS_ERROR_INVALID_POINTER; \
} \
mozilla::ErrorResult rv; \
mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr); \
*_retval = Element::SetAttributeNodeNS(*attr, rv).take(); \
return rv.ErrorCode(); \
} \

View File

@ -80,14 +80,6 @@ public:
virtual nsIDOMNode* AsDOMNode() { return this; }
// This method should not do anything interesting, except possibly in the case of
// external binary components.
static Attr* FromDOMAttr(nsIDOMAttr* aDOMAttr)
{
nsCOMPtr<nsIAttribute> iattr = do_QueryInterface(aDOMAttr);
return static_cast<mozilla::dom::Attr*>(iattr.get());
}
// WebIDL
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

View File

@ -10,6 +10,8 @@
#include "mozilla/dom/HTMLContentElement.h"
#include "mozilla/dom/HTMLShadowElement.h"
#include "mozilla/dom/ShadowRoot.h"
#include "nsIAnonymousContentCreator.h"
#include "nsIFrame.h"
namespace mozilla {
namespace dom {
@ -154,11 +156,15 @@ ExplicitChildIterator::GetNextChild()
return mChild;
}
FlattenedChildIterator::FlattenedChildIterator(nsIContent* aParent)
: ExplicitChildIterator(aParent), mXBLInvolved(false)
void
FlattenedChildIterator::Init(bool aIgnoreXBL)
{
if (aIgnoreXBL) {
return;
}
nsXBLBinding* binding =
aParent->OwnerDoc()->BindingManager()->GetBindingWithContent(aParent);
mParent->OwnerDoc()->BindingManager()->GetBindingWithContent(mParent);
if (binding) {
nsIContent* anon = binding->GetAnonymousContent();
@ -171,8 +177,8 @@ FlattenedChildIterator::FlattenedChildIterator(nsIContent* aParent)
// We set mXBLInvolved to true if either:
// - The node we're iterating has a binding with content attached to it.
// - The node is generated XBL content and has an <xbl:children> child.
if (!mXBLInvolved && aParent->GetBindingParent()) {
for (nsIContent* child = aParent->GetFirstChild();
if (!mXBLInvolved && mParent->GetBindingParent()) {
for (nsIContent* child = mParent->GetFirstChild();
child;
child = child->GetNextSibling()) {
if (child->NodeInfo()->Equals(nsGkAtoms::children, kNameSpaceID_XBL)) {
@ -281,5 +287,63 @@ ExplicitChildIterator::GetPreviousChild()
return mChild;
}
nsIContent*
AllChildrenIterator::GetNextChild()
{
if (mPhase == eNeedBeforeKid) {
mPhase = eNeedExplicitKids;
nsIFrame* frame = mOriginalContent->GetPrimaryFrame();
if (frame) {
nsIFrame* beforeFrame = nsLayoutUtils::GetBeforeFrame(frame);
if (beforeFrame) {
return beforeFrame->GetContent();
}
}
}
if (mPhase == eNeedExplicitKids) {
nsIContent* kid = ExplicitChildIterator::GetNextChild();
if (kid) {
return kid;
}
mPhase = eNeedAnonKids;
}
if (mPhase == eNeedAnonKids) {
if (mAnonKids.IsEmpty()) {
nsIAnonymousContentCreator* ac =
do_QueryFrame(mOriginalContent->GetPrimaryFrame());
if (ac) {
ac->AppendAnonymousContentTo(mAnonKids, mFlags);
}
}
if (!mAnonKids.IsEmpty()) {
nsIContent* nextKid = mAnonKids[0];
mAnonKids.RemoveElementAt(0);
if (mAnonKids.IsEmpty()) {
mPhase = eNeedAfterKid;
}
return nextKid;
}
mPhase = eNeedAfterKid;
}
if (mPhase == eNeedAfterKid) {
mPhase = eDone;
nsIFrame* frame = mOriginalContent->GetPrimaryFrame();
if (frame) {
nsIFrame* afterFrame = nsLayoutUtils::GetAfterFrame(frame);
if (afterFrame) {
return afterFrame->GetContent();
}
}
}
return nullptr;
}
} // namespace dom
} // namespace mozilla

View File

@ -7,6 +7,8 @@
#ifndef ChildIterator_h
#define ChildIterator_h
#include "nsIContent.h"
/**
* Iterates over the children on a node. If a child is an insertion point,
* iterates over the children inserted there instead, or the default content
@ -107,16 +109,73 @@ protected:
class FlattenedChildIterator : public ExplicitChildIterator
{
public:
FlattenedChildIterator(nsIContent* aParent);
FlattenedChildIterator(nsIContent* aParent)
: ExplicitChildIterator(aParent), mXBLInvolved(false)
{
Init(false);
}
bool XBLInvolved() { return mXBLInvolved; }
private:
protected:
/**
* This constructor is a hack to help AllChildrenIterator which sometimes
* doesn't want to consider XBL.
*/
FlattenedChildIterator(nsIContent* aParent, bool aIgnoreXBL)
: ExplicitChildIterator(aParent), mXBLInvolved(false)
{
Init(aIgnoreXBL);
}
void Init(bool aIgnoreXBL);
// For certain optimizations, nsCSSFrameConstructor needs to know if the
// child list of the element that we're iterating matches its .childNodes.
bool mXBLInvolved;
};
/**
* AllChildrenIterator returns the children of a element including before /
* after content and optionally XBL children. It assumes that no mutation of
* the DOM or frame tree takes place during iteration, and will break horribly
* if that is not true.
*/
class AllChildrenIterator : private FlattenedChildIterator
{
public:
AllChildrenIterator(nsIContent* aNode, uint32_t aFlags) :
FlattenedChildIterator(aNode, (aFlags & nsIContent::eAllButXBL)),
mOriginalContent(aNode), mFlags(aFlags),
mPhase(eNeedBeforeKid) {}
#ifdef DEBUG
~AllChildrenIterator() { MOZ_ASSERT(!mMutationGuard.Mutated(0)); }
#endif
nsIContent* GetNextChild();
private:
enum IteratorPhase
{
eNeedBeforeKid,
eNeedExplicitKids,
eNeedAnonKids,
eNeedAfterKid,
eDone
};
nsIContent* mOriginalContent;
nsTArray<nsIContent*> mAnonKids;
uint32_t mFlags;
IteratorPhase mPhase;
#ifdef DEBUG
// XXX we should really assert there are no frame tree changes as well, but
// there's no easy way to do that.
nsMutationGuard mMutationGuard;
#endif
};
} // namespace dom
} // namespace mozilla

View File

@ -661,48 +661,9 @@ already_AddRefed<nsINodeList>
FragmentOrElement::GetChildren(uint32_t aFilter)
{
nsRefPtr<nsSimpleContentList> list = new nsSimpleContentList(this);
if (!list) {
return nullptr;
}
nsIFrame *frame = GetPrimaryFrame();
// Append :before generated content.
if (frame) {
nsIFrame *beforeFrame = nsLayoutUtils::GetBeforeFrame(frame);
if (beforeFrame) {
list->AppendElement(beforeFrame->GetContent());
}
}
// If XBL is bound to this node then append XBL anonymous content including
// explict content altered by insertion point if we were requested for XBL
// anonymous content, otherwise append explicit content with respect to
// insertion point if any.
if (!(aFilter & eAllButXBL)) {
FlattenedChildIterator iter(this);
for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
list->AppendElement(child);
}
} else {
ExplicitChildIterator iter(this);
for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
list->AppendElement(child);
}
}
if (frame) {
// Append native anonymous content to the end.
nsIAnonymousContentCreator* creator = do_QueryFrame(frame);
if (creator) {
creator->AppendAnonymousContentTo(*list, aFilter);
}
// Append :after generated content.
nsIFrame *afterFrame = nsLayoutUtils::GetAfterFrame(frame);
if (afterFrame) {
list->AppendElement(afterFrame->GetContent());
}
AllChildrenIterator iter(this, aFilter);
while (nsIContent* kid = iter.GetNextChild()) {
list->AppendElement(kid);
}
return list.forget();

View File

@ -61,6 +61,7 @@ EXPORTS.mozilla += [
EXPORTS.mozilla.dom += [
'Attr.h',
'ChildIterator.h',
'Comment.h',
'DocumentFragment.h',
'DocumentType.h',

View File

@ -1949,7 +1949,7 @@ nsContentUtils::TraceSafeJSContext(JSTracer* aTrc)
}
if (JSObject* global = js::DefaultObjectForContextOrNull(cx)) {
JS::AssertGCThingMustBeTenured(global);
JS_CallObjectTracer(aTrc, &global, "safe context");
JS_CallUnbarrieredObjectTracer(aTrc, &global, "safe context");
MOZ_ASSERT(global == js::DefaultObjectForContextOrNull(cx));
}
}

View File

@ -242,9 +242,9 @@ nsDOMAttributeMap::GetNamedItem(const nsAString& aAttrName,
}
NS_IMETHODIMP
nsDOMAttributeMap::SetNamedItem(nsIDOMAttr* aDOMAttr, nsIDOMAttr** aReturn)
nsDOMAttributeMap::SetNamedItem(nsIDOMAttr* aAttr, nsIDOMAttr** aReturn)
{
Attr* attribute = Attr::FromDOMAttr(aDOMAttr);
Attr* attribute = static_cast<Attr*>(aAttr);
NS_ENSURE_ARG(attribute);
ErrorResult rv;
@ -253,9 +253,9 @@ nsDOMAttributeMap::SetNamedItem(nsIDOMAttr* aDOMAttr, nsIDOMAttr** aReturn)
}
NS_IMETHODIMP
nsDOMAttributeMap::SetNamedItemNS(nsIDOMAttr* aDOMAttr, nsIDOMAttr** aReturn)
nsDOMAttributeMap::SetNamedItemNS(nsIDOMAttr* aAttr, nsIDOMAttr** aReturn)
{
Attr* attribute = Attr::FromDOMAttr(aDOMAttr);
Attr* attribute = static_cast<Attr*>(aAttr);
NS_ENSURE_ARG(attribute);
ErrorResult rv;

View File

@ -586,8 +586,8 @@ MediaDecoderStateMachine::DecodeVideo()
// soon anyway and we'll want to be able to display frames immediately
// after buffering finishes.
if (mState == DECODER_STATE_DECODING &&
mIsVideoDecoding &&
((!mIsAudioPrerolling && mIsAudioDecoding &&
IsVideoDecoding() &&
((!mIsAudioPrerolling && IsAudioDecoding() &&
GetDecodedAudioDuration() < mLowAudioThresholdUsecs * mPlaybackRate) ||
(!mIsVideoPrerolling && IsVideoDecoding() &&
// don't skip frame when |clock time| <= |mVideoFrameEndTime| for

View File

@ -829,14 +829,6 @@ protected:
bool mIsAudioPrerolling;
bool mIsVideoPrerolling;
// True when we have an audio stream that we're decoding, and we have not
// yet decoded to end of stream.
bool mIsAudioDecoding;
// True when we have a video stream that we're decoding, and we have not
// yet decoded to end of stream.
bool mIsVideoDecoding;
// True when we have dispatched a task to the decode task queue to request
// decoded audio/video, and/or we are waiting for the requested sample to be
// returned by callback from the Reader.

View File

@ -17,6 +17,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/TimeStamp.h"
#include "nsThreadUtils.h"
#include <algorithm>
// For HTTP seeking, if number of bytes needing to be
// seeked forward is less than this value then a read is
@ -151,6 +152,12 @@ public:
return aByteRange.mStart >= mStart && aByteRange.mEnd <= mEnd;
}
MediaByteRange Extents(const MediaByteRange& aByteRange) const
{
return MediaByteRange(std::min(mStart, aByteRange.mStart),
std::max(mEnd, aByteRange.mEnd));
}
int64_t mStart, mEnd;
};

View File

@ -78,7 +78,7 @@ public:
uint32_t sum = 0;
uint32_t bytesRead = 0;
do {
uint32_t offset = aOffset + sum;
uint64_t offset = aOffset + sum;
char* buffer = reinterpret_cast<char*>(aBuffer) + sum;
uint32_t toRead = aCount - sum;
nsresult rv = mResource->ReadAt(offset, buffer, toRead, &bytesRead);
@ -745,13 +745,27 @@ void
MP4Reader::NotifyDataArrived(const char* aBuffer, uint32_t aLength,
int64_t aOffset)
{
nsTArray<MediaByteRange> ranges;
if (NS_FAILED(mDecoder->GetResource()->GetCachedRanges(ranges))) {
return;
if (NS_IsMainThread()) {
MediaTaskQueue* queue =
mAudio.mTaskQueue ? mAudio.mTaskQueue : mVideo.mTaskQueue;
queue->Dispatch(NS_NewRunnableMethod(this, &MP4Reader::UpdateIndex));
} else {
UpdateIndex();
}
}
void
MP4Reader::UpdateIndex()
{
nsTArray<MediaByteRange> ranges;
nsTArray<Interval<Microseconds>> timeRanges;
mDemuxer->ConvertByteRangesToTime(ranges, &timeRanges);
MediaResource* resource = mDecoder->GetResource();
resource->Pin();
if (NS_SUCCEEDED(resource->GetCachedRanges(ranges))) {
mDemuxer->ConvertByteRangesToTime(ranges, &timeRanges);
}
resource->Unpin();
MonitorAutoLock mon(mTimeRangesMonitor);
mTimeRanges = timeRanges;

View File

@ -86,6 +86,7 @@ private:
bool Decode(mp4_demuxer::TrackType aTrack);
void Flush(mp4_demuxer::TrackType aTrack);
void DrainComplete(mp4_demuxer::TrackType aTrack);
void UpdateIndex();
void NotifyResourcesStatusChanged();
bool IsWaitingOnCodecResource();
bool IsWaitingOnCDMResource();

View File

@ -136,16 +136,44 @@ WMFAudioMFTManager::Input(mp4_demuxer::MP4Sample* aSample)
return mDecoder->Input(data, length, aSample->composition_timestamp);
}
HRESULT
WMFAudioMFTManager::UpdateOutputType()
{
HRESULT hr;
RefPtr<IMFMediaType> type;
hr = mDecoder->GetOutputMediaType(type);
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
hr = type->GetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, &mAudioRate);
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
hr = type->GetUINT32(MF_MT_AUDIO_NUM_CHANNELS, &mAudioChannels);
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
return S_OK;
}
HRESULT
WMFAudioMFTManager::Output(int64_t aStreamOffset,
nsAutoPtr<MediaData>& aOutData)
{
aOutData = nullptr;
RefPtr<IMFSample> sample;
HRESULT hr = mDecoder->Output(&sample);
if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) {
return MF_E_TRANSFORM_NEED_MORE_INPUT;
HRESULT hr;
while (true) {
hr = mDecoder->Output(&sample);
if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) {
return hr;
}
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) {
hr = UpdateOutputType();
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
continue;
}
break;
}
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
RefPtr<IMFMediaBuffer> buffer;

View File

@ -31,12 +31,14 @@ public:
nsAutoPtr<MediaData>& aOutput) MOZ_OVERRIDE;
private:
HRESULT UpdateOutputType();
// IMFTransform wrapper that performs the decoding.
RefPtr<MFTDecoder> mDecoder;
const uint32_t mAudioChannels;
uint32_t mAudioChannels;
const uint32_t mAudioBytesPerSample;
const uint32_t mAudioRate;
uint32_t mAudioRate;
nsTArray<BYTE> mUserData;
// The offset, in audio frames, at which playback started since the

View File

@ -157,6 +157,7 @@ GMPChild::LoadPluginLibrary(const std::string& aPluginPath)
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
// Enable sandboxing here -- we know the plugin file's path, but
// this process's execution hasn't been affected by its content yet.
MOZ_ASSERT(mozilla::CanSandboxMediaPlugin());
mozilla::SetMediaPluginSandbox(nativePath.get());
#endif

View File

@ -20,6 +20,9 @@
#include "GMPDecryptorParent.h"
#include "GMPAudioDecoderParent.h"
#include "runnable_utils.h"
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
#include "mozilla/Sandbox.h"
#endif
namespace mozilla {
@ -453,6 +456,11 @@ NS_IMETHODIMP
GeckoMediaPluginService::AddPluginDirectory(const nsAString& aDirectory)
{
MOZ_ASSERT(NS_IsMainThread());
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
if (!mozilla::CanSandboxMediaPlugin()) {
return NS_ERROR_NOT_AVAILABLE;
}
#endif
nsCOMPtr<nsIThread> thread;
nsresult rv = GetThread(getter_AddRefs(thread));
if (NS_FAILED(rv)) {

View File

@ -264,7 +264,7 @@ public:
void TraceScriptObject(JSTracer* aTrc)
{
if (mScriptObject) {
JS_CallHeapScriptTracer(aTrc, &mScriptObject, "active window XUL prototype script");
JS_CallScriptTracer(aTrc, &mScriptObject, "active window XUL prototype script");
}
}

View File

@ -641,7 +641,7 @@ static PLDHashOperator
MarkScriptsInGC(nsIURI* aKey, JS::Heap<JSScript*>& aScript, void* aClosure)
{
JSTracer* trc = static_cast<JSTracer*>(aClosure);
JS_CallHeapScriptTracer(trc, &aScript, "nsXULPrototypeCache script");
JS_CallScriptTracer(trc, &aScript, "nsXULPrototypeCache script");
return PL_DHASH_NEXT;
}

View File

@ -32,7 +32,8 @@ protected:
public:
explicit AnimationPlayer(AnimationTimeline* aTimeline)
: mIsRunningOnCompositor(false)
: mPlayState(NS_STYLE_ANIMATION_PLAY_STATE_RUNNING)
, mIsRunningOnCompositor(false)
, mTimeline(aTimeline)
{
SetIsDOMBinding();

View File

@ -228,7 +228,7 @@ protected:
void TraceWrapper(JSTracer* aTrc, const char* name)
{
if (mWrapper) {
JS_CallHeapObjectTracer(aTrc, &mWrapper, name);
JS_CallObjectTracer(aTrc, &mWrapper, name);
}
}

View File

@ -55,7 +55,7 @@ nsWrapperCache::IsBlackAndDoesNotNeedTracing(nsISupports* aThis)
inline void
nsWrapperCache::TraceWrapperJSObject(JSTracer* aTrc, const char* aName)
{
JS_CallHeapObjectTracer(aTrc, &mWrapper, aName);
JS_CallObjectTracer(aTrc, &mWrapper, aName);
}
#endif /* nsWrapperCache_h___ */

View File

@ -325,7 +325,7 @@ class ProtoAndIfaceCache
void Trace(JSTracer* aTracer) {
for (size_t i = 0; i < ArrayLength(*this); ++i) {
if ((*this)[i]) {
JS_CallHeapObjectTracer(aTracer, &(*this)[i], "protoAndIfaceCache[i]");
JS_CallObjectTracer(aTracer, &(*this)[i], "protoAndIfaceCache[i]");
}
}
}
@ -386,7 +386,7 @@ class ProtoAndIfaceCache
if (p) {
for (size_t j = 0; j < ArrayLength(*p); ++j) {
if ((*p)[j]) {
JS_CallHeapObjectTracer(trc, &(*p)[j], "protoAndIfaceCache[i]");
JS_CallObjectTracer(trc, &(*p)[j], "protoAndIfaceCache[i]");
}
}
}
@ -1975,7 +1975,7 @@ class SequenceTracer<JSObject*, false, false, false>
public:
static void TraceSequence(JSTracer* trc, JSObject** objp, JSObject** end) {
for (; objp != end; ++objp) {
JS_CallObjectTracer(trc, objp, "sequence<object>");
JS_CallUnbarrieredObjectTracer(trc, objp, "sequence<object>");
}
}
};
@ -1989,7 +1989,7 @@ class SequenceTracer<JS::Value, false, false, false>
public:
static void TraceSequence(JSTracer* trc, JS::Value* valp, JS::Value* end) {
for (; valp != end; ++valp) {
JS_CallValueTracer(trc, valp, "sequence<any>");
JS_CallUnbarrieredValueTracer(trc, valp, "sequence<any>");
}
}
};

View File

@ -8534,7 +8534,7 @@ class CGUnionStruct(CGThing):
if t.isObject():
traceCases.append(
CGCase("e" + vars["name"],
CGGeneric('JS_CallObjectTracer(trc, %s, "%s");\n' %
CGGeneric('JS_CallUnbarrieredObjectTracer(trc, %s, "%s");\n' %
("&mValue.m" + vars["name"] + ".Value()",
"mValue.m" + vars["name"]))))
elif t.isDictionary():
@ -11427,12 +11427,12 @@ class CGDictionary(CGThing):
memberLoc)
if type.isObject():
trace = CGGeneric('JS_CallObjectTracer(trc, %s, "%s");\n' %
trace = CGGeneric('JS_CallUnbarrieredObjectTracer(trc, %s, "%s");\n' %
("&"+memberData, memberName))
if type.nullable():
trace = CGIfWrapper(trace, memberData)
elif type.isAny():
trace = CGGeneric('JS_CallValueTracer(trc, %s, "%s");\n' %
trace = CGGeneric('JS_CallUnbarrieredValueTracer(trc, %s, "%s");\n' %
("&"+memberData, memberName))
elif (type.isSequence() or type.isDictionary() or
type.isSpiderMonkeyInterface() or type.isUnion()):

View File

@ -45,10 +45,10 @@ public:
inline void TraceSelf(JSTracer* trc)
{
if (mTypedObj) {
JS_CallObjectTracer(trc, &mTypedObj, "TypedArray.mTypedObj");
JS_CallUnbarrieredObjectTracer(trc, &mTypedObj, "TypedArray.mTypedObj");
}
if (mWrappedObj) {
JS_CallObjectTracer(trc, &mTypedObj, "TypedArray.mWrappedObj");
JS_CallUnbarrieredObjectTracer(trc, &mTypedObj, "TypedArray.mWrappedObj");
}
}

View File

@ -922,7 +922,9 @@ ContentChild::RecvSetProcessSandbox()
// at some point; see bug 880808.
#if defined(MOZ_CONTENT_SANDBOX)
#if defined(XP_LINUX)
SetContentProcessSandbox();
if (CanSandboxContentProcess()) {
SetContentProcessSandbox();
}
#elif defined(XP_WIN)
mozilla::SandboxTarget::Instance()->StartSandbox();
#endif

View File

@ -514,7 +514,7 @@ Nfc.prototype = {
delete this.sessionTokenMap[this._currentSessionId];
this._currentSessionId = null;
this.currentPeerAppId = null;
gMessageManager.currentPeerAppId = null;
break;
case "ConfigResponse":
let target = this.targetsByRequestId[message.requestId];

View File

@ -952,7 +952,7 @@ JSObjWrapperKeyMarkCallback(JSTracer *trc, JSObject *obj, void *data) {
if (!p)
return;
JS_CallObjectTracer(trc, &obj, "sJSObjWrappers key object");
JS_CallUnbarrieredObjectTracer(trc, &obj, "sJSObjWrappers key object");
nsJSObjWrapperKey newKey(obj, npp);
sJSObjWrappers.rekeyIfMoved(oldKey, newKey);
}
@ -2122,18 +2122,18 @@ NPObjectMember_Trace(JSTracer *trc, JSObject *obj)
return;
// Our NPIdentifier is not always interned, so we must root it explicitly.
JS_CallHeapIdTracer(trc, &memberPrivate->methodName, "NPObjectMemberPrivate.methodName");
JS_CallIdTracer(trc, &memberPrivate->methodName, "NPObjectMemberPrivate.methodName");
if (!memberPrivate->fieldValue.isPrimitive()) {
JS_CallHeapValueTracer(trc, &memberPrivate->fieldValue,
"NPObject Member => fieldValue");
JS_CallValueTracer(trc, &memberPrivate->fieldValue,
"NPObject Member => fieldValue");
}
// There's no strong reference from our private data to the
// NPObject, so make sure to mark the NPObject wrapper to keep the
// NPObject alive as long as this NPObjectMember is alive.
if (memberPrivate->npobjWrapper) {
JS_CallHeapObjectTracer(trc, &memberPrivate->npobjWrapper,
"NPObject Member => npobjWrapper");
JS_CallObjectTracer(trc, &memberPrivate->npobjWrapper,
"NPObject Member => npobjWrapper");
}
}

View File

@ -262,29 +262,29 @@ WorkerRunnable::Run()
return NS_OK;
}
if (targetIsWorkerThread &&
mWorkerPrivate->AllPendingRunnablesShouldBeCanceled() &&
!IsCanceled() && !mCallingCancelWithinRun) {
// Prevent recursion.
mCallingCancelWithinRun = true;
Cancel();
MOZ_ASSERT(mCallingCancelWithinRun);
mCallingCancelWithinRun = false;
MOZ_ASSERT(IsCanceled(), "Subclass Cancel() didn't set IsCanceled()!");
return NS_OK;
}
// Track down the appropriate global to use for the AutoJSAPI/AutoEntryScript.
nsCOMPtr<nsIGlobalObject> globalObject;
bool isMainThread = !targetIsWorkerThread && !mWorkerPrivate->GetParent();
MOZ_ASSERT(isMainThread == NS_IsMainThread());
nsRefPtr<WorkerPrivate> kungFuDeathGrip;
if (targetIsWorkerThread) {
if (mWorkerPrivate->AllPendingRunnablesShouldBeCanceled() &&
!IsCanceled() &&
!mCallingCancelWithinRun) {
// Prevent recursion.
mCallingCancelWithinRun = true;
Cancel();
MOZ_ASSERT(mCallingCancelWithinRun);
mCallingCancelWithinRun = false;
MOZ_ASSERT(IsCanceled(), "Subclass Cancel() didn't set IsCanceled()!");
return NS_OK;
}
globalObject = mWorkerPrivate->GlobalScope();
}
else {

View File

@ -447,8 +447,8 @@ public:
private:
virtual void trace(JSTracer* aTrc)
{
JS_CallHeapValueTracer(aTrc, &mStateData->mResponse,
"XMLHttpRequest::StateData::mResponse");
JS_CallValueTracer(aTrc, &mStateData->mResponse,
"XMLHttpRequest::StateData::mResponse");
}
};

View File

@ -63,87 +63,87 @@ uint32_t GLContext::sDebugMode = 0;
// should match the order of GLExtensions, and be null-terminated.
static const char *sExtensionNames[] = {
"NO_EXTENSION",
"GL_EXT_framebuffer_object",
"GL_ARB_framebuffer_object",
"GL_ARB_texture_rectangle",
"GL_EXT_bgra",
"GL_EXT_texture_format_BGRA8888",
"GL_OES_depth24",
"GL_OES_depth32",
"GL_OES_stencil8",
"GL_OES_texture_npot",
"GL_IMG_texture_npot",
"GL_ARB_depth_texture",
"GL_OES_depth_texture",
"GL_OES_packed_depth_stencil",
"GL_IMG_read_format",
"GL_EXT_read_format_bgra",
"GL_APPLE_client_storage",
"GL_APPLE_texture_range",
"GL_ARB_texture_non_power_of_two",
"GL_ARB_pixel_buffer_object",
"GL_ARB_ES2_compatibility",
"GL_ARB_ES3_compatibility",
"GL_OES_texture_float",
"GL_OES_texture_float_linear",
"GL_ARB_texture_float",
"GL_OES_texture_half_float",
"GL_OES_texture_half_float_linear",
"GL_NV_half_float",
"GL_EXT_color_buffer_float",
"GL_EXT_color_buffer_half_float",
"GL_ARB_color_buffer_float",
"GL_EXT_unpack_subimage",
"GL_OES_standard_derivatives",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_compression_s3tc",
"GL_EXT_texture_compression_dxt1",
"GL_AMD_compressed_ATC_texture",
"GL_ANGLE_depth_texture",
"GL_ANGLE_framebuffer_blit",
"GL_ANGLE_framebuffer_multisample",
"GL_ANGLE_instanced_arrays",
"GL_ANGLE_texture_compression_dxt3",
"GL_ANGLE_texture_compression_dxt5",
"GL_AMD_compressed_ATC_texture",
"GL_IMG_texture_compression_pvrtc",
"GL_EXT_framebuffer_blit",
"GL_ANGLE_framebuffer_blit",
"GL_EXT_framebuffer_multisample",
"GL_ANGLE_framebuffer_multisample",
"GL_OES_rgb8_rgba8",
"GL_ARB_robustness",
"GL_EXT_robustness",
"GL_ARB_sync",
"GL_OES_EGL_image",
"GL_OES_EGL_sync",
"GL_OES_EGL_image_external",
"GL_EXT_packed_depth_stencil",
"GL_OES_element_index_uint",
"GL_OES_vertex_array_object",
"GL_ARB_vertex_array_object",
"GL_APPLE_client_storage",
"GL_APPLE_texture_range",
"GL_APPLE_vertex_array_object",
"GL_ARB_ES2_compatibility",
"GL_ARB_ES3_compatibility",
"GL_ARB_color_buffer_float",
"GL_ARB_depth_texture",
"GL_ARB_draw_buffers",
"GL_EXT_draw_buffers",
"GL_EXT_gpu_shader4",
"GL_EXT_blend_minmax",
"GL_ARB_draw_instanced",
"GL_EXT_draw_instanced",
"GL_NV_draw_instanced",
"GL_ARB_instanced_arrays",
"GL_NV_instanced_arrays",
"GL_ANGLE_instanced_arrays",
"GL_EXT_occlusion_query_boolean",
"GL_ARB_occlusion_query2",
"GL_EXT_transform_feedback",
"GL_NV_transform_feedback",
"GL_ANGLE_depth_texture",
"GL_EXT_sRGB",
"GL_EXT_texture_sRGB",
"GL_ARB_framebuffer_object",
"GL_ARB_framebuffer_sRGB",
"GL_EXT_framebuffer_sRGB",
"GL_KHR_debug",
"GL_ARB_half_float_pixel",
"GL_EXT_frag_depth",
"GL_OES_compressed_ETC1_RGB8_texture",
"GL_ARB_instanced_arrays",
"GL_ARB_occlusion_query2",
"GL_ARB_pixel_buffer_object",
"GL_ARB_robustness",
"GL_ARB_sync",
"GL_ARB_texture_float",
"GL_ARB_texture_non_power_of_two",
"GL_ARB_texture_rectangle",
"GL_ARB_vertex_array_object",
"GL_EXT_bgra",
"GL_EXT_blend_minmax",
"GL_EXT_color_buffer_float",
"GL_EXT_color_buffer_half_float",
"GL_EXT_draw_buffers",
"GL_EXT_draw_instanced",
"GL_EXT_draw_range_elements",
"GL_EXT_frag_depth",
"GL_EXT_framebuffer_blit",
"GL_EXT_framebuffer_multisample",
"GL_EXT_framebuffer_object",
"GL_EXT_framebuffer_sRGB",
"GL_EXT_gpu_shader4",
"GL_EXT_occlusion_query_boolean",
"GL_EXT_packed_depth_stencil",
"GL_EXT_read_format_bgra",
"GL_EXT_robustness",
"GL_EXT_sRGB",
"GL_EXT_shader_texture_lod",
"GL_EXT_texture_compression_dxt1",
"GL_EXT_texture_compression_s3tc",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_format_BGRA8888",
"GL_EXT_texture_sRGB",
"GL_EXT_transform_feedback",
"GL_EXT_unpack_subimage",
"GL_IMG_read_format",
"GL_IMG_texture_compression_pvrtc",
"GL_IMG_texture_npot",
"GL_KHR_debug",
"GL_NV_draw_instanced",
"GL_NV_fence",
"GL_NV_half_float",
"GL_NV_instanced_arrays",
"GL_NV_transform_feedback",
"GL_OES_EGL_image",
"GL_OES_EGL_image_external",
"GL_OES_EGL_sync",
"GL_OES_compressed_ETC1_RGB8_texture",
"GL_OES_depth24",
"GL_OES_depth32",
"GL_OES_depth_texture",
"GL_OES_element_index_uint",
"GL_OES_packed_depth_stencil",
"GL_OES_rgb8_rgba8",
"GL_OES_standard_derivatives",
"GL_OES_stencil8",
"GL_OES_texture_float",
"GL_OES_texture_float_linear",
"GL_OES_texture_half_float",
"GL_OES_texture_half_float_linear",
"GL_OES_texture_npot",
"GL_OES_vertex_array_object",
nullptr
};

View File

@ -332,87 +332,87 @@ public:
*/
enum GLExtensions {
Extension_None = 0,
EXT_framebuffer_object,
ARB_framebuffer_object,
ARB_texture_rectangle,
EXT_bgra,
EXT_texture_format_BGRA8888,
OES_depth24,
OES_depth32,
OES_stencil8,
OES_texture_npot,
IMG_texture_npot,
ARB_depth_texture,
OES_depth_texture,
OES_packed_depth_stencil,
IMG_read_format,
EXT_read_format_bgra,
APPLE_client_storage,
APPLE_texture_range,
ARB_texture_non_power_of_two,
ARB_pixel_buffer_object,
ARB_ES2_compatibility,
ARB_ES3_compatibility,
OES_texture_float,
OES_texture_float_linear,
ARB_texture_float,
OES_texture_half_float,
OES_texture_half_float_linear,
NV_half_float,
EXT_color_buffer_float,
EXT_color_buffer_half_float,
ARB_color_buffer_float,
EXT_unpack_subimage,
OES_standard_derivatives,
EXT_texture_filter_anisotropic,
EXT_texture_compression_s3tc,
EXT_texture_compression_dxt1,
AMD_compressed_ATC_texture,
ANGLE_depth_texture,
ANGLE_framebuffer_blit,
ANGLE_framebuffer_multisample,
ANGLE_instanced_arrays,
ANGLE_texture_compression_dxt3,
ANGLE_texture_compression_dxt5,
AMD_compressed_ATC_texture,
IMG_texture_compression_pvrtc,
EXT_framebuffer_blit,
ANGLE_framebuffer_blit,
EXT_framebuffer_multisample,
ANGLE_framebuffer_multisample,
OES_rgb8_rgba8,
ARB_robustness,
EXT_robustness,
ARB_sync,
OES_EGL_image,
OES_EGL_sync,
OES_EGL_image_external,
EXT_packed_depth_stencil,
OES_element_index_uint,
OES_vertex_array_object,
ARB_vertex_array_object,
APPLE_client_storage,
APPLE_texture_range,
APPLE_vertex_array_object,
ARB_ES2_compatibility,
ARB_ES3_compatibility,
ARB_color_buffer_float,
ARB_depth_texture,
ARB_draw_buffers,
EXT_draw_buffers,
EXT_gpu_shader4,
EXT_blend_minmax,
ARB_draw_instanced,
EXT_draw_instanced,
NV_draw_instanced,
ARB_instanced_arrays,
NV_instanced_arrays,
ANGLE_instanced_arrays,
EXT_occlusion_query_boolean,
ARB_occlusion_query2,
EXT_transform_feedback,
NV_transform_feedback,
ANGLE_depth_texture,
EXT_sRGB,
EXT_texture_sRGB,
ARB_framebuffer_object,
ARB_framebuffer_sRGB,
EXT_framebuffer_sRGB,
KHR_debug,
ARB_half_float_pixel,
EXT_frag_depth,
OES_compressed_ETC1_RGB8_texture,
ARB_instanced_arrays,
ARB_occlusion_query2,
ARB_pixel_buffer_object,
ARB_robustness,
ARB_sync,
ARB_texture_float,
ARB_texture_non_power_of_two,
ARB_texture_rectangle,
ARB_vertex_array_object,
EXT_bgra,
EXT_blend_minmax,
EXT_color_buffer_float,
EXT_color_buffer_half_float,
EXT_draw_buffers,
EXT_draw_instanced,
EXT_draw_range_elements,
EXT_frag_depth,
EXT_framebuffer_blit,
EXT_framebuffer_multisample,
EXT_framebuffer_object,
EXT_framebuffer_sRGB,
EXT_gpu_shader4,
EXT_occlusion_query_boolean,
EXT_packed_depth_stencil,
EXT_read_format_bgra,
EXT_robustness,
EXT_sRGB,
EXT_shader_texture_lod,
EXT_texture_compression_dxt1,
EXT_texture_compression_s3tc,
EXT_texture_filter_anisotropic,
EXT_texture_format_BGRA8888,
EXT_texture_sRGB,
EXT_transform_feedback,
EXT_unpack_subimage,
IMG_read_format,
IMG_texture_compression_pvrtc,
IMG_texture_npot,
KHR_debug,
NV_draw_instanced,
NV_fence,
NV_half_float,
NV_instanced_arrays,
NV_transform_feedback,
OES_EGL_image,
OES_EGL_image_external,
OES_EGL_sync,
OES_compressed_ETC1_RGB8_texture,
OES_depth24,
OES_depth32,
OES_depth_texture,
OES_element_index_uint,
OES_packed_depth_stencil,
OES_rgb8_rgba8,
OES_standard_derivatives,
OES_stencil8,
OES_texture_float,
OES_texture_float_linear,
OES_texture_half_float,
OES_texture_half_float_linear,
OES_texture_npot,
OES_vertex_array_object,
Extensions_Max,
Extensions_End
};

View File

@ -70,7 +70,7 @@ static const uint8_t joining_table[] =
/* Mandaic */
/* 0840 */ R,D,D,D,D,D,R,D,D,R,D,D,D,D,D,R,D,D,D,D,R,D,U,U,U,X,X,X,X,X,X,X,
/* 0840 */ R,D,D,D,D,D,R,R,D,R,D,D,D,D,D,D,D,D,D,D,R,D,U,U,U,X,X,X,X,X,X,X,
/* 0860 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 0880 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,

View File

@ -402,8 +402,8 @@ public:
{
return mScrollId;
}
void SetScrollId(ViewID scrollId)
void SetScrollId(ViewID scrollId)
{
mScrollId = scrollId;
}
@ -539,6 +539,14 @@ struct ScrollableLayerGuid {
MOZ_COUNT_CTOR(ScrollableLayerGuid);
}
ScrollableLayerGuid(const ScrollableLayerGuid& other)
: mLayersId(other.mLayersId)
, mPresShellId(other.mPresShellId)
, mScrollId(other.mScrollId)
{
MOZ_COUNT_CTOR(ScrollableLayerGuid);
}
~ScrollableLayerGuid()
{
MOZ_COUNT_DTOR(ScrollableLayerGuid);
@ -587,6 +595,15 @@ struct ZoomConstraints {
MOZ_COUNT_CTOR(ZoomConstraints);
}
ZoomConstraints(const ZoomConstraints& other)
: mAllowZoom(other.mAllowZoom)
, mAllowDoubleTapZoom(other.mAllowDoubleTapZoom)
, mMinZoom(other.mMinZoom)
, mMaxZoom(other.mMaxZoom)
{
MOZ_COUNT_CTOR(ZoomConstraints);
}
~ZoomConstraints()
{
MOZ_COUNT_DTOR(ZoomConstraints);

View File

@ -137,7 +137,7 @@ typedef mozilla::gfx::Matrix4x4 Matrix4x4;
* The following prefs are used to control the behaviour of the APZC.
* The default values are provided in gfxPrefs.h.
*
* "apz.allow-checkerboarding"
* "apz.allow_checkerboarding"
* Pref that allows or disallows checkerboarding
*
* "apz.asyncscroll.throttle"

View File

@ -1059,7 +1059,12 @@ CompositorOGL::DrawQuad(const Rect& aRect,
maskType = MaskType::MaskNone;
}
mPixelsFilled += aRect.width * aRect.height;
{
// XXX: This doesn't handle 3D transforms. It also doesn't handled rotated
// quads. Fix me.
const Rect destRect = aTransform.TransformBounds(aRect);
mPixelsFilled += destRect.width * destRect.height;
}
// Determine the color if this is a color shader and fold the opacity into
// the color since color shaders don't have an opacity uniform.

View File

@ -142,6 +142,7 @@ if CONFIG['GNU_CXX']:
CXXFLAGS += [
'-Wno-overloaded-virtual',
'-Wno-unused-function',
'-fomit-frame-pointer',
]
if not CONFIG['CLANG_CXX']:
CXXFLAGS += ['-Wno-logical-op']

View File

@ -970,6 +970,7 @@ if CONFIG['GNU_CXX']:
CXXFLAGS += [
'-Wno-overloaded-virtual',
'-Wno-unused-function',
'-fomit-frame-pointer',
]
if not CONFIG['CLANG_CXX']:
CXXFLAGS += ['-Wno-logical-op']

View File

@ -129,7 +129,7 @@ private:
// a method accessing a pref already exists. Just add yours in the list.
// The apz prefs are explained in AsyncPanZoomController.cpp
DECL_GFX_PREF(Live, "apz.allow-checkerboarding", APZAllowCheckerboarding, bool, true);
DECL_GFX_PREF(Live, "apz.allow_checkerboarding", APZAllowCheckerboarding, bool, true);
DECL_GFX_PREF(Live, "apz.asyncscroll.throttle", APZAsyncScrollThrottleTime, int32_t, 100);
DECL_GFX_PREF(Live, "apz.asyncscroll.timeout", APZAsyncScrollTimeout, int32_t, 300);
DECL_GFX_PREF(Live, "apz.axis_lock_mode", APZAxisLockMode, int32_t, 0);

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-0.5 -0.5 53 43" stroke="#000000">
<rect x="0" y="7" width="52" height="35" fill="#ffffff"/>
</svg>

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="1.0" class="reftest-wait">
<head>
<script>
function snapshot() {
document.documentElement.removeAttribute('class');
}
</script>
</head>
<!-- NOTE: Using setTimeout to wait for high-quality downscaled version of
image to be ready, because there's nothing better we can do. If we fix
Bug 1006883, we can do away with this setTimeout.
For now, the setTimeout is just here to increase the likelihood that we
actually test the high-quality downscaled version of the image. If the
setTimeout happens to fire before the high-quality downscaled rendering is
ready, then this the test will pass without testing what it's trying to
test, which is fine as long as that's rare. -->
<body style="margin: 0px" onload="setTimeout(snapshot, 50)">
<script>
var args = location.search.substring(1).split(',');
var image = document.createElement('img');
image.width = args[0];
image.height = args[1];
image.src = 'black-border-' + args[2] + '.png';
document.body.appendChild(image);
</script>
</body>
</html>

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.9" class="reftest-wait">
<head>
<script>
function snapshot() {
document.documentElement.removeAttribute('class');
}
</script>
</head>
<!-- NOTE: Using setTimeout to wait for high-quality downscaled version of
image to be ready, because there's nothing better we can do. If we fix
Bug 1006883, we can do away with this setTimeout.
For now, the setTimeout is just here to increase the likelihood that we
actually test the high-quality downscaled version of the image. If the
setTimeout happens to fire before the high-quality downscaled rendering is
ready, then this the test will pass without testing what it's trying to
test, which is fine as long as that's rare. -->
<body style="margin: 0px" onload="setTimeout(snapshot, 50)">
<script>
var args = location.search.substring(1).split(',');
var image = document.createElement('img');
image.width = args[0];
image.height = args[1];
image.src = 'black-border-' + args[2] + '.png';
document.body.appendChild(image);
</script>
</body>
</html>

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.8" class="reftest-wait">
<head>
<script>
function snapshot() {
document.documentElement.removeAttribute('class');
}
</script>
</head>
<!-- NOTE: Using setTimeout to wait for high-quality downscaled version of
image to be ready, because there's nothing better we can do. If we fix
Bug 1006883, we can do away with this setTimeout.
For now, the setTimeout is just here to increase the likelihood that we
actually test the high-quality downscaled version of the image. If the
setTimeout happens to fire before the high-quality downscaled rendering is
ready, then this the test will pass without testing what it's trying to
test, which is fine as long as that's rare. -->
<body style="margin: 0px" onload="setTimeout(snapshot, 50)">
<script>
var args = location.search.substring(1).split(',');
var image = document.createElement('img');
image.width = args[0];
image.height = args[1];
image.src = 'black-border-' + args[2] + '.png';
document.body.appendChild(image);
</script>
</body>
</html>

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.67" class="reftest-wait">
<head>
<script>
function snapshot() {
document.documentElement.removeAttribute('class');
}
</script>
</head>
<!-- NOTE: Using setTimeout to wait for high-quality downscaled version of
image to be ready, because there's nothing better we can do. If we fix
Bug 1006883, we can do away with this setTimeout.
For now, the setTimeout is just here to increase the likelihood that we
actually test the high-quality downscaled version of the image. If the
setTimeout happens to fire before the high-quality downscaled rendering is
ready, then this the test will pass without testing what it's trying to
test, which is fine as long as that's rare. -->
<body style="margin: 0px" onload="setTimeout(snapshot, 50)">
<script>
var args = location.search.substring(1).split(',');
var image = document.createElement('img');
image.width = args[0];
image.height = args[1];
image.src = 'black-border-' + args[2] + '.png';
document.body.appendChild(image);
</script>
</body>
</html>

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.5" class="reftest-wait">
<head>
<script>
function snapshot() {
document.documentElement.removeAttribute('class');
}
</script>
</head>
<!-- NOTE: Using setTimeout to wait for high-quality downscaled version of
image to be ready, because there's nothing better we can do. If we fix
Bug 1006883, we can do away with this setTimeout.
For now, the setTimeout is just here to increase the likelihood that we
actually test the high-quality downscaled version of the image. If the
setTimeout happens to fire before the high-quality downscaled rendering is
ready, then this the test will pass without testing what it's trying to
test, which is fine as long as that's rare. -->
<body style="margin: 0px" onload="setTimeout(snapshot, 50)">
<script>
var args = location.search.substring(1).split(',');
var image = document.createElement('img');
image.width = args[0];
image.height = args[1];
image.src = 'black-border-' + args[2] + '.png';
document.body.appendChild(image);
</script>
</body>
</html>

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.3" class="reftest-wait">
<head>
<script>
function snapshot() {
document.documentElement.removeAttribute('class');
}
</script>
</head>
<!-- NOTE: Using setTimeout to wait for high-quality downscaled version of
image to be ready, because there's nothing better we can do. If we fix
Bug 1006883, we can do away with this setTimeout.
For now, the setTimeout is just here to increase the likelihood that we
actually test the high-quality downscaled version of the image. If the
setTimeout happens to fire before the high-quality downscaled rendering is
ready, then this the test will pass without testing what it's trying to
test, which is fine as long as that's rare. -->
<body style="margin: 0px" onload="setTimeout(snapshot, 50)">
<script>
var args = location.search.substring(1).split(',');
var image = document.createElement('img');
image.width = args[0];
image.height = args[1];
image.src = 'black-border-' + args[2] + '.png';
document.body.appendChild(image);
</script>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<body style="margin: 0px">
<embed src="black-border-rect.svg" style="display: block">
<script>
var width = location.search.substring(1).split("&");
var embedElem = document.getElementsByTagName('embed')[0];
embedElem.style.width = width + 'px';
</script>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="1.0">
<body style="margin: 0px">
<div style="width: 80px; height: 80px; background: url(black-border-rect.svg) no-repeat"></div>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.9">
<body style="margin: 0px">
<div style="width: 80px; height: 80px; background: url(black-border-rect.svg) no-repeat"></div>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.8">
<body style="margin: 0px">
<div style="width: 80px; height: 80px; background: url(black-border-rect.svg) no-repeat"></div>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.67">
<body style="margin: 0px">
<div style="width: 80px; height: 80px; background: url(black-border-rect.svg) no-repeat"></div>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.5">
<body style="margin: 0px">
<div style="width: 80px; height: 80px; background: url(black-border-rect.svg) no-repeat"></div>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html reftest-zoom="0.3">
<body style="margin: 0px">
<div style="width: 80px; height: 80px; background: url(black-border-rect.svg) no-repeat"></div>
</body>
</html>

View File

@ -4,6 +4,14 @@
# as long as it's barely noticable visually. When necessary, this can be
# explicitly allowed via 'fuzzy'/'fuzzy-if' annotations.
#
# Many of these tests check primarily that we don't lose rows or columns of
# pixels when downscaling by making sure that the result isn't too similar to
# about:blank. A small amount of fuzziness is used to ensure that the tests
# don't pass because of very slight deviations; passing tests should be
# substantially different from about:blank. This fuzziness should *not* be
# removed as doing so would make the tests pass in situations where they
# shouldn't.
#
# IMPORTANT: For robustness, each test should be listed *twice* in this
# manifest -- once with the high quality downscaling pref disabled, and once
# with this pref enabled. The pref is set via "default-preferences", so
@ -13,12 +21,77 @@
# Also note that Mac OS X has its own system-level downscaling algorithm, so
# tests here may need Mac-specific "fuzzy-if(cocoaWidget,...)" annotations.
# RUN TESTS NOT AFFECTED BY HIGH QUALITY DOWNSCALING:
# ===================================================
fails == downscale-svg-1a.html downscale-svg-1-ref.html?80
fails == downscale-svg-1b.html downscale-svg-1-ref.html?72
fails == downscale-svg-1c.html downscale-svg-1-ref.html?64
fails == downscale-svg-1d.html downscale-svg-1-ref.html?53
fails == downscale-svg-1e.html downscale-svg-1-ref.html?40
fails == downscale-svg-1f.html downscale-svg-1-ref.html?24
# RUN TESTS WITH HIGH QUALITY DOWNSCALING DISABLED:
# =================================================
default-preferences pref(image.high_quality_downscaling.enabled,false)
fuzzy-if(cocoaWidget,106,31) == downscale-1.html downscale-1-ref.html
fuzzy(5,999) random != downscale-2a.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2b.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2c.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2d.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2e.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2f.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2a.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2b.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2c.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2d.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2e.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2f.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2a.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2b.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2c.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2d.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2e.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2f.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2a.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2b.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2c.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2d.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2e.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2f.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2a.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2b.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2c.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2d.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2e.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2f.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2a.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2b.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2c.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2d.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2e.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2f.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2a.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2b.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2c.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2d.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2e.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2f.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2a.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2b.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2c.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2d.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2e.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2f.html?205,53,bottom about:blank
# RUN TESTS WITH HIGH QUALITY DOWNSCALING ENABLED:
# ================================================
@ -26,3 +99,59 @@ fuzzy-if(cocoaWidget,106,31) == downscale-1.html downscale-1-ref.html
default-preferences pref(image.high_quality_downscaling.enabled,true)
fuzzy(31,127) == downscale-1.html downscale-1-ref.html
fuzzy(5,999) random != downscale-2a.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2b.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2c.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2d.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2e.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2f.html?203,52,left about:blank
fuzzy(5,999) random != downscale-2a.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2b.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2c.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2d.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2e.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2f.html?205,53,left about:blank
fuzzy(5,999) random != downscale-2a.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2b.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2c.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2d.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2e.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2f.html?203,52,right about:blank
fuzzy(5,999) random != downscale-2a.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2b.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2c.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2d.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2e.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2f.html?205,53,right about:blank
fuzzy(5,999) random != downscale-2a.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2b.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2c.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2d.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2e.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2f.html?203,52,top about:blank
fuzzy(5,999) random != downscale-2a.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2b.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2c.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2d.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2e.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2f.html?205,53,top about:blank
fuzzy(5,999) random != downscale-2a.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2b.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2c.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2d.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2e.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2f.html?203,52,bottom about:blank
fuzzy(5,999) random != downscale-2a.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2b.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2c.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2d.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2e.html?205,53,bottom about:blank
fuzzy(5,999) random != downscale-2f.html?205,53,bottom about:blank

View File

@ -16,9 +16,6 @@
namespace {
// We send a byte across a pipe to wakeup the event loop.
const char kWorkScheduled = '\0';
// Return a timeout suitable for the glib loop, -1 to block forever,
// 0 to return right away, or a timeout in milliseconds from now.
int GetTimeIntervalMilliseconds(const base::TimeTicks& from) {

View File

@ -14,6 +14,7 @@
#include "nsServiceManagerUtils.h"
#include "nsString.h"
#include "nsIXULAppInfo.h"
#include "WinUtils.h"
#include "mozilla/PaintTracker.h"
@ -169,10 +170,31 @@ static void
DumpNeuteredMessage(HWND hwnd, UINT uMsg)
{
#ifdef DEBUG
nsAutoCString log("Received \"nonqueued\" message ");
log.AppendInt(uMsg);
nsAutoCString log("Received \"nonqueued\" ");
// classify messages
if (uMsg < WM_USER) {
int idx = 0;
while (mozilla::widget::gAllEvents[idx].mId != (long)uMsg &&
mozilla::widget::gAllEvents[idx].mStr != nullptr) {
idx++;
}
if (mozilla::widget::gAllEvents[idx].mStr) {
log.AppendPrintf("ui message \"%s\"", mozilla::widget::gAllEvents[idx].mStr);
} else {
log.AppendPrintf("ui message (0x%X)", uMsg);
}
} else if (uMsg >= WM_USER && uMsg < WM_APP) {
log.AppendPrintf("WM_USER message (0x%X)", uMsg);
} else if (uMsg >= WM_APP && uMsg < 0xC000) {
log.AppendPrintf("WM_APP message (0x%X)", uMsg);
} else if (uMsg >= 0xC000 && uMsg < 0x10000) {
log.AppendPrintf("registered windows message (0x%X)", uMsg);
} else {
log.AppendPrintf("system message (0x%X)", uMsg);
}
log.AppendLiteral(" during a synchronous IPC message for window ");
log.AppendInt((int64_t)hwnd);
log.AppendPrintf("0x%X", hwnd);
wchar_t className[256] = { 0 };
if (GetClassNameW(hwnd, className, sizeof(className) - 1) > 0) {
@ -296,7 +318,8 @@ ProcessOrDeferMessage(HWND hwnd,
case WM_GETTEXT:
case WM_NCHITTEST:
case WM_STYLECHANGING: // Intentional fall-through.
case WM_WINDOWPOSCHANGING: {
case WM_WINDOWPOSCHANGING:
case WM_GETTEXTLENGTH: {
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}

View File

@ -35,7 +35,7 @@ IdToObjectMap::trace(JSTracer *trc)
{
for (Table::Range r(table_.all()); !r.empty(); r.popFront()) {
DebugOnly<JSObject *> prior = r.front().value().get();
JS_CallHeapObjectTracer(trc, &r.front().value(), "ipc-object");
JS_CallObjectTracer(trc, &r.front().value(), "ipc-object");
MOZ_ASSERT(r.front().value() == prior);
}
}
@ -135,7 +135,7 @@ ObjectToIdMap::keyMarkCallback(JSTracer *trc, JSObject *key, void *data)
{
Table *table = static_cast<Table*>(data);
JSObject *prior = key;
JS_CallObjectTracer(trc, &key, "ObjectIdCache::table_ key");
JS_CallUnbarrieredObjectTracer(trc, &key, "ObjectIdCache::table_ key");
table->rekeyIfMoved(prior, key);
}

View File

@ -155,37 +155,40 @@ class JS_PUBLIC_API(JSTracer)
// and re-inserted with the correct hash.
//
extern JS_PUBLIC_API(void)
JS_CallValueTracer(JSTracer *trc, JS::Value *valuep, const char *name);
JS_CallValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name);
extern JS_PUBLIC_API(void)
JS_CallIdTracer(JSTracer *trc, jsid *idp, const char *name);
JS_CallIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name);
extern JS_PUBLIC_API(void)
JS_CallObjectTracer(JSTracer *trc, JSObject **objp, const char *name);
JS_CallObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name);
extern JS_PUBLIC_API(void)
JS_CallStringTracer(JSTracer *trc, JSString **strp, const char *name);
JS_CallStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name);
extern JS_PUBLIC_API(void)
JS_CallScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name);
JS_CallScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name);
extern JS_PUBLIC_API(void)
JS_CallHeapValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name);
JS_CallFunctionTracer(JSTracer *trc, JS::Heap<JSFunction *> *funp, const char *name);
// The following JS_CallUnbarriered*Tracer functions should only be called where
// you know for sure that a heap post barrier is not required. Use with extreme
// caution!
extern JS_PUBLIC_API(void)
JS_CallUnbarrieredValueTracer(JSTracer *trc, JS::Value *valuep, const char *name);
extern JS_PUBLIC_API(void)
JS_CallHeapIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name);
JS_CallUnbarrieredIdTracer(JSTracer *trc, jsid *idp, const char *name);
extern JS_PUBLIC_API(void)
JS_CallHeapObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name);
JS_CallUnbarrieredObjectTracer(JSTracer *trc, JSObject **objp, const char *name);
extern JS_PUBLIC_API(void)
JS_CallHeapStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name);
JS_CallUnbarrieredStringTracer(JSTracer *trc, JSString **strp, const char *name);
extern JS_PUBLIC_API(void)
JS_CallHeapScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name);
extern JS_PUBLIC_API(void)
JS_CallHeapFunctionTracer(JSTracer *trc, JS::Heap<JSFunction *> *funp, const char *name);
JS_CallUnbarrieredScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name);
template <typename HashSetEnum>
inline void
@ -193,7 +196,7 @@ JS_CallHashSetObjectTracer(JSTracer *trc, HashSetEnum &e, JSObject *const &key,
{
JSObject *updated = key;
trc->setTracingLocation(reinterpret_cast<void *>(&const_cast<JSObject *&>(key)));
JS_CallObjectTracer(trc, &updated, name);
JS_CallUnbarrieredObjectTracer(trc, &updated, name);
if (updated != key)
e.rekeyFront(key, updated);
}

View File

@ -288,6 +288,7 @@ private:
OP2_MOVPS_VpsWps = 0x10,
OP2_MOVSD_WsdVsd = 0x11,
OP2_MOVPS_WpsVps = 0x11,
OP2_MOVHLPS_VqUq = 0x12,
OP2_UNPCKLPS_VsdWsd = 0x14,
OP2_MOVAPD_VsdWsd = 0x28,
OP2_MOVAPS_VsdWsd = 0x28,
@ -312,6 +313,7 @@ private:
OP2_MOVD_VdEd = 0x6E,
OP2_MOVDQ_VsdWsd = 0x6F,
OP2_MOVDQ_VdqWdq = 0x6F,
OP2_PSHUFD_VdqWdqIb = 0x70,
OP2_PSRLDQ_Vd = 0x73,
OP2_PCMPEQW = 0x75,
OP2_MOVD_EdVd = 0x7E,
@ -325,7 +327,8 @@ private:
OP2_MOVZX_GvEb = 0xB6,
OP2_MOVZX_GvEw = 0xB7,
OP2_XADD_EvGv = 0xC1,
OP2_PEXTRW_GdUdIb = 0xC5
OP2_PEXTRW_GdUdIb = 0xC5,
OP2_SHUFPS_VpsWpsIb = 0xC6
} TwoByteOpcodeID;
typedef enum {
@ -2587,6 +2590,32 @@ public:
m_formatter.twoByteOp(OP2_MOVD_VdEd, (RegisterID)dst, src);
}
void pshufd_irr(uint32_t mask, XMMRegisterID src, XMMRegisterID dst)
{
JS_ASSERT(mask < 256);
spew("pshufd 0x%x, %s, %s",
mask, nameFPReg(src), nameFPReg(dst));
m_formatter.prefix(PRE_SSE_66);
m_formatter.twoByteOp(OP2_PSHUFD_VdqWdqIb, (RegisterID)dst, (RegisterID)src);
m_formatter.immediate8(uint8_t(mask));
}
void shufps_irr(uint32_t mask, XMMRegisterID src, XMMRegisterID dst)
{
JS_ASSERT(mask < 256);
spew("shufps 0x%x, %s, %s",
mask, nameFPReg(src), nameFPReg(dst));
m_formatter.twoByteOp(OP2_SHUFPS_VpsWpsIb, (RegisterID)dst, (RegisterID)src);
m_formatter.immediate8(uint8_t(mask));
}
void movhlps_rr(XMMRegisterID src, XMMRegisterID dst)
{
spew("movhlps %s, %s",
nameFPReg(src), nameFPReg(dst));
m_formatter.twoByteOp(OP2_MOVHLPS_VqUq, (RegisterID)dst, (RegisterID)src);
}
void psrldq_ir(int shift, XMMRegisterID dest)
{
spew("psrldq $%d, %s",

View File

@ -829,7 +829,7 @@ CountHeap(JSContext *cx, unsigned argc, jsval *vp)
if (startValue.isUndefined()) {
JS_TraceRuntime(&countTracer.base);
} else {
JS_CallValueTracer(&countTracer.base, startValue.address(), "root");
JS_CallUnbarrieredValueTracer(&countTracer.base, startValue.address(), "root");
}
JSCountHeapNode *node;

View File

@ -3400,10 +3400,10 @@ CType::Trace(JSTracer* trc, JSObject* obj)
FieldInfoHash* fields = static_cast<FieldInfoHash*>(slot.toPrivate());
for (FieldInfoHash::Enum e(*fields); !e.empty(); e.popFront()) {
JSString *key = e.front().key();
JS_CallStringTracer(trc, &key, "fieldName");
JS_CallUnbarrieredStringTracer(trc, &key, "fieldName");
if (key != e.front().key())
e.rekeyFront(JS_ASSERT_STRING_IS_FLAT(key));
JS_CallHeapObjectTracer(trc, &e.front().value().mType, "fieldType");
JS_CallObjectTracer(trc, &e.front().value().mType, "fieldType");
}
break;
@ -3418,10 +3418,10 @@ CType::Trace(JSTracer* trc, JSObject* obj)
JS_ASSERT(fninfo);
// Identify our objects to the tracer.
JS_CallHeapObjectTracer(trc, &fninfo->mABI, "abi");
JS_CallHeapObjectTracer(trc, &fninfo->mReturnType, "returnType");
JS_CallObjectTracer(trc, &fninfo->mABI, "abi");
JS_CallObjectTracer(trc, &fninfo->mReturnType, "returnType");
for (size_t i = 0; i < fninfo->mArgTypes.length(); ++i)
JS_CallHeapObjectTracer(trc, &fninfo->mArgTypes[i], "argType");
JS_CallObjectTracer(trc, &fninfo->mArgTypes[i], "argType");
break;
}
@ -4818,7 +4818,7 @@ PostBarrierCallback(JSTracer *trc, JSString *key, void *data)
UnbarrieredFieldInfoHash *table = reinterpret_cast<UnbarrieredFieldInfoHash*>(data);
JSString *prior = key;
JS_CallStringTracer(trc, &key, "CType fieldName");
JS_CallUnbarrieredStringTracer(trc, &key, "CType fieldName");
table->rekeyIfMoved(JS_ASSERT_STRING_IS_FLAT(prior), JS_ASSERT_STRING_IS_FLAT(key));
}
@ -6152,10 +6152,10 @@ CClosure::Trace(JSTracer* trc, JSObject* obj)
// Identify our objects to the tracer. (There's no need to identify
// 'closureObj', since that's us.)
JS_CallHeapObjectTracer(trc, &cinfo->typeObj, "typeObj");
JS_CallHeapObjectTracer(trc, &cinfo->jsfnObj, "jsfnObj");
JS_CallObjectTracer(trc, &cinfo->typeObj, "typeObj");
JS_CallObjectTracer(trc, &cinfo->jsfnObj, "jsfnObj");
if (cinfo->thisObj)
JS_CallHeapObjectTracer(trc, &cinfo->thisObj, "thisObj");
JS_CallObjectTracer(trc, &cinfo->thisObj, "thisObj");
}
void

View File

@ -28,67 +28,67 @@ using namespace js::gc;
using mozilla::DebugOnly;
JS_PUBLIC_API(void)
JS_CallValueTracer(JSTracer *trc, Value *valuep, const char *name)
JS_CallUnbarrieredValueTracer(JSTracer *trc, Value *valuep, const char *name)
{
MarkValueUnbarriered(trc, valuep, name);
}
JS_PUBLIC_API(void)
JS_CallIdTracer(JSTracer *trc, jsid *idp, const char *name)
JS_CallUnbarrieredIdTracer(JSTracer *trc, jsid *idp, const char *name)
{
MarkIdUnbarriered(trc, idp, name);
}
JS_PUBLIC_API(void)
JS_CallObjectTracer(JSTracer *trc, JSObject **objp, const char *name)
JS_CallUnbarrieredObjectTracer(JSTracer *trc, JSObject **objp, const char *name)
{
MarkObjectUnbarriered(trc, objp, name);
}
JS_PUBLIC_API(void)
JS_CallStringTracer(JSTracer *trc, JSString **strp, const char *name)
JS_CallUnbarrieredStringTracer(JSTracer *trc, JSString **strp, const char *name)
{
MarkStringUnbarriered(trc, strp, name);
}
JS_PUBLIC_API(void)
JS_CallScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name)
JS_CallUnbarrieredScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name)
{
MarkScriptUnbarriered(trc, scriptp, name);
}
JS_PUBLIC_API(void)
JS_CallHeapValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name)
JS_CallValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name)
{
MarkValueUnbarriered(trc, valuep->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallHeapIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name)
JS_CallIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name)
{
MarkIdUnbarriered(trc, idp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallHeapObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name)
JS_CallObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name)
{
MarkObjectUnbarriered(trc, objp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallHeapStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name)
JS_CallStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name)
{
MarkStringUnbarriered(trc, strp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallHeapScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name)
JS_CallScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name)
{
MarkScriptUnbarriered(trc, scriptp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallHeapFunctionTracer(JSTracer *trc, JS::Heap<JSFunction *> *funp, const char *name)
JS_CallFunctionTracer(JSTracer *trc, JS::Heap<JSFunction *> *funp, const char *name)
{
MarkObjectUnbarriered(trc, funp->unsafeGet(), name);
}

View File

@ -451,6 +451,15 @@ SimdTypeToScalarType(MIRType type)
MOZ_ASSUME_UNREACHABLE("unexpected SIMD kind");
}
// Indicates a lane in a SIMD register: X for the first lane, Y for the second,
// Z for the third (if any), W for the fourth (if any).
enum SimdLane {
LaneX = 0x0,
LaneY = 0x1,
LaneZ = 0x2,
LaneW = 0x3
};
#ifdef DEBUG
// Track the pipeline of opcodes which has produced a snapshot.

View File

@ -128,6 +128,44 @@ class LMoveGroup : public LInstructionHelper<0, 0, 0>
}
};
// Extracts an element from a given SIMD int32x4 lane.
class LSimdExtractElementI : public LInstructionHelper<1, 1, 0>
{
SimdLane lane_;
public:
LIR_HEADER(SimdExtractElementI);
LSimdExtractElementI(const LAllocation &base, SimdLane lane) : lane_(lane) {
setOperand(0, base);
}
const LAllocation *getBase() {
return getOperand(0);
}
SimdLane lane() const {
return lane_;
}
};
// Extracts an element from a given SIMD float32x4 lane.
class LSimdExtractElementF : public LInstructionHelper<1, 1, 0>
{
SimdLane lane_;
public:
LIR_HEADER(SimdExtractElementF);
LSimdExtractElementF(const LAllocation &base, SimdLane lane) : lane_(lane) {
setOperand(0, base);
}
const LAllocation *getBase() {
return getOperand(0);
}
SimdLane lane() const {
return lane_;
}
};
// Constant 32-bit integer.
class LInteger : public LInstructionHelper<1, 0, 0>
{

View File

@ -16,6 +16,8 @@
_(Pointer) \
_(Double) \
_(Float32) \
_(SimdExtractElementI) \
_(SimdExtractElementF) \
_(Value) \
_(CloneLiteral) \
_(Parameter) \

View File

@ -3638,6 +3638,28 @@ LIRGenerator::visitRecompileCheck(MRecompileCheck *ins)
return assignSafepoint(lir, ins);
}
bool
LIRGenerator::visitSimdExtractElement(MSimdExtractElement *ins)
{
JS_ASSERT(IsSimdType(ins->input()->type()));
JS_ASSERT(!IsSimdType(ins->type()));
if (ins->input()->type() == MIRType_Int32x4) {
// Note: there could be int16x8 in the future, which doesn't use the
// same instruction. We either need to pass the arity or create new LIns.
LUse use = useRegisterAtStart(ins->input());
return define(new(alloc()) LSimdExtractElementI(use, ins->lane()), ins);
}
if (ins->input()->type() == MIRType_Float32x4) {
LUse use = useRegisterAtStart(ins->input());
return define(new(alloc()) LSimdExtractElementF(use, ins->lane()), ins);
}
MOZ_ASSUME_UNREACHABLE("Unknown SIMD kind when extracting element");
return false;
}
static void
SpewResumePoint(MBasicBlock *block, MInstruction *ins, MResumePoint *resumePoint)
{

View File

@ -263,6 +263,7 @@ class LIRGenerator : public LIRGeneratorSpecific
bool visitGetDOMProperty(MGetDOMProperty *ins);
bool visitGetDOMMember(MGetDOMMember *ins);
bool visitRecompileCheck(MRecompileCheck *ins);
bool visitSimdExtractElement(MSimdExtractElement *ins);
};
} // namespace jit

View File

@ -1233,6 +1233,47 @@ class MConstant : public MNullaryInstruction
ALLOW_CLONE(MConstant)
};
// Extracts a lane element from a given vector type, given by its lane symbol.
class MSimdExtractElement : public MUnaryInstruction
{
protected:
SimdLane lane_;
MSimdExtractElement(MDefinition *obj, MIRType type, SimdLane lane)
: MUnaryInstruction(obj), lane_(lane)
{
JS_ASSERT(IsSimdType(obj->type()));
JS_ASSERT(uint32_t(lane) < SimdTypeToLength(obj->type()));
JS_ASSERT(!IsSimdType(type));
JS_ASSERT(SimdTypeToScalarType(obj->type()) == type);
setResultType(type);
}
public:
INSTRUCTION_HEADER(SimdExtractElement);
static MSimdExtractElement *NewAsmJS(TempAllocator &alloc, MDefinition *obj, MIRType type,
SimdLane lane)
{
return new(alloc) MSimdExtractElement(obj, type, lane);
}
SimdLane lane() const {
return lane_;
}
AliasSet getAliasSet() const {
return AliasSet::None();
}
bool congruentTo(const MDefinition *ins) const {
if (!ins->isSimdExtractElement())
return false;
const MSimdExtractElement *other = ins->toSimdExtractElement();
if (other->lane_ != lane_)
return false;
return congruentIfOperandsEqual(other);
}
};
// Deep clone a constant JSObject.
class MCloneLiteral
: public MUnaryInstruction,

View File

@ -12,6 +12,7 @@ namespace jit {
#define MIR_OPCODE_LIST(_) \
_(Constant) \
_(SimdExtractElement) \
_(CloneLiteral) \
_(Parameter) \
_(Callee) \

View File

@ -112,6 +112,7 @@ class ParallelSafetyVisitor : public MDefinitionVisitor
// obviously safe for now. We can loosen as we need.
SAFE_OP(Constant)
SAFE_OP(SimdExtractElement)
UNSAFE_OP(CloneLiteral)
SAFE_OP(Parameter)
SAFE_OP(Callee)

View File

@ -224,6 +224,11 @@ class CodeGeneratorARM : public CodeGeneratorShared
bool visitUDiv(LUDiv *ins);
bool visitUMod(LUMod *ins);
bool visitSoftUDivOrMod(LSoftUDivOrMod *ins);
public:
// Unimplemented SIMD instructions
bool visitSimdExtractElementI(LSimdExtractElementI *ins) { MOZ_ASSUME_UNREACHABLE("NYI"); }
bool visitSimdExtractElementF(LSimdExtractElementF *ins) { MOZ_ASSUME_UNREACHABLE("NYI"); }
};
typedef CodeGeneratorARM CodeGeneratorSpecific;

View File

@ -12,6 +12,9 @@
namespace js {
namespace jit {
static const bool SupportsSimd = false;
static const uint32_t SimdStackAlignment = 0;
class Registers
{
public:

View File

@ -35,9 +35,9 @@ uint32_t FrameSizeClass::frameSize() const { MOZ_CRASH(); }
void DispatchIonCache::initializeAddCacheState(LInstruction *, AddCacheState *) { MOZ_CRASH(); }
void MacroAssembler::PushRegsInMask(RegisterSet) { MOZ_CRASH(); }
void MacroAssembler::PushRegsInMask(RegisterSet, FloatRegisterSet) { MOZ_CRASH(); }
void MacroAssembler::clampDoubleToUint8(FloatRegister, Register) { MOZ_CRASH(); }
void MacroAssembler::PopRegsInMaskIgnore(RegisterSet, RegisterSet) { MOZ_CRASH(); }
void MacroAssembler::PopRegsInMaskIgnore(RegisterSet, RegisterSet, FloatRegisterSet) { MOZ_CRASH(); }
void MacroAssembler::alignFrameForICArguments(AfterICSaveLive &) { MOZ_CRASH(); }
void MacroAssembler::restoreFrameAlignmentForICArguments(AfterICSaveLive &) { MOZ_CRASH(); }

View File

@ -1463,6 +1463,18 @@ class AssemblerX86Shared : public AssemblerShared
JS_ASSERT(HasSSE2());
masm.movd_rr(src.code(), dest.code());
}
void pshufd(uint32_t mask, FloatRegister src, FloatRegister dest) {
JS_ASSERT(HasSSE2());
masm.pshufd_irr(mask, src.code(), dest.code());
}
void movhlps(FloatRegister src, FloatRegister dest) {
JS_ASSERT(HasSSE2());
masm.movhlps_rr(src.code(), dest.code());
}
void shufps(uint32_t mask, FloatRegister src, FloatRegister dest) {
JS_ASSERT(HasSSE2());
masm.shufps_irr(mask, src.code(), dest.code());
}
void addsd(FloatRegister src, FloatRegister dest) {
JS_ASSERT(HasSSE2());
masm.addsd_rr(src.code(), dest.code());

View File

@ -2053,6 +2053,45 @@ CodeGeneratorX86Shared::visitNegF(LNegF *ins)
return true;
}
bool
CodeGeneratorX86Shared::visitSimdExtractElementI(LSimdExtractElementI *ins)
{
FloatRegister input = ToFloatRegister(ins->input());
Register output = ToRegister(ins->output());
SimdLane lane = ins->lane();
if (lane == LaneX) {
// The value we want to extract is in the low double-word
masm.moveLowInt32(input, output);
} else {
uint32_t mask = MacroAssembler::ComputeShuffleMask(lane);
masm.shuffleInt32(mask, input, ScratchSimdReg);
masm.moveLowInt32(ScratchSimdReg, output);
}
return true;
}
bool
CodeGeneratorX86Shared::visitSimdExtractElementF(LSimdExtractElementF *ins)
{
FloatRegister input = ToFloatRegister(ins->input());
FloatRegister output = ToFloatRegister(ins->output());
SimdLane lane = ins->lane();
if (lane == LaneX) {
// The value we want to extract is in the low double-word
if (input != output)
masm.moveFloat32(input, output);
} else if (lane == LaneZ) {
masm.moveHighPairToLowPairFloat32(input, output);
} else {
uint32_t mask = MacroAssembler::ComputeShuffleMask(lane);
masm.shuffleFloat32(mask, input, output);
}
masm.canonicalizeFloat(output);
return true;
}
bool
CodeGeneratorX86Shared::visitForkJoinGetSlice(LForkJoinGetSlice *ins)
{

View File

@ -204,6 +204,10 @@ class CodeGeneratorX86Shared : public CodeGeneratorShared
bool visitNegD(LNegD *lir);
bool visitNegF(LNegF *lir);
// SIMD operators
bool visitSimdExtractElementI(LSimdExtractElementI *lir);
bool visitSimdExtractElementF(LSimdExtractElementF *lir);
// Out of line visitors.
bool visitOutOfLineBailout(OutOfLineBailout *ool);
bool visitOutOfLineUndoALUOperation(OutOfLineUndoALUOperation *ool);

View File

@ -499,6 +499,38 @@ class MacroAssemblerX86Shared : public Assembler
movups(src, Operand(dest));
}
static uint32_t ComputeShuffleMask(SimdLane x, SimdLane y = LaneX,
SimdLane z = LaneX, SimdLane w = LaneX)
{
uint32_t r = (uint32_t(w) << 6) |
(uint32_t(z) << 4) |
(uint32_t(y) << 2) |
uint32_t(x);
JS_ASSERT(r < 256);
return r;
}
void shuffleInt32(uint32_t mask, FloatRegister src, FloatRegister dest) {
pshufd(mask, src, dest);
}
void moveLowInt32(FloatRegister src, Register dest) {
movd(src, dest);
}
void moveHighPairToLowPairFloat32(FloatRegister src, FloatRegister dest) {
movhlps(src, dest);
}
void shuffleFloat32(uint32_t mask, FloatRegister src, FloatRegister dest) {
// The shuffle instruction on x86 is such that it moves 2 words from
// the dest and 2 words from the src operands. To simplify things, just
// clobber the output with the input and apply the instruction
// afterwards.
// Note: this is useAtStart-safe because src isn't read afterwards.
if (src != dest)
moveAlignedFloat32x4(src, dest);
shufps(mask, dest, dest);
}
void moveFloatAsDouble(Register src, FloatRegister dest) {
movd(src, dest);
cvtss2sd(dest, dest);

View File

@ -28,6 +28,28 @@ bool JSAPITest::init()
return true;
}
void JSAPITest::uninit()
{
if (oldCompartment) {
JS_LeaveCompartment(cx, oldCompartment);
oldCompartment = nullptr;
}
if (global) {
JS_LeaveCompartment(cx, nullptr);
JS::RemoveObjectRoot(cx, &global);
global = nullptr;
}
if (cx) {
JS_EndRequest(cx);
JS_DestroyContext(cx);
cx = nullptr;
}
if (rt) {
destroyRuntime();
rt = nullptr;
}
}
bool JSAPITest::exec(const char *bytes, const char *filename, int lineno)
{
JS::RootedValue v(cx);
@ -64,8 +86,11 @@ JSObject * JSAPITest::createGlobal(JSPrincipals *principals)
/* Populate the global object with the standard globals, like Object and
Array. */
if (!JS_InitStandardClasses(cx, globalHandle))
return nullptr;
if (!JS_InitStandardClasses(cx, globalHandle)) {
global = nullptr;
JS::RemoveObjectRoot(cx, &global);
}
return global;
}
@ -91,6 +116,7 @@ int main(int argc, char *argv[])
if (!test->init()) {
printf("TEST-UNEXPECTED-FAIL | %s | Failed to initialize.\n", name);
failures++;
test->uninit();
continue;
}

View File

@ -67,28 +67,14 @@ class JSAPITest
list = this;
}
virtual ~JSAPITest() { uninit(); }
virtual ~JSAPITest() {
JS_ASSERT(!rt);
JS_ASSERT(!cx);
JS_ASSERT(!global);
}
virtual bool init();
virtual void uninit() {
if (oldCompartment) {
JS_LeaveCompartment(cx, oldCompartment);
oldCompartment = nullptr;
}
global = nullptr;
if (cx) {
JS::RemoveObjectRoot(cx, &global);
JS_LeaveCompartment(cx, nullptr);
JS_EndRequest(cx);
JS_DestroyContext(cx);
cx = nullptr;
}
if (rt) {
destroyRuntime();
rt = nullptr;
}
}
virtual void uninit();
virtual const char * name() = 0;
virtual bool run(JS::HandleObject global) = 0;

View File

@ -1022,7 +1022,7 @@ JS::ObjectPtr::isAboutToBeFinalized()
void
JS::ObjectPtr::trace(JSTracer *trc, const char *name)
{
JS_CallHeapObjectTracer(trc, &value, name);
JS_CallObjectTracer(trc, &value, name);
}
JS_FRIEND_API(JSObject *)

View File

@ -3237,46 +3237,20 @@ ReallocateElements(ThreadSafeContext *cx, JSObject *obj, ObjectElements *oldHead
// Having the second class means that for bigger arrays the constant factor is
// higher, but we waste less space.
//
// There are two exceptions to the above rules. Both exceptions optimize for
// cases where the requested capacity is near the array's length.
//
// - If |reqAllocated| would give us a capacity equal to |length|, it's
// probably due to code like this:
//
// var a = new Array(1024);
//
// 1024 is smaller than |EagerAllocationMaxLength|, so the array elements
// are allocated immediately. This is likely to be the final size of the
// array, so we just allocate the exact length immediately. In this case, the
// capacity is 1024 and |goodAllocated| is 1026.
//
// - If the |goodAllocated| value we compute gives a capacity slightly smaller
// than |length|, we nudge |goodAllocated| up so that the capacity equals the
// length. Consider the following code, which is very much like some code
// that appears in the Kraken benchmark suite:
//
// var a = new Array(8192);
// for (var i = 0; i < 8192; i++) { a[i] = i; }
//
// 8192 is larger than |EagerAllocationMaxLength|, so the elements will be
// resized up to the final size rather than allocated immediately. Without
// this exception, it would be repeatedly resized and |goodAllocated| would
// reach 8192, which gives a capacity of 8190, which isn't quite enough, so
// it would then be have to be resized one more time to 16382 elements,
// wasting time and memory. But with the exception, the final resizing is
// nudged, resulting in a capacity of 8192 and |goodAllocated| value of 8194.
// There is one exception to the above rule: for the power-of-two cases, if the
// chosen capacity would be 2/3 or more of the array's length, the chosen
// capacity is adjusted (up or down) to be equal to the array's length
// (assuming length is at least as large as the required capacity). This avoids
// the allocation of excess elements which are unlikely to be needed, either in
// this resizing or a subsequent one. The 2/3 factor is chosen so that
// exceptional resizings will at most triple the capacity, as opposed to the
// usual doubling.
//
/* static */ uint32_t
JSObject::goodAllocated(uint32_t reqAllocated, uint32_t length = 0)
{
static const uint32_t Mebi = 1024 * 1024;
uint32_t reqCapacity = reqAllocated - ObjectElements::VALUES_PER_HEADER;
if (reqCapacity == length && reqAllocated >= JSObject::SLOT_CAPACITY_MIN) {
// This is the first exception mentioned above.
return length + ObjectElements::VALUES_PER_HEADER;
}
// This table was generated with this JavaScript code and a small amount
// subsequent reformatting:
//
@ -3303,8 +3277,16 @@ JSObject::goodAllocated(uint32_t reqAllocated, uint32_t length = 0)
uint32_t goodAllocated = reqAllocated;
if (goodAllocated < Mebi) {
goodAllocated = RoundUpPow2(goodAllocated);
// Look for the abovementioned exception.
uint32_t goodCapacity = goodAllocated - ObjectElements::VALUES_PER_HEADER;
uint32_t reqCapacity = reqAllocated - ObjectElements::VALUES_PER_HEADER;
if (length >= reqCapacity && goodCapacity > (length / 3) * 2)
goodAllocated = length + ObjectElements::VALUES_PER_HEADER;
if (goodAllocated < JSObject::SLOT_CAPACITY_MIN)
goodAllocated = JSObject::SLOT_CAPACITY_MIN;
} else {
uint32_t i = 0;
while (true) {
@ -3322,12 +3304,6 @@ JSObject::goodAllocated(uint32_t reqAllocated, uint32_t length = 0)
}
}
uint32_t goodCapacity = goodAllocated - ObjectElements::VALUES_PER_HEADER;
if (length > goodCapacity && (length - goodCapacity) < 16) {
// This is the second exception mentioned above.
return length + ObjectElements::VALUES_PER_HEADER;
}
return goodAllocated;
}

View File

@ -99,7 +99,7 @@ JS::WeakMapPtr<K, V>::keyMarkCallback(JSTracer *trc, K key, void *data)
{
auto map = static_cast< JS::WeakMapPtr<K, V>* >(data);
K prior = key;
JS_CallObjectTracer(trc, &key, "WeakMapPtr key");
JS_CallUnbarrieredObjectTracer(trc, &key, "WeakMapPtr key");
return Utils<K, V>::cast(map->ptr)->rekeyIfMoved(prior, key);
}

View File

@ -88,7 +88,7 @@ private:
static void KeyMarkCallback(JSTracer *trc, JSObject *key, void *data) {
JSObject2WrappedJSMap* self = static_cast<JSObject2WrappedJSMap*>(data);
JSObject *prior = key;
JS_CallObjectTracer(trc, &key, "XPCJSRuntime::mWrappedJSMap key");
JS_CallUnbarrieredObjectTracer(trc, &key, "XPCJSRuntime::mWrappedJSMap key");
self->mTable.rekeyIfMoved(prior, key);
}
@ -704,7 +704,7 @@ private:
UnbarrieredMap &table = reinterpret_cast<UnbarrieredMap &>(self->mTable);
JSObject *prior = key;
JS_CallObjectTracer(trc, &key, "XPCWrappedNativeScope::mWaiverWrapperMap key");
JS_CallUnbarrieredObjectTracer(trc, &key, "XPCWrappedNativeScope::mWaiverWrapperMap key");
table.rekeyIfMoved(prior, key);
}

View File

@ -70,7 +70,7 @@ void XPCTraceableVariant::TraceJS(JSTracer* trc)
{
MOZ_ASSERT(mJSVal.isMarkable());
trc->setTracingDetails(GetTraceName, this, 0);
JS_CallHeapValueTracer(trc, &mJSVal, "XPCTraceableVariant::mJSVal");
JS_CallValueTracer(trc, &mJSVal, "XPCTraceableVariant::mJSVal");
}
// static

View File

@ -286,7 +286,7 @@ nsXPCWrappedJS::TraceJS(JSTracer* trc)
{
MOZ_ASSERT(mRefCnt >= 2 && IsValid(), "must be strongly referenced");
trc->setTracingDetails(GetTraceName, this, 0);
JS_CallHeapObjectTracer(trc, &mJSObj, "nsXPCWrappedJS::mJSObj");
JS_CallObjectTracer(trc, &mJSObj, "nsXPCWrappedJS::mJSObj");
}
// static

Some files were not shown because too many files have changed in this diff Show More