Merge mozilla-central to autoland. CLOSED TREE

This commit is contained in:
Csoregi Natalia 2019-01-25 19:02:11 +02:00
Родитель b7463bed23 e3e01de090
Коммит eb81fdc3cb
127 изменённых файлов: 1186 добавлений и 968 удалений

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

@ -250,6 +250,26 @@ tests.forEach(methods => {
});
});
// Session mode, but with unsupported custom permission, data in
// www.example.com, cookie permission set for www.example.com
tests.forEach(methods => {
attributes.forEach(originAttributes => {
add_task(async function deleteStorageOnlyCustomPermission() {
info(methods.name + ": All is session only, but with unsupported custom custom permission, data in www.example.com, cookie permission set for www.example.com - OA: " + originAttributes.name);
await deleteOnShutdown(
{ lifetimePolicy: Ci.nsICookieService.ACCEPT_SESSION,
createData: methods.createData,
checkData: methods.checkData,
originAttributes: originAttributes.oa,
cookiePermission: 123, // invalid cookie permission
expectedForOrg: false,
expectedForCom: false,
fullHost: true,
});
});
});
});
add_task(async function deleteStorageInAboutURL() {
info("Test about:newtab");

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

@ -688,7 +688,6 @@ async function sanitizeOnShutdown(progress) {
await maybeSanitizeSessionPrincipals(principals);
}
// Let's see if we have to forget some particular site.
for (let permission of Services.perms.enumerator) {
if (permission.type != "cookie" ||
@ -808,6 +807,11 @@ function cookiesAllowedForDomainOrSubDomain(principal) {
return false;
}
// This is an old profile with unsupported permission values
if (p != Ci.nsICookiePermission.ACCESS_DEFAULT) {
return false;
}
for (let perm of Services.perms.enumerator) {
if (perm.type != "cookie") {
continue;

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

@ -20,7 +20,6 @@
#include "mozilla/dom/Element.h"
#include "nsCycleCollectionParticipant.h"
#include "nsISMILAttr.h"
#include "mozilla/dom/ShadowRoot.h"
namespace mozilla {

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

@ -13,37 +13,37 @@
#ifndef mozilla_dom_Element_h__
#define mozilla_dom_Element_h__
#include "mozilla/dom/FragmentOrElement.h" // for base class
#include "nsChangeHint.h" // for enum
#include "mozilla/EventStates.h" // for member
#include "mozilla/RustCell.h"
#include "mozilla/dom/DirectionalityUtils.h"
#include "nsILinkHandler.h"
#include "nsINodeList.h"
#include "nsNodeUtils.h"
#include "AttrArray.h"
#include "mozilla/FlushType.h"
#include "nsDOMAttributeMap.h"
#include "nsPresContext.h"
#include "mozilla/CORSMode.h"
#include "mozilla/Attributes.h"
#include "nsIScrollableFrame.h"
#include "mozilla/dom/Attr.h"
#include "nsISMILAttr.h"
#include "mozilla/dom/DOMRect.h"
#include "DOMIntersectionObserver.h"
#include "nsAttrValue.h"
#include "nsAttrValueInlines.h"
#include "nsChangeHint.h"
#include "nsContentUtils.h"
#include "nsDOMAttributeMap.h"
#include "nsILinkHandler.h"
#include "nsINodeList.h"
#include "nsIScrollableFrame.h"
#include "nsNodeUtils.h"
#include "nsPresContext.h"
#include "Units.h"
#include "mozilla/Attributes.h"
#include "mozilla/CORSMode.h"
#include "mozilla/EventForwards.h"
#include "mozilla/EventStates.h"
#include "mozilla/FlushType.h"
#include "mozilla/RustCell.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/Attr.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/DirectionalityUtils.h"
#include "mozilla/dom/FragmentOrElement.h"
#include "mozilla/dom/DOMRect.h"
#include "mozilla/dom/DOMTokenListSupportedTokens.h"
#include "mozilla/dom/WindowBinding.h"
#include "mozilla/dom/ElementBinding.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PointerEventHandler.h"
#include "mozilla/UniquePtr.h"
#include "Units.h"
#include "DOMIntersectionObserver.h"
#include "nsContentUtils.h"
#include "mozilla/dom/WindowBinding.h"
class mozAutoDocUpdate;
class nsIFrame;
@ -58,7 +58,6 @@ class nsFocusManager;
class nsGlobalWindowInner;
class nsGlobalWindowOuter;
class nsDOMCSSAttributeDeclaration;
class nsISMILAttr;
class nsDOMStringMap;
struct ServoNodeData;
@ -356,11 +355,11 @@ class Element : public FragmentOrElement {
bool aNotify);
/**
* Returns a new nsISMILAttr that allows the caller to animate the given
* Returns a new SMILAttr that allows the caller to animate the given
* attribute on this element.
*/
virtual UniquePtr<nsISMILAttr> GetAnimatedAttr(int32_t aNamespaceID,
nsAtom* aName) {
virtual UniquePtr<SMILAttr> GetAnimatedAttr(int32_t aNamespaceID,
nsAtom* aName) {
return nullptr;
}

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

@ -99,8 +99,8 @@ void SMILAnimationController::Resume(uint32_t aType) {
}
}
nsSMILTime SMILAnimationController::GetParentTime() const {
return (nsSMILTime)(mCurrentSampleTime - mStartTime).ToMilliseconds();
SMILTime SMILAnimationController::GetParentTime() const {
return (SMILTime)(mCurrentSampleTime - mStartTime).ToMilliseconds();
}
//----------------------------------------------------------------------
@ -132,8 +132,8 @@ void SMILAnimationController::WillRefresh(mozilla::TimeStamp aTime) {
// initiate special behaviour to basically ignore the intervening time.
static const double SAMPLE_DEV_THRESHOLD = 200.0;
nsSMILTime elapsedTime =
(nsSMILTime)(aTime - mCurrentSampleTime).ToMilliseconds();
SMILTime elapsedTime =
(SMILTime)(aTime - mCurrentSampleTime).ToMilliseconds();
if (mAvgTimeBetweenSamples == 0) {
// First sample.
mAvgTimeBetweenSamples = elapsedTime;
@ -148,8 +148,8 @@ void SMILAnimationController::WillRefresh(mozilla::TimeStamp aTime) {
// Update the moving average. Due to truncation here the average will
// normally be a little less than it should be but that's probably ok.
mAvgTimeBetweenSamples =
(nsSMILTime)(elapsedTime * SAMPLE_DUR_WEIGHTING +
mAvgTimeBetweenSamples * (1.0 - SAMPLE_DUR_WEIGHTING));
(SMILTime)(elapsedTime * SAMPLE_DUR_WEIGHTING +
mAvgTimeBetweenSamples * (1.0 - SAMPLE_DUR_WEIGHTING));
}
mCurrentSampleTime = aTime;
@ -464,7 +464,7 @@ void SMILAnimationController::DoMilestoneSamples() {
// registered for those times. This way events can fire in the correct order,
// dependencies can be resolved etc.
nsSMILTime sampleTime = INT64_MIN;
SMILTime sampleTime = INT64_MIN;
while (true) {
// We want to find any milestones AT OR BEFORE the current sample time so we
@ -526,8 +526,8 @@ void SMILAnimationController::DoMilestoneSamples() {
if (!containerTimeValue.IsDefinite()) continue;
// Clamp the converted container time to non-negative values.
nsSMILTime containerTime =
std::max<nsSMILTime>(0, containerTimeValue.GetMillis());
SMILTime containerTime =
std::max<SMILTime>(0, containerTimeValue.GetMillis());
if (nextMilestone.mIsEnd) {
elem->TimedElement().SampleEndAt(containerTime);
@ -554,7 +554,7 @@ void SMILAnimationController::DoMilestoneSamples() {
// timed element is in the list.
if (!aActiveContainers->GetEntry(timeContainer)) return;
nsSMILTime containerTime = timeContainer->GetCurrentTimeAsSMILTime();
SMILTime containerTime = timeContainer->GetCurrentTimeAsSMILTime();
MOZ_ASSERT(!timeContainer->IsSeeking(),
"Doing a regular sample but the time container is still seeking");

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILANIMATIONCONTROLLER_H_
#define NS_SMILANIMATIONCONTROLLER_H_
#ifndef mozilla_SMILAnimationController_h
#define mozilla_SMILAnimationController_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILCompositorTable.h"
@ -48,10 +48,10 @@ class SMILAnimationController final : public SMILTimeContainer,
// going away)
void Disconnect();
// nsSMILContainer
// SMILContainer
virtual void Pause(uint32_t aType) override;
virtual void Resume(uint32_t aType) override;
virtual nsSMILTime GetParentTime() const override;
virtual SMILTime GetParentTime() const override;
// nsARefreshObserver
NS_IMETHOD_(MozExternalRefCountType) AddRef() override;
@ -179,7 +179,7 @@ class SMILAnimationController final : public SMILTimeContainer,
// This behaviour does not affect pausing (since we're not *expecting* any
// samples then) nor seeking (where the SMIL model behaves somewhat
// differently such as not dispatching events).
nsSMILTime mAvgTimeBetweenSamples;
SMILTime mAvgTimeBetweenSamples;
bool mResampleNeeded;
// If we're told to start sampling but there are no animation elements we just
@ -207,4 +207,4 @@ class SMILAnimationController final : public SMILTimeContainer,
} // namespace mozilla
#endif // NS_SMILANIMATIONCONTROLLER_H_
#endif // mozilla_SMILAnimationController_h

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

@ -7,12 +7,13 @@
#include "SMILAnimationFunction.h"
#include "mozilla/dom/SVGAnimationElement.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/Move.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/SMILCSSValueType.h"
#include "mozilla/SMILNullType.h"
#include "mozilla/SMILParserUtils.h"
#include "mozilla/SMILTimedElement.h"
#include "nsISMILAttr.h"
#include "nsAttrValueInlines.h"
#include "nsGkAtoms.h"
#include "nsCOMPtr.h"
@ -130,7 +131,7 @@ bool SMILAnimationFunction::UnsetAttr(nsAtom* aAttribute) {
return foundMatch;
}
void SMILAnimationFunction::SampleAt(nsSMILTime aSampleTime,
void SMILAnimationFunction::SampleAt(SMILTime aSampleTime,
const SMILTimeValue& aSimpleDuration,
uint32_t aRepeatIteration) {
// * Update mHasChanged ("Might this sample be different from prev one?")
@ -162,7 +163,7 @@ void SMILAnimationFunction::SampleLastValue(uint32_t aRepeatIteration) {
mLastValue = true;
}
void SMILAnimationFunction::Activate(nsSMILTime aBeginTime) {
void SMILAnimationFunction::Activate(SMILTime aBeginTime) {
mBeginTime = aBeginTime;
mIsActive = true;
mIsFrozen = false;
@ -175,7 +176,7 @@ void SMILAnimationFunction::Inactivate(bool aIsFrozen) {
mHasChanged = true;
}
void SMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr,
void SMILAnimationFunction::ComposeResult(const SMILAttr& aSMILAttr,
SMILValue& aResult) {
mHasChanged = false;
mPrevSampleWasSingleValueAnimation = false;
@ -320,7 +321,7 @@ nsresult SMILAnimationFunction::InterpolateResult(const SMILValueArray& aValues,
double simpleProgress = 0.0;
if (mSimpleDuration.IsDefinite()) {
nsSMILTime dur = mSimpleDuration.GetMillis();
SMILTime dur = mSimpleDuration.GetMillis();
MOZ_ASSERT(dur >= 0, "Simple duration should not be negative");
MOZ_ASSERT(mSampleTime >= 0, "Sample time should not be negative");
@ -336,7 +337,7 @@ nsresult SMILAnimationFunction::InterpolateResult(const SMILValueArray& aValues,
}
nsresult rv = NS_OK;
nsSMILCalcMode calcMode = GetCalcMode();
SMILCalcMode calcMode = GetCalcMode();
// Force discrete calcMode for visibility since StyleAnimationValue will
// try to interpolate it using the special clamping behavior defined for
@ -523,9 +524,7 @@ nsresult SMILAnimationFunction::ComputePacedPosition(
double curIntervalDist;
#ifdef DEBUG
nsresult rv =
#endif
DebugOnly<nsresult> rv =
aValues[i].ComputeDistance(aValues[i + 1], curIntervalDist);
MOZ_ASSERT(NS_SUCCEEDED(rv),
"If we got through ComputePacedTotalDistance, we should "
@ -592,7 +591,7 @@ double SMILAnimationFunction::ComputePacedTotalDistance(
}
double SMILAnimationFunction::ScaleSimpleProgress(double aProgress,
nsSMILCalcMode aCalcMode) {
SMILCalcMode aCalcMode) {
if (!HasAttr(nsGkAtoms::keyTimes)) return aProgress;
uint32_t numTimes = mKeyTimes.Length();
@ -663,13 +662,13 @@ bool SMILAnimationFunction::GetAttr(nsAtom* aAttName,
* If |aResult| contains dependencies on its context that
* should prevent the result of the animation sandwich from
* being cached and reused in future samples (as reported
* by nsISMILAttr::ValueFromString), then this outparam
* by SMILAttr::ValueFromString), then this outparam
* will be set to true. Otherwise it is left unmodified.
*
* Returns false if a parse error occurred, otherwise returns true.
*/
bool SMILAnimationFunction::ParseAttr(nsAtom* aAttName,
const nsISMILAttr& aSMILAttr,
const SMILAttr& aSMILAttr,
SMILValue& aResult,
bool& aPreventCachingOfSandwich) const {
nsAutoString attValue;
@ -700,7 +699,7 @@ bool SMILAnimationFunction::ParseAttr(nsAtom* aAttName,
* This helper method applies these rules to fill in the values list and to set
* some internal state.
*/
nsresult SMILAnimationFunction::GetValues(const nsISMILAttr& aSMILAttr,
nsresult SMILAnimationFunction::GetValues(const SMILAttr& aSMILAttr,
SMILValueArray& aResult) {
if (!mAnimationElement) return NS_ERROR_FAILURE;
@ -784,7 +783,7 @@ void SMILAnimationFunction::CheckValueListDependentAttrs(uint32_t aNumValues) {
void SMILAnimationFunction::CheckKeyTimes(uint32_t aNumValues) {
if (!HasAttr(nsGkAtoms::keyTimes)) return;
nsSMILCalcMode calcMode = GetCalcMode();
SMILCalcMode calcMode = GetCalcMode();
// attribute is ignored for calcMode = paced
if (calcMode == CALC_PACED) {
@ -881,12 +880,11 @@ bool SMILAnimationFunction::GetAdditive() const {
return value->GetEnumValue();
}
SMILAnimationFunction::nsSMILCalcMode SMILAnimationFunction::GetCalcMode()
const {
SMILAnimationFunction::SMILCalcMode SMILAnimationFunction::GetCalcMode() const {
const nsAttrValue* value = GetAttr(nsGkAtoms::calcMode);
if (!value) return CALC_LINEAR;
return nsSMILCalcMode(value->GetEnumValue());
return SMILCalcMode(value->GetEnumValue());
}
//----------------------------------------------------------------------

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

@ -4,9 +4,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILANIMATIONFUNCTION_H_
#define NS_SMILANIMATIONFUNCTION_H_
#ifndef mozilla_SMILAnimationFunction_h
#define mozilla_SMILAnimationFunction_h
#include "mozilla/SMILAttr.h"
#include "mozilla/SMILKeySpline.h"
#include "mozilla/SMILTargetIdentifier.h"
#include "mozilla/SMILTimeValue.h"
@ -14,7 +15,6 @@
#include "mozilla/SMILValue.h"
#include "nsAttrValue.h"
#include "nsGkAtoms.h"
#include "nsISMILAttr.h"
#include "nsString.h"
#include "nsTArray.h"
@ -79,7 +79,7 @@ class SMILAnimationFunction {
* @param aRepeatIteration The repeat iteration for this sample. The first
* iteration has a value of 0.
*/
void SampleAt(nsSMILTime aSampleTime, const SMILTimeValue& aSimpleDuration,
void SampleAt(SMILTime aSampleTime, const SMILTimeValue& aSimpleDuration,
uint32_t aRepeatIteration);
/**
@ -102,7 +102,7 @@ class SMILAnimationFunction {
*
* @param aBeginTime The begin time for the newly active interval.
*/
void Activate(nsSMILTime aBeginTime);
void Activate(SMILTime aBeginTime);
/**
* Indicate that this animation is no longer active. This is used to instruct
@ -124,7 +124,7 @@ class SMILAnimationFunction {
*
* @param aResult The value to compose with.
*/
void ComposeResult(const nsISMILAttr& aSMILAttr, SMILValue& aResult);
void ComposeResult(const SMILAttr& aSMILAttr, SMILValue& aResult);
/**
* Returns the relative priority of this animation to another. The priority is
@ -261,7 +261,7 @@ class SMILAnimationFunction {
typedef FallibleTArray<SMILValue> SMILValueArray;
// Types
enum nsSMILCalcMode : uint8_t {
enum SMILCalcMode : uint8_t {
CALC_LINEAR,
CALC_DISCRETE,
CALC_PACED,
@ -269,12 +269,12 @@ class SMILAnimationFunction {
};
// Used for sorting SMILAnimationFunctions
nsSMILTime GetBeginTime() const { return mBeginTime; }
SMILTime GetBeginTime() const { return mBeginTime; }
// Property getters
bool GetAccumulate() const;
bool GetAdditive() const;
virtual nsSMILCalcMode GetCalcMode() const;
virtual SMILCalcMode GetCalcMode() const;
// Property setters
nsresult SetAccumulate(const nsAString& aAccumulate, nsAttrValue& aResult);
@ -305,7 +305,7 @@ class SMILAnimationFunction {
* Adjust the simple progress, that is, the point within the simple duration,
* by applying any keyTimes.
*/
double ScaleSimpleProgress(double aProgress, nsSMILCalcMode aCalcMode);
double ScaleSimpleProgress(double aProgress, SMILCalcMode aCalcMode);
/**
* Adjust the progress within an interval, that is, between two animation
* values, by applying any keySplines.
@ -318,10 +318,10 @@ class SMILAnimationFunction {
virtual const nsAttrValue* GetAttr(nsAtom* aAttName) const;
virtual bool GetAttr(nsAtom* aAttName, nsAString& aResult) const;
bool ParseAttr(nsAtom* aAttName, const nsISMILAttr& aSMILAttr,
bool ParseAttr(nsAtom* aAttName, const SMILAttr& aSMILAttr,
SMILValue& aResult, bool& aPreventCachingOfSandwich) const;
virtual nsresult GetValues(const nsISMILAttr& aSMILAttr,
virtual nsresult GetValues(const SMILAttr& aSMILAttr,
SMILValueArray& aResult);
virtual void CheckValueListDependentAttrs(uint32_t aNumValues);
@ -405,11 +405,11 @@ class SMILAnimationFunction {
// instructed by the compositor. This allows us to apply the result directly
// to the animation value and allows the compositor to filter out functions
// that it determines will not contribute to the final result.
nsSMILTime mSampleTime; // sample time within simple dur
SMILTime mSampleTime; // sample time within simple dur
SMILTimeValue mSimpleDuration;
uint32_t mRepeatIteration;
nsSMILTime mBeginTime; // document time
SMILTime mBeginTime; // document time
// The owning animation element. This is used for sorting based on document
// position and for fetching attribute values stored in the element.
@ -425,7 +425,7 @@ class SMILAnimationFunction {
// Allows us to check whether an animation function has changed target from
// sample to sample (because if neither target nor animated value have
// changed, we don't have to do anything).
nsSMILWeakTargetIdentifier mLastTarget;
SMILWeakTargetIdentifier mLastTarget;
// Boolean flags
bool mIsActive : 1;
@ -439,4 +439,4 @@ class SMILAnimationFunction {
} // namespace mozilla
#endif // NS_SMILANIMATIONFUNCTION_H_
#endif // mozilla_SMILAnimationFunction_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_ISMILATTR_H_
#define NS_ISMILATTR_H_
#ifndef mozilla_SMILAttr_h
#define mozilla_SMILAttr_h
#include "nscore.h"
#include "nsStringFwd.h"
@ -19,10 +19,9 @@ class SMILValue;
namespace dom {
class SVGAnimationElement;
} // namespace dom
} // namespace mozilla
////////////////////////////////////////////////////////////////////////
// nsISMILAttr: A variable targeted by SMIL for animation and can therefore have
// SMILAttr: A variable targeted by SMIL for animation and can therefore have
// an underlying (base) value and an animated value For example, an attribute of
// a particular SVG element.
//
@ -30,9 +29,8 @@ class SVGAnimationElement;
// calculations. They have a single owner who is responsible for deleting the
// object.
class nsISMILAttr {
class SMILAttr {
public:
typedef mozilla::SMILValue SMILValue;
/**
* Creates a new SMILValue for this attribute from a string. The string is
* parsed in the context of this attribute so that context-dependent values
@ -82,11 +80,11 @@ class nsISMILAttr {
virtual nsresult SetAnimValue(const SMILValue& aValue) = 0;
/**
* Returns the targeted content node, for any nsISMILAttr implementations
* Returns the targeted content node, for any SMILAttr implementations
* that want to expose that to the animation logic. Otherwise, returns
* null.
*
* @return the targeted content node, if this nsISMILAttr implementation
* @return the targeted content node, if this SMILAttr implementation
* wishes to make it avaiable. Otherwise, nullptr.
*/
virtual const nsIContent* GetTargetNode() const { return nullptr; }
@ -94,7 +92,9 @@ class nsISMILAttr {
/**
* Virtual destructor, to make sure subclasses can clean themselves up.
*/
virtual ~nsISMILAttr() {}
virtual ~SMILAttr() {}
};
#endif // NS_ISMILATTR_H_
} // namespace mozilla
#endif // mozilla_SMILAttr_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_SMILBOOLTYPE_H_
#define MOZILLA_SMILBOOLTYPE_H_
#ifndef mozilla_SMILBoolType_h
#define mozilla_SMILBoolType_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILType.h"
@ -44,4 +44,4 @@ class SMILBoolType : public SMILType {
} // namespace mozilla
#endif // MOZILLA_SMILBOOLTYPE_H_
#endif // mozilla_SMILBoolType_h

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

@ -6,11 +6,11 @@
/* representation of a SMIL-animatable CSS property on an element */
#ifndef NS_SMILCSSPROPERTY_H_
#define NS_SMILCSSPROPERTY_H_
#ifndef mozilla_SMILCSSProperty_h
#define mozilla_SMILCSSProperty_h
#include "mozilla/Attributes.h"
#include "nsISMILAttr.h"
#include "mozilla/SMILAttr.h"
#include "nsAtom.h"
#include "nsCSSPropertyID.h"
#include "nsCSSValue.h"
@ -22,11 +22,11 @@ class Element;
} // namespace dom
/**
* SMILCSSProperty: Implements the nsISMILAttr interface for SMIL animations
* SMILCSSProperty: Implements the SMILAttr interface for SMIL animations
* that target CSS properties. Represents a particular animation-targeted CSS
* property on a particular element.
*/
class SMILCSSProperty : public nsISMILAttr {
class SMILCSSProperty : public SMILAttr {
public:
/**
* Constructs a new SMILCSSProperty.
@ -40,7 +40,7 @@ class SMILCSSProperty : public nsISMILAttr {
SMILCSSProperty(nsCSSPropertyID aPropID, dom::Element* aElement,
ComputedStyle* aBaseComputedStyle);
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
@ -64,14 +64,14 @@ class SMILCSSProperty : public nsISMILAttr {
protected:
nsCSSPropertyID mPropID;
// Using non-refcounted pointer for mElement -- we know mElement will stay
// alive for my lifetime because a nsISMILAttr (like me) only lives as long
// alive for my lifetime because a SMILAttr (like me) only lives as long
// as the Compositing step, and DOM elements don't get a chance to die during
// that time.
dom::Element* mElement;
// The style to use when fetching base styles.
//
// As with mElement, since an nsISMILAttr only lives as long as the
// As with mElement, since a SMILAttr only lives as long as the
// compositing step and since ComposeAttribute holds an owning reference to
// the base ComputedStyle, we can use a non-owning reference here.
ComputedStyle* mBaseComputedStyle;
@ -79,4 +79,4 @@ class SMILCSSProperty : public nsISMILAttr {
} // namespace mozilla
#endif // NS_SMILCSSPROPERTY_H_
#endif // mozilla_SMILCSSProperty_h

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

@ -6,8 +6,8 @@
/* representation of a value for a SMIL-animated CSS property */
#ifndef NS_SMILCSSVALUETYPE_H_
#define NS_SMILCSSVALUETYPE_H_
#ifndef mozilla_SMILCSSValueType_h
#define mozilla_SMILCSSValueType_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILType.h"
@ -26,9 +26,6 @@ class Element;
*/
class SMILCSSValueType : public SMILType {
public:
typedef mozilla::dom::Element Element;
typedef mozilla::AnimationValue AnimationValue;
// Singleton for SMILValue objects to hold onto.
static SMILCSSValueType sSingleton;
@ -74,7 +71,8 @@ class SMILCSSValueType : public SMILType {
* @pre aValue.IsNull()
* @post aValue.IsNull() || aValue.mType == SMILCSSValueType::sSingleton
*/
static void ValueFromString(nsCSSPropertyID aPropID, Element* aTargetElement,
static void ValueFromString(nsCSSPropertyID aPropID,
dom::Element* aTargetElement,
const nsAString& aString, SMILValue& aValue,
bool* aIsContextSensitive);
@ -90,7 +88,7 @@ class SMILCSSValueType : public SMILType {
* returns true).
*/
static SMILValue ValueFromAnimationValue(nsCSSPropertyID aPropID,
Element* aTargetElement,
dom::Element* aTargetElement,
const AnimationValue& aValue);
/**
@ -132,4 +130,4 @@ class SMILCSSValueType : public SMILType {
} // namespace mozilla
#endif // NS_SMILCSSVALUETYPE_H_
#endif // mozilla_SMILCSSValueType_h

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

@ -46,16 +46,16 @@ void SMILCompositor::ComposeAttribute(bool& aMightHavePendingStyleUpdates) {
if (!mKey.mElement) return;
// If we might need to resolve base styles, grab a suitable ComputedStyle
// for initializing our nsISMILAttr with.
// for initializing our SMILAttr with.
RefPtr<ComputedStyle> baseComputedStyle;
if (MightNeedBaseStyle()) {
baseComputedStyle = nsComputedDOMStyle::GetUnanimatedComputedStyleNoFlush(
mKey.mElement, nullptr);
}
// FIRST: Get the nsISMILAttr (to grab base value from, and to eventually
// FIRST: Get the SMILAttr (to grab base value from, and to eventually
// give animated value to)
UniquePtr<nsISMILAttr> smilAttr = CreateSMILAttr(baseComputedStyle);
UniquePtr<SMILAttr> smilAttr = CreateSMILAttr(baseComputedStyle);
if (!smilAttr) {
// Target attribute not found (or, out of memory)
return;
@ -102,14 +102,14 @@ void SMILCompositor::ComposeAttribute(bool& aMightHavePendingStyleUpdates) {
// SIXTH: Set the animated value to the final composited result.
nsresult rv = smilAttr->SetAnimValue(sandwichResultValue);
if (NS_FAILED(rv)) {
NS_WARNING("nsISMILAttr::SetAnimValue failed");
NS_WARNING("SMILAttr::SetAnimValue failed");
}
}
void SMILCompositor::ClearAnimationEffects() {
if (!mKey.mElement || !mKey.mAttributeName) return;
UniquePtr<nsISMILAttr> smilAttr = CreateSMILAttr(nullptr);
UniquePtr<SMILAttr> smilAttr = CreateSMILAttr(nullptr);
if (!smilAttr) {
// Target attribute not found (or, out of memory)
return;
@ -119,7 +119,7 @@ void SMILCompositor::ClearAnimationEffects() {
// Protected Helper Functions
// --------------------------
UniquePtr<nsISMILAttr> SMILCompositor::CreateSMILAttr(
UniquePtr<SMILAttr> SMILCompositor::CreateSMILAttr(
ComputedStyle* aBaseComputedStyle) {
nsCSSPropertyID propID = GetCSSPropertyToAnimate();

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILCOMPOSITOR_H_
#define NS_SMILCOMPOSITOR_H_
#ifndef mozilla_SMILCompositor_h
#define mozilla_SMILCompositor_h
#include "mozilla/Move.h"
#include "mozilla/UniquePtr.h"
@ -72,11 +72,11 @@ class SMILCompositor : public PLDHashEntryHdr {
}
private:
// Create a nsISMILAttr for my target, on the heap.
// Create a SMILAttr for my target, on the heap.
//
// @param aBaseComputedStyle An optional ComputedStyle which, if set, will be
// used when fetching the base style.
UniquePtr<nsISMILAttr> CreateSMILAttr(ComputedStyle* aBaseComputedStyle);
UniquePtr<SMILAttr> CreateSMILAttr(ComputedStyle* aBaseComputedStyle);
// Returns the CSS property this compositor should animate, or
// eCSSProperty_UNKNOWN if this compositor does not animate a CSS property.
@ -122,4 +122,4 @@ class SMILCompositor : public PLDHashEntryHdr {
} // namespace mozilla
#endif // NS_SMILCOMPOSITOR_H_
#endif // mozilla_SMILCompositor_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILCOMPOSITORTABLE_H_
#define NS_SMILCOMPOSITORTABLE_H_
#ifndef mozilla_SMILCompositorTable_h
#define mozilla_SMILCompositorTable_h
#include "nsTHashtable.h"
@ -25,4 +25,4 @@ typedef nsTHashtable<SMILCompositor> SMILCompositorTable;
} // namespace mozilla
#endif // NS_SMILCOMPOSITORTABLE_H_
#endif // mozilla_SMILCompositorTable_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_SMILENUMTYPE_H_
#define MOZILLA_SMILENUMTYPE_H_
#ifndef mozilla_SMILEnumType_h
#define mozilla_SMILEnumType_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILType.h"
@ -44,4 +44,4 @@ class SMILEnumType : public SMILType {
} // namespace mozilla
#endif // MOZILLA_SMILENUMTYPE_H_
#endif // mozilla_SMILEnumType_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILFLOATTYPE_H_
#define NS_SMILFLOATTYPE_H_
#ifndef mozilla_SMILFloatType_h
#define mozilla_SMILFloatType_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILType.h"
@ -44,4 +44,4 @@ class SMILFloatType : public SMILType {
} // namespace mozilla
#endif // NS_SMILFLOATTYPE_H_
#endif // mozilla_SMILFloatType_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILINSTANCETIME_H_
#define NS_SMILINSTANCETIME_H_
#ifndef mozilla_SMILInstanceTime_h
#define mozilla_SMILInstanceTime_h
#include "nsISupportsImpl.h"
#include "mozilla/SMILTimeValue.h"
@ -163,4 +163,4 @@ class SMILInstanceTime final {
} // namespace mozilla
#endif // NS_SMILINSTANCETIME_H_
#endif // mozilla_SMILInstanceTime_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_SMILINTEGERTYPE_H_
#define MOZILLA_SMILINTEGERTYPE_H_
#ifndef mozilla_SMILIntegerType_h
#define mozilla_SMILIntegerType_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILType.h"
@ -39,4 +39,4 @@ class SMILIntegerType : public SMILType {
} // namespace mozilla
#endif // MOZILLA_SMILINTEGERTYPE_H_
#endif // mozilla_SMILIntegerType_h

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

@ -6,6 +6,8 @@
#include "SMILInterval.h"
#include "mozilla/DebugOnly.h"
namespace mozilla {
SMILInterval::SMILInterval() : mBeginFixed(false), mEndFixed(false) {}
@ -111,10 +113,7 @@ void SMILInterval::AddDependentTime(SMILInstanceTime& aTime) {
}
void SMILInterval::RemoveDependentTime(const SMILInstanceTime& aTime) {
#ifdef DEBUG
bool found =
#endif
mDependentTimes.RemoveElementSorted(&aTime);
DebugOnly<bool> found = mDependentTimes.RemoveElementSorted(&aTime);
MOZ_ASSERT(found, "Couldn't find instance time to delete.");
}

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILINTERVAL_H_
#define NS_SMILINTERVAL_H_
#ifndef mozilla_SMILInterval_h
#define mozilla_SMILInterval_h
#include "mozilla/SMILInstanceTime.h"
#include "nsTArray.h"
@ -83,4 +83,4 @@ class SMILInterval {
} // namespace mozilla
#endif // NS_SMILINTERVAL_H_
#endif // mozilla_SMILInterval_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILKEYSPLINE_H_
#define NS_SMILKEYSPLINE_H_
#ifndef mozilla_SMILKeySpline_h
#define mozilla_SMILKeySpline_h
#include "mozilla/ArrayUtils.h"
#include "mozilla/PodOperations.h"
@ -104,4 +104,4 @@ class SMILKeySpline {
} // namespace mozilla
#endif // NS_SMILKEYSPLINE_H_
#endif // mozilla_SMILKeySpline_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILMILESTONE_H_
#define NS_SMILMILESTONE_H_
#ifndef mozilla_SMILMilestone_h
#define mozilla_SMILMilestone_h
#include "mozilla/SMILTypes.h"
@ -38,7 +38,7 @@ namespace mozilla {
*/
class SMILMilestone {
public:
SMILMilestone(nsSMILTime aTime, bool aIsEnd) : mTime(aTime), mIsEnd(aIsEnd) {}
SMILMilestone(SMILTime aTime, bool aIsEnd) : mTime(aTime), mIsEnd(aIsEnd) {}
SMILMilestone() : mTime(0), mIsEnd(false) {}
@ -64,7 +64,7 @@ class SMILMilestone {
return !(*this < aOther);
}
nsSMILTime mTime; // The milestone time. This may be in container time or
SMILTime mTime; // The milestone time. This may be in container time or
// parent container time depending on where it is used.
bool mIsEnd; // true if this milestone corresponds to an interval
// end, false otherwise.
@ -72,4 +72,4 @@ class SMILMilestone {
} // namespace mozilla
#endif // NS_SMILMILESTONE_H_
#endif // mozilla_SMILMilestone_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILNULLTYPE_H_
#define NS_SMILNULLTYPE_H_
#ifndef mozilla_SMILNullType_h
#define mozilla_SMILNullType_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILType.h"
@ -44,4 +44,4 @@ class SMILNullType : public SMILType {
} // namespace mozilla
#endif // NS_SMILNULLTYPE_H_
#endif // mozilla_SMILNullType_h

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

@ -6,6 +6,7 @@
#include "SMILParserUtils.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/SMILKeySpline.h"
#include "mozilla/SMILRepeatCount.h"
#include "mozilla/SMILTimeValue.h"
@ -14,7 +15,6 @@
#include "mozilla/SMILValue.h"
#include "mozilla/SVGContentUtils.h"
#include "mozilla/TextUtils.h"
#include "nsISMILAttr.h"
#include "nsContentUtils.h"
#include "nsCharSeparatedTokenizer.h"
@ -186,7 +186,7 @@ bool ParseClockValue(RangedPtr<const char16_t>& aIter,
iter, aEnd, fraction))) {
return false;
}
aResult->SetMillis(nsSMILTime(hours) * MSEC_PER_HOUR +
aResult->SetMillis(SMILTime(hours) * MSEC_PER_HOUR +
minutes * MSEC_PER_MIN + seconds * MSEC_PER_SEC +
NS_round(fraction * MSEC_PER_SEC));
aIter = iter;
@ -202,7 +202,7 @@ bool ParseClockValue(RangedPtr<const char16_t>& aIter,
if (!ParseClockMetric(iter, aEnd, multiplier)) {
return false;
}
aResult->SetMillis(nsSMILTime(timecount) * multiplier +
aResult->SetMillis(SMILTime(timecount) * multiplier +
NS_round(fraction * multiplier));
aIter = iter;
return true;
@ -491,7 +491,7 @@ class MOZ_STACK_CLASS SMILValueParser
: public SMILParserUtils::GenericValueParser {
public:
SMILValueParser(const SVGAnimationElement* aSrcElement,
const nsISMILAttr* aSMILAttr,
const SMILAttr* aSMILAttr,
FallibleTArray<SMILValue>* aValuesArray,
bool* aPreventCachingOfSandwich)
: mSrcElement(aSrcElement),
@ -517,14 +517,14 @@ class MOZ_STACK_CLASS SMILValueParser
protected:
const SVGAnimationElement* mSrcElement;
const nsISMILAttr* mSMILAttr;
const SMILAttr* mSMILAttr;
FallibleTArray<SMILValue>* mValuesArray;
bool* mPreventCachingOfSandwich;
};
bool SMILParserUtils::ParseValues(const nsAString& aSpec,
const SVGAnimationElement* aSrcElement,
const nsISMILAttr& aAttribute,
const SMILAttr& aAttribute,
FallibleTArray<SMILValue>& aValuesArray,
bool& aPreventCachingOfSandwich) {
// Assume all results can be cached, until we find one that can't.

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

@ -4,16 +4,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILPARSERUTILS_H_
#define NS_SMILPARSERUTILS_H_
#ifndef mozilla_SMILParserUtils_h
#define mozilla_SMILParserUtils_h
#include "nsTArray.h"
#include "nsStringFwd.h"
class nsISMILAttr;
namespace mozilla {
class SMILAttr;
class SMILKeySpline;
class SMILRepeatCount;
class SMILTimeValue;
@ -49,7 +48,7 @@ class SMILParserUtils {
static bool ParseValues(const nsAString& aSpec,
const mozilla::dom::SVGAnimationElement* aSrcElement,
const nsISMILAttr& aAttribute,
const SMILAttr& aAttribute,
FallibleTArray<SMILValue>& aValuesArray,
bool& aPreventCachingOfSandwich);
@ -87,4 +86,4 @@ class SMILParserUtils {
} // namespace mozilla
#endif // NS_SMILPARSERUTILS_H_
#endif // mozilla_SMILParserUtils_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef SMILRepeatCount_h
#define SMILRepeatCount_h
#ifndef mozilla_SMILRepeatCount_h
#define mozilla_SMILRepeatCount_h
#include "nsDebug.h"
#include <math.h>
@ -59,4 +59,4 @@ class SMILRepeatCount {
} // namespace mozilla
#endif
#endif // mozilla_SMILRepeatCount_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILSETANIMATIONFUNCTION_H_
#define NS_SMILSETANIMATIONFUNCTION_H_
#ifndef mozilla_SMILSetAnimationFunction_h
#define mozilla_SMILSetAnimationFunction_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILAnimationFunction.h"
@ -64,4 +64,4 @@ class SMILSetAnimationFunction : public SMILAnimationFunction {
} // namespace mozilla
#endif // NS_SMILSETANIMATIONFUNCTION_H_
#endif // mozilla_SMILSetAnimationFunction_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_SMILSTRINGTYPE_H_
#define MOZILLA_SMILSTRINGTYPE_H_
#ifndef mozilla_SMILStringType_h
#define mozilla_SMILStringType_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILType.h"
@ -44,4 +44,4 @@ class SMILStringType : public SMILType {
} // namespace mozilla
#endif // MOZILLA_SMILSTRINGTYPE_H_
#endif // mozilla_SMILStringType_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILTARGETIDENTIFIER_H_
#define NS_SMILTARGETIDENTIFIER_H_
#ifndef mozilla_SMILTargetIdentifier_h
#define mozilla_SMILTargetIdentifier_h
#include "mozilla/dom/Element.h"
@ -42,7 +42,7 @@ struct SMILTargetIdentifier {
};
/**
* Class: nsSMILWeakTargetIdentifier
* Class: SMILWeakTargetIdentifier
*
* Version of the above struct that uses non-owning pointers. These are kept
* private, to ensure that they aren't ever dereferenced (or used at all,
@ -51,13 +51,13 @@ struct SMILTargetIdentifier {
* This is solely for comparisons to determine if a target has changed
* from one sample to the next.
*/
class nsSMILWeakTargetIdentifier {
class SMILWeakTargetIdentifier {
public:
// Trivial constructor
nsSMILWeakTargetIdentifier() : mElement(nullptr), mAttributeName(nullptr) {}
SMILWeakTargetIdentifier() : mElement(nullptr), mAttributeName(nullptr) {}
// Allow us to update a weak identifier to match a given non-weak identifier
nsSMILWeakTargetIdentifier& operator=(const SMILTargetIdentifier& aOther) {
SMILWeakTargetIdentifier& operator=(const SMILTargetIdentifier& aOther) {
mElement = aOther.mElement;
mAttributeName = aOther.mAttributeName;
return *this;
@ -76,4 +76,4 @@ class nsSMILWeakTargetIdentifier {
} // namespace mozilla
#endif // NS_SMILTARGETIDENTIFIER_H_
#endif // mozilla_SMILTargetIdentifier_h

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

@ -34,7 +34,7 @@ SMILTimeContainer::~SMILTimeContainer() {
}
SMILTimeValue SMILTimeContainer::ContainerToParentTime(
nsSMILTime aContainerTime) const {
SMILTime aContainerTime) const {
// If we're paused, then future times are indefinite
if (IsPaused() && aContainerTime > mCurrentTime)
return SMILTimeValue::Indefinite();
@ -43,7 +43,7 @@ SMILTimeValue SMILTimeContainer::ContainerToParentTime(
}
SMILTimeValue SMILTimeContainer::ParentToContainerTime(
nsSMILTime aParentTime) const {
SMILTime aParentTime) const {
// If we're paused, then any time after when we paused is indefinite
if (IsPaused() && aParentTime > mPauseStart)
return SMILTimeValue::Indefinite();
@ -89,13 +89,13 @@ void SMILTimeContainer::Resume(uint32_t aType) {
mPauseState &= ~aType;
if (!mPauseState) {
nsSMILTime extraOffset = GetParentTime() - mPauseStart;
SMILTime extraOffset = GetParentTime() - mPauseStart;
mParentOffset += extraOffset;
NotifyTimeChange();
}
}
nsSMILTime SMILTimeContainer::GetCurrentTimeAsSMILTime() const {
SMILTime SMILTimeContainer::GetCurrentTimeAsSMILTime() const {
// The following behaviour is consistent with:
// http://www.w3.org/2003/01/REC-SVG11-20030114-errata
// #getCurrentTime_setCurrentTime_undefined_before_document_timeline_begin
@ -106,17 +106,17 @@ nsSMILTime SMILTimeContainer::GetCurrentTimeAsSMILTime() const {
return mCurrentTime;
}
void SMILTimeContainer::SetCurrentTime(nsSMILTime aSeekTo) {
void SMILTimeContainer::SetCurrentTime(SMILTime aSeekTo) {
// SVG 1.1 doesn't specify what to do for negative times so we adopt SVGT1.2's
// behaviour of clamping negative times to 0.
aSeekTo = std::max<nsSMILTime>(0, aSeekTo);
aSeekTo = std::max<SMILTime>(0, aSeekTo);
// The following behaviour is consistent with:
// http://www.w3.org/2003/01/REC-SVG11-20030114-errata
// #getCurrentTime_setCurrentTime_undefined_before_document_timeline_begin
// which says that if SetCurrentTime is called before the document timeline
// has begun we should still adjust the offset.
nsSMILTime parentTime = GetParentTime();
SMILTime parentTime = GetParentTime();
mParentOffset = parentTime - aSeekTo;
mIsSeeking = true;
@ -138,7 +138,7 @@ void SMILTimeContainer::SetCurrentTime(nsSMILTime aSeekTo) {
NotifyTimeChange();
}
nsSMILTime SMILTimeContainer::GetParentTime() const {
SMILTime SMILTimeContainer::GetParentTime() const {
if (mParent) return mParent->GetCurrentTimeAsSMILTime();
return 0L;
@ -146,8 +146,8 @@ nsSMILTime SMILTimeContainer::GetParentTime() const {
void SMILTimeContainer::SyncPauseTime() {
if (IsPaused()) {
nsSMILTime parentTime = GetParentTime();
nsSMILTime extraOffset = parentTime - mPauseStart;
SMILTime parentTime = GetParentTime();
SMILTime extraOffset = parentTime - mPauseStart;
mParentOffset += extraOffset;
mPauseStart = parentTime;
}
@ -261,7 +261,7 @@ void SMILTimeContainer::Unlink() {
}
void SMILTimeContainer::UpdateCurrentTime() {
nsSMILTime now = IsPaused() ? mPauseStart : GetParentTime();
SMILTime now = IsPaused() ? mPauseStart : GetParentTime();
mCurrentTime = now - mParentOffset;
MOZ_ASSERT(mCurrentTime >= 0, "Container has negative time");
}

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILTIMECONTAINER_H_
#define NS_SMILTIMECONTAINER_H_
#ifndef mozilla_SMILTimeContainer_h
#define mozilla_SMILTimeContainer_h
#include "mozilla/dom/SVGAnimationElement.h"
#include "mozilla/SMILMilestone.h"
@ -85,7 +85,7 @@ class SMILTimeContainer {
* Return the time elapsed since this time container's begin time (expressed
* in parent time) minus any accumulated offset from pausing.
*/
nsSMILTime GetCurrentTimeAsSMILTime() const;
SMILTime GetCurrentTimeAsSMILTime() const;
/*
* Seek the document timeline to the specified time.
@ -93,12 +93,12 @@ class SMILTimeContainer {
* @param aSeekTo The time to seek to, expressed in this time container's time
* base (i.e. the same units as GetCurrentTime).
*/
void SetCurrentTime(nsSMILTime aSeekTo);
void SetCurrentTime(SMILTime aSeekTo);
/*
* Return the current time for the parent time container if any.
*/
virtual nsSMILTime GetParentTime() const;
virtual SMILTime GetParentTime() const;
/*
* Convert container time to parent time.
@ -107,7 +107,7 @@ class SMILTimeContainer {
* @return The equivalent parent time or indefinite if the container is
* paused and the time is in the future.
*/
SMILTimeValue ContainerToParentTime(nsSMILTime aContainerTime) const;
SMILTimeValue ContainerToParentTime(SMILTime aContainerTime) const;
/*
* Convert from parent time to container time.
@ -116,7 +116,7 @@ class SMILTimeContainer {
* @return The equivalent container time or indefinite if the container is
* paused and aParentTime is after the time when the pause began.
*/
SMILTimeValue ParentToContainerTime(nsSMILTime aParentTime) const;
SMILTimeValue ParentToContainerTime(SMILTime aParentTime) const;
/*
* If the container is paused, causes the pause time to be updated to the
@ -247,7 +247,7 @@ class SMILTimeContainer {
SMILTimeContainer* mParent;
// The current time established at the last call to Sample()
nsSMILTime mCurrentTime;
SMILTime mCurrentTime;
// The number of milliseconds for which the container has been paused
// (excluding the current pause interval if the container is currently
@ -255,10 +255,10 @@ class SMILTimeContainer {
//
// Current time = parent time - mParentOffset
//
nsSMILTime mParentOffset;
SMILTime mParentOffset;
// The timestamp in parent time when the container was paused
nsSMILTime mPauseStart;
SMILTime mPauseStart;
// Whether or not a pause sample is required
bool mNeedsPauseSample;
@ -297,4 +297,4 @@ class SMILTimeContainer {
} // namespace mozilla
#endif // NS_SMILTIMECONTAINER_H_
#endif // mozilla_SMILTimeContainer_h

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

@ -8,8 +8,8 @@
namespace mozilla {
const nsSMILTime SMILTimeValue::kUnresolvedMillis =
std::numeric_limits<nsSMILTime>::max();
const SMILTime SMILTimeValue::kUnresolvedMillis =
std::numeric_limits<SMILTime>::max();
//----------------------------------------------------------------------
// SMILTimeValue methods:

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILTIMEVALUE_H_
#define NS_SMILTIMEVALUE_H_
#ifndef mozilla_SMILTimeValue_h
#define mozilla_SMILTimeValue_h
#include "mozilla/SMILTypes.h"
#include "nsDebug.h"
@ -19,7 +19,7 @@ namespace mozilla {
*
* First a quick overview of the SMIL time data types:
*
* nsSMILTime -- a timestamp in milliseconds.
* SMILTime -- a timestamp in milliseconds.
* SMILTimeValue -- (this class) a timestamp that can take the additional
* states 'indefinite' and 'unresolved'
* SMILInstanceTime -- an SMILTimeValue used for constructing intervals. It
@ -58,7 +58,7 @@ class SMILTimeValue {
: mMilliseconds(kUnresolvedMillis), mState(STATE_UNRESOLVED) {}
// Creates a resolved time value
explicit SMILTimeValue(nsSMILTime aMillis)
explicit SMILTimeValue(SMILTime aMillis)
: mMilliseconds(aMillis), mState(STATE_DEFINITE) {}
// Named constructor to create an indefinite time value
@ -81,14 +81,14 @@ class SMILTimeValue {
}
bool IsDefinite() const { return mState == STATE_DEFINITE; }
nsSMILTime GetMillis() const {
SMILTime GetMillis() const {
MOZ_ASSERT(mState == STATE_DEFINITE,
"GetMillis() called for unresolved or indefinite time");
return mState == STATE_DEFINITE ? mMilliseconds : kUnresolvedMillis;
}
void SetMillis(nsSMILTime aMillis) {
void SetMillis(SMILTime aMillis) {
mState = STATE_DEFINITE;
mMilliseconds = aMillis;
}
@ -120,12 +120,12 @@ class SMILTimeValue {
}
private:
static const nsSMILTime kUnresolvedMillis;
static const SMILTime kUnresolvedMillis;
nsSMILTime mMilliseconds;
SMILTime mMilliseconds;
enum { STATE_DEFINITE, STATE_INDEFINITE, STATE_UNRESOLVED } mState;
};
} // namespace mozilla
#endif // NS_SMILTIMEVALUE_H_
#endif // mozilla_SMILTimeValue_h

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

@ -116,7 +116,7 @@ void SMILTimeValueSpec::HandleNewInterval(
// Apply offset
if (!ApplyOffset(newTime)) {
NS_WARNING("New time overflows nsSMILTime, ignoring");
NS_WARNING("New time overflows SMILTime, ignoring");
return;
}
@ -144,7 +144,7 @@ void SMILTimeValueSpec::HandleChangedInstanceTime(
// Apply offset
if (!ApplyOffset(updatedTime)) {
NS_WARNING("Updated time overflows nsSMILTime, ignoring");
NS_WARNING("Updated time overflows SMILTime, ignoring");
return;
}
@ -300,10 +300,10 @@ void SMILTimeValueSpec::HandleEvent(Event* aEvent) {
return;
}
nsSMILTime currentTime = container->GetCurrentTimeAsSMILTime();
SMILTime currentTime = container->GetCurrentTimeAsSMILTime();
SMILTimeValue newTime(currentTime);
if (!ApplyOffset(newTime)) {
NS_WARNING("New time generated from event overflows nsSMILTime, ignoring");
NS_WARNING("New time generated from event overflows SMILTime, ignoring");
return;
}
@ -359,8 +359,8 @@ bool SMILTimeValueSpec::ApplyOffset(SMILTimeValue& aTime) const {
double resultAsDouble =
(double)aTime.GetMillis() + mParams.mOffset.GetMillis();
if (resultAsDouble > std::numeric_limits<nsSMILTime>::max() ||
resultAsDouble < std::numeric_limits<nsSMILTime>::min()) {
if (resultAsDouble > std::numeric_limits<SMILTime>::max() ||
resultAsDouble < std::numeric_limits<SMILTime>::min()) {
return false;
}
aTime.SetMillis(aTime.GetMillis() + mParams.mOffset.GetMillis());

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILTIMEVALUESPEC_H_
#define NS_SMILTIMEVALUESPEC_H_
#ifndef mozilla_SMILTimeValueSpec_h
#define mozilla_SMILTimeValueSpec_h
#include "mozilla/Attributes.h"
#include "mozilla/SMILTimeValueSpecParams.h"
@ -137,4 +137,4 @@ class SMILTimeValueSpec {
} // namespace mozilla
#endif // NS_SMILTIMEVALUESPEC_H_
#endif // mozilla_SMILTimeValueSpec_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILTIMEVALUESPECPARAMS_H_
#define NS_SMILTIMEVALUESPECPARAMS_H_
#ifndef mozilla_SMILTimeValueSpecParams_h
#define mozilla_SMILTimeValueSpecParams_h
#include "mozilla/SMILTimeValue.h"
#include "nsAtom.h"
@ -55,4 +55,4 @@ class SMILTimeValueSpecParams {
} // namespace mozilla
#endif // NS_SMILTIMEVALUESPECPARAMS_H_
#endif // mozilla_SMILTimeValueSpecParams_h

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

@ -199,7 +199,7 @@ const nsAttrValue::EnumTable SMILTimedElement::sRestartModeTable[] = {
{nullptr, 0}};
const SMILMilestone SMILTimedElement::sMaxMilestone(
std::numeric_limits<nsSMILTime>::max(), false);
std::numeric_limits<SMILTime>::max(), false);
// The thresholds at which point we start filtering intervals and instance times
// indiscriminately.
@ -298,7 +298,7 @@ nsresult SMILTimedElement::BeginElementAt(double aOffsetSeconds) {
SMILTimeContainer* container = GetTimeContainer();
if (!container) return NS_ERROR_FAILURE;
nsSMILTime currentTime = container->GetCurrentTimeAsSMILTime();
SMILTime currentTime = container->GetCurrentTimeAsSMILTime();
return AddInstanceTimeFromCurrentTime(currentTime, aOffsetSeconds, true);
}
@ -306,7 +306,7 @@ nsresult SMILTimedElement::EndElementAt(double aOffsetSeconds) {
SMILTimeContainer* container = GetTimeContainer();
if (!container) return NS_ERROR_FAILURE;
nsSMILTime currentTime = container->GetCurrentTimeAsSMILTime();
SMILTime currentTime = container->GetCurrentTimeAsSMILTime();
return AddInstanceTimeFromCurrentTime(currentTime, aOffsetSeconds, false);
}
@ -459,7 +459,7 @@ void SMILTimedElement::SetTimeClient(SMILAnimationFunction* aClient) {
mClient = aClient;
}
void SMILTimedElement::SampleAt(nsSMILTime aContainerTime) {
void SMILTimedElement::SampleAt(SMILTime aContainerTime) {
if (mIsDisabled) return;
// Milestones are cleared before a sample
@ -468,7 +468,7 @@ void SMILTimedElement::SampleAt(nsSMILTime aContainerTime) {
DoSampleAt(aContainerTime, false);
}
void SMILTimedElement::SampleEndAt(nsSMILTime aContainerTime) {
void SMILTimedElement::SampleEndAt(SMILTime aContainerTime) {
if (mIsDisabled) return;
// Milestones are cleared before a sample
@ -492,7 +492,7 @@ void SMILTimedElement::SampleEndAt(nsSMILTime aContainerTime) {
}
}
void SMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly) {
void SMILTimedElement::DoSampleAt(SMILTime aContainerTime, bool aEndOnly) {
MOZ_ASSERT(mAnimationElement,
"Got sample before being registered with an animation element");
MOZ_ASSERT(GetTimeContainer(),
@ -622,8 +622,8 @@ void SMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly) {
stateChanged = true;
} else if (mCurrentInterval->Begin()->Time() <= sampleTime) {
MOZ_ASSERT(!didApplyEarlyEnd, "We got an early end, but didn't end");
nsSMILTime beginTime = mCurrentInterval->Begin()->Time().GetMillis();
nsSMILTime activeTime = aContainerTime - beginTime;
SMILTime beginTime = mCurrentInterval->Begin()->Time().GetMillis();
SMILTime activeTime = aContainerTime - beginTime;
// The 'min' attribute can cause the active interval to be longer than
// the 'repeating interval'.
@ -936,7 +936,7 @@ nsresult SMILTimedElement::SetRestart(const nsAString& aRestartSpec) {
nsAttrValue temp;
bool parseResult = temp.ParseEnumValue(aRestartSpec, sRestartModeTable, true);
mRestartMode =
parseResult ? nsSMILRestartMode(temp.GetEnumValue()) : RESTART_ALWAYS;
parseResult ? SMILRestartMode(temp.GetEnumValue()) : RESTART_ALWAYS;
UpdateCurrentInterval();
return parseResult ? NS_OK : NS_ERROR_FAILURE;
}
@ -997,7 +997,7 @@ nsresult SMILTimedElement::SetFillMode(const nsAString& aFillModeSpec) {
nsAttrValue temp;
bool parseResult = temp.ParseEnumValue(aFillModeSpec, sFillModeTable, true);
mFillMode = parseResult ? nsSMILFillMode(temp.GetEnumValue()) : FILL_REMOVE;
mFillMode = parseResult ? SMILFillMode(temp.GetEnumValue()) : FILL_REMOVE;
// Update fill mode of client
if (mFillMode != previousFillMode && HasClientInFillRange()) {
@ -1691,7 +1691,7 @@ SMILTimeValue SMILTimedElement::CalcActiveEnd(const SMILTimeValue& aBegin,
result = GetRepeatDuration();
if (aEnd.IsDefinite()) {
nsSMILTime activeDur = aEnd.GetMillis() - aBegin.GetMillis();
SMILTime activeDur = aEnd.GetMillis() - aBegin.GetMillis();
if (result.IsDefinite()) {
result.SetMillis(std::min(result.GetMillis(), activeDur));
@ -1703,7 +1703,7 @@ SMILTimeValue SMILTimedElement::CalcActiveEnd(const SMILTimeValue& aBegin,
result = ApplyMinAndMax(result);
if (result.IsDefinite()) {
nsSMILTime activeEnd = result.GetMillis() + aBegin.GetMillis();
SMILTime activeEnd = result.GetMillis() + aBegin.GetMillis();
result.SetMillis(activeEnd);
}
@ -1714,9 +1714,9 @@ SMILTimeValue SMILTimedElement::GetRepeatDuration() const {
SMILTimeValue multipliedDuration;
if (mRepeatCount.IsDefinite() && mSimpleDur.IsDefinite()) {
if (mRepeatCount * double(mSimpleDur.GetMillis()) <=
std::numeric_limits<nsSMILTime>::max()) {
std::numeric_limits<SMILTime>::max()) {
multipliedDuration.SetMillis(
nsSMILTime(mRepeatCount * mSimpleDur.GetMillis()));
SMILTime(mRepeatCount * mSimpleDur.GetMillis()));
}
} else {
multipliedDuration.SetIndefinite();
@ -1758,9 +1758,9 @@ SMILTimeValue SMILTimedElement::ApplyMinAndMax(
return result;
}
nsSMILTime SMILTimedElement::ActiveTimeToSimpleTime(
nsSMILTime aActiveTime, uint32_t& aRepeatIteration) {
nsSMILTime result;
SMILTime SMILTimedElement::ActiveTimeToSimpleTime(SMILTime aActiveTime,
uint32_t& aRepeatIteration) {
SMILTime result;
MOZ_ASSERT(mSimpleDur.IsResolved(),
"Unresolved simple duration in ActiveTimeToSimpleTime");
@ -1914,11 +1914,10 @@ void SMILTimedElement::UpdateCurrentInterval(bool aForceChangeNotice) {
}
}
void SMILTimedElement::SampleSimpleTime(nsSMILTime aActiveTime) {
void SMILTimedElement::SampleSimpleTime(SMILTime aActiveTime) {
if (mClient) {
uint32_t repeatIteration;
nsSMILTime simpleTime =
ActiveTimeToSimpleTime(aActiveTime, repeatIteration);
SMILTime simpleTime = ActiveTimeToSimpleTime(aActiveTime, repeatIteration);
mClient->SampleAt(simpleTime, mSimpleDur, repeatIteration);
}
}
@ -1926,7 +1925,7 @@ void SMILTimedElement::SampleSimpleTime(nsSMILTime aActiveTime) {
void SMILTimedElement::SampleFillValue() {
if (mFillMode != FILL_FREEZE || !mClient) return;
nsSMILTime activeTime;
SMILTime activeTime;
if (mElementState == STATE_WAITING || mElementState == STATE_POSTACTIVE) {
const SMILInterval* prevInterval = GetPreviousInterval();
@ -1963,7 +1962,7 @@ void SMILTimedElement::SampleFillValue() {
}
uint32_t repeatIteration;
nsSMILTime simpleTime = ActiveTimeToSimpleTime(activeTime, repeatIteration);
SMILTime simpleTime = ActiveTimeToSimpleTime(activeTime, repeatIteration);
if (simpleTime == 0L && repeatIteration) {
mClient->SampleLastValue(--repeatIteration);
@ -1972,12 +1971,13 @@ void SMILTimedElement::SampleFillValue() {
}
}
nsresult SMILTimedElement::AddInstanceTimeFromCurrentTime(
nsSMILTime aCurrentTime, double aOffsetSeconds, bool aIsBegin) {
nsresult SMILTimedElement::AddInstanceTimeFromCurrentTime(SMILTime aCurrentTime,
double aOffsetSeconds,
bool aIsBegin) {
double offset = NS_round(aOffsetSeconds * PR_MSEC_PER_SEC);
// Check we won't overflow the range of nsSMILTime
if (aCurrentTime + offset > std::numeric_limits<nsSMILTime>::max())
// Check we won't overflow the range of SMILTime
if (aCurrentTime + offset > std::numeric_limits<SMILTime>::max())
return NS_ERROR_ILLEGAL_VALUE;
SMILTimeValue timeVal(aCurrentTime + int64_t(offset));
@ -2044,7 +2044,7 @@ bool SMILTimedElement::GetNextMilestone(SMILMilestone& aNextMilestone) const {
// Work out what comes next: the interval end or the next repeat iteration
SMILTimeValue nextRepeat;
if (mSeekState == SEEK_NOT_SEEKING && mSimpleDur.IsDefinite()) {
nsSMILTime nextRepeatActiveTime =
SMILTime nextRepeatActiveTime =
(mCurrentRepeatIteration + 1) * mSimpleDur.GetMillis();
// Check that the repeat fits within the repeat duration
if (SMILTimeValue(nextRepeatActiveTime) < GetRepeatDuration()) {

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILTIMEDELEMENT_H_
#define NS_SMILTIMEDELEMENT_H_
#ifndef mozilla_SMILTimedElement_h
#define mozilla_SMILTimedElement_h
#include "mozilla/EventForwards.h"
#include "mozilla/Move.h"
@ -204,7 +204,7 @@ class SMILTimedElement {
*
* @param aContainerTime The container time at which to sample.
*/
void SampleAt(nsSMILTime aContainerTime);
void SampleAt(SMILTime aContainerTime);
/**
* Performs a special sample for the end of an interval. Such a sample should
@ -218,7 +218,7 @@ class SMILTimedElement {
*
* @param aContainerTime The container time at which to sample.
*/
void SampleEndAt(nsSMILTime aContainerTime);
void SampleEndAt(SMILTime aContainerTime);
/**
* Informs the timed element that its time container has changed time
@ -398,7 +398,7 @@ class SMILTimedElement {
void ClearSpecs(TimeValueSpecList& aSpecs, InstanceTimeList& aInstances,
RemovalTestFunction aRemove);
void ClearIntervals();
void DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly);
void DoSampleAt(SMILTime aContainerTime, bool aEndOnly);
/**
* Helper function to check for an early end and, if necessary, update the
@ -461,7 +461,7 @@ class SMILTimedElement {
/**
* Helper function to iterate through this element's accumulated timing
* information (specifically old SMILIntervals and nsSMILTimeInstanceTimes)
* information (specifically old SMILIntervals and SMILTimeInstanceTimes)
* and discard items that are no longer needed or exceed some threshold of
* accumulated state.
*/
@ -508,13 +508,13 @@ class SMILTimedElement {
const SMILTimeValue& aEnd) const;
SMILTimeValue GetRepeatDuration() const;
SMILTimeValue ApplyMinAndMax(const SMILTimeValue& aDuration) const;
nsSMILTime ActiveTimeToSimpleTime(nsSMILTime aActiveTime,
uint32_t& aRepeatIteration);
SMILTime ActiveTimeToSimpleTime(SMILTime aActiveTime,
uint32_t& aRepeatIteration);
SMILInstanceTime* CheckForEarlyEnd(const SMILTimeValue& aContainerTime) const;
void UpdateCurrentInterval(bool aForceChangeNotice = false);
void SampleSimpleTime(nsSMILTime aActiveTime);
void SampleSimpleTime(SMILTime aActiveTime);
void SampleFillValue();
nsresult AddInstanceTimeFromCurrentTime(nsSMILTime aCurrentTime,
nsresult AddInstanceTimeFromCurrentTime(SMILTime aCurrentTime,
double aOffsetSeconds, bool aIsBegin);
void RegisterMilestone();
bool GetNextMilestone(SMILMilestone& aNextMilestone) const;
@ -564,16 +564,16 @@ class SMILTimedElement {
SMILTimeValue mMin;
SMILTimeValue mMax;
enum nsSMILFillMode : uint8_t { FILL_REMOVE, FILL_FREEZE };
nsSMILFillMode mFillMode;
enum SMILFillMode : uint8_t { FILL_REMOVE, FILL_FREEZE };
SMILFillMode mFillMode;
static const nsAttrValue::EnumTable sFillModeTable[];
enum nsSMILRestartMode : uint8_t {
enum SMILRestartMode : uint8_t {
RESTART_ALWAYS,
RESTART_WHENNOTACTIVE,
RESTART_NEVER
};
nsSMILRestartMode mRestartMode;
SMILRestartMode mRestartMode;
static const nsAttrValue::EnumTable sRestartModeTable[];
InstanceTimeList mBeginInstances;
@ -601,22 +601,22 @@ class SMILTimedElement {
* The state of the element in its life-cycle. These states are based on the
* element life-cycle described in SMILANIM 3.6.8
*/
enum nsSMILElementState {
enum SMILElementState {
STATE_STARTUP,
STATE_WAITING,
STATE_ACTIVE,
STATE_POSTACTIVE
};
nsSMILElementState mElementState;
SMILElementState mElementState;
enum nsSMILSeekState {
enum SMILSeekState {
SEEK_NOT_SEEKING,
SEEK_FORWARD_FROM_ACTIVE,
SEEK_FORWARD_FROM_INACTIVE,
SEEK_BACKWARD_FROM_ACTIVE,
SEEK_BACKWARD_FROM_INACTIVE
};
nsSMILSeekState mSeekState;
SMILSeekState mSeekState;
// Used to batch updates to the timing model
class AutoIntervalUpdateBatcher;
@ -646,4 +646,4 @@ inline void ImplCycleCollectionTraverse(
} // namespace mozilla
#endif // NS_SMILTIMEDELEMENT_H_
#endif // mozilla_SMILTimedElement_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_ISMILTYPE_H_
#define NS_ISMILTYPE_H_
#ifndef mozilla_SMILType_h
#define mozilla_SMILType_h
#include "mozilla/Attributes.h"
#include "nscore.h"
@ -209,4 +209,4 @@ class SMILType {
} // namespace mozilla
#endif // NS_ISMILTYPE_H_
#endif // mozilla_SMILType_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILTYPES_H_
#define NS_SMILTYPES_H_
#ifndef mozilla_SMILTypes_h
#define mozilla_SMILTypes_h
#include <stdint.h>
@ -23,8 +23,8 @@ namespace mozilla {
// For an overview of how this class is related to other SMIL time classes see
// the documentation in SMILTimeValue.h
//
typedef int64_t nsSMILTime;
typedef int64_t SMILTime;
} // namespace mozilla
#endif // NS_SMILTYPES_H_
#endif // mozilla_SMILTypes_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NS_SMILVALUE_H_
#define NS_SMILVALUE_H_
#ifndef mozilla_SMILValue_h
#define mozilla_SMILValue_h
#include "mozilla/SMILNullType.h"
#include "mozilla/SMILType.h"
@ -72,4 +72,4 @@ class SMILValue {
} // namespace mozilla
#endif // NS_SMILVALUE_H_
#endif // mozilla_SMILValue_h

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

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_TimeEvent_h_
#define mozilla_dom_TimeEvent_h_
#ifndef mozilla_dom_TimeEvent_h
#define mozilla_dom_TimeEvent_h
#include "nsDocShell.h"
#include "mozilla/dom/Event.h"
@ -60,4 +60,4 @@ already_AddRefed<mozilla::dom::TimeEvent> NS_NewDOMTimeEvent(
mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
mozilla::InternalSMILTimeEvent* aEvent);
#endif // mozilla_dom_TimeEvent_h_
#endif // mozilla_dom_TimeEvent_h

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

@ -9,13 +9,10 @@ with Files("**"):
MOCHITEST_MANIFESTS += ['test/mochitest.ini']
EXPORTS += [
'nsISMILAttr.h',
]
EXPORTS.mozilla += [
'SMILAnimationController.h',
'SMILAnimationFunction.h',
'SMILAttr.h',
'SMILCompositorTable.h',
'SMILCSSValueType.h',
'SMILInstanceTime.h',

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

@ -297,7 +297,7 @@ SVGAnimatedAngle::~SVGAnimatedAngle() {
sSVGAnimatedAngleTearoffTable.RemoveTearoff(mVal);
}
UniquePtr<nsISMILAttr> SVGAngle::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> SVGAngle::ToSMILAttr(SVGElement* aSVGElement) {
if (aSVGElement->NodeInfo()->Equals(nsGkAtoms::marker, kNameSpaceID_SVG)) {
SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(aSVGElement);
return MakeUnique<SMILOrient>(marker->GetOrientType(), this, aSVGElement);

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

@ -8,9 +8,9 @@
#define __NS_SVGANGLE_H__
#include "nsError.h"
#include "nsISMILAttr.h"
#include "mozilla/AlreadyAddRefed.h"
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/dom/SVGAngleBinding.h"
#include "mozilla/UniquePtr.h"
@ -67,7 +67,7 @@ class SVGAngle {
static nsresult ToDOMSVGAngle(nsISupports** aResult);
already_AddRefed<mozilla::dom::SVGAnimatedAngle> ToDOMAnimatedAngle(
SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
static bool GetValueFromString(const nsAString& aString, float& aValue,
uint16_t* aUnitType);
@ -96,20 +96,20 @@ class SVGAngle {
// 'marker' element, and 'orient' must be special cased since it can also
// take the value 'auto', making it a more complex type.
struct SMILOrient final : public nsISMILAttr {
struct SMILOrient final : public SMILAttr {
public:
SMILOrient(mozilla::dom::nsSVGOrientType* aOrientType, SVGAngle* aAngle,
SVGElement* aSVGElement)
: mOrientType(aOrientType), mAngle(aAngle), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
mozilla::dom::nsSVGOrientType* mOrientType;
SVGAngle* mAngle;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -39,7 +39,7 @@ bool SVGAnimateMotionElement::GetTargetAttributeName(
int32_t* aNamespaceID, nsAtom** aLocalName) const {
// <animateMotion> doesn't take an attributeName, since it doesn't target an
// 'attribute' per se. We'll use a unique dummy attribute-name so that our
// nsSMILTargetIdentifier logic (which requires a attribute name) still works.
// SMILTargetIdentifier logic (which requires a attribute name) still works.
*aNamespaceID = kNameSpaceID_None;
*aLocalName = nsGkAtoms::mozAnimateMotionDummyAttr;
return true;

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

@ -113,9 +113,10 @@ void SVGAnimatedLengthList::ClearAnimValue(SVGElement *aElement,
aElement->DidAnimateLengthList(aAttrEnum);
}
UniquePtr<nsISMILAttr> SVGAnimatedLengthList::ToSMILAttr(
SVGElement *aSVGElement, uint8_t aAttrEnum, uint8_t aAxis,
bool aCanZeroPadList) {
UniquePtr<SMILAttr> SVGAnimatedLengthList::ToSMILAttr(SVGElement *aSVGElement,
uint8_t aAttrEnum,
uint8_t aAxis,
bool aCanZeroPadList) {
return MakeUnique<SMILAnimatedLengthList>(this, aSVGElement, aAttrEnum, aAxis,
aCanZeroPadList);
}

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

@ -8,9 +8,9 @@
#define MOZILLA_SVGANIMATEDLENGTHLIST_H__
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsISMILAttr.h"
#include "SVGLengthList.h"
namespace mozilla {
@ -68,9 +68,9 @@ class SVGAnimatedLengthList {
bool IsAnimating() const { return !!mAnimVal; }
UniquePtr<nsISMILAttr> ToSMILAttr(dom::SVGElement* aSVGElement,
uint8_t aAttrEnum, uint8_t aAxis,
bool aCanZeroPadList);
UniquePtr<SMILAttr> ToSMILAttr(dom::SVGElement* aSVGElement,
uint8_t aAttrEnum, uint8_t aAxis,
bool aCanZeroPadList);
private:
// mAnimVal is a pointer to allow us to determine if we're being animated or
@ -81,7 +81,7 @@ class SVGAnimatedLengthList {
SVGLengthList mBaseVal;
nsAutoPtr<SVGLengthList> mAnimVal;
struct SMILAnimatedLengthList : public nsISMILAttr {
struct SMILAnimatedLengthList : public SMILAttr {
public:
SMILAnimatedLengthList(SVGAnimatedLengthList* aVal,
dom::SVGElement* aSVGElement, uint8_t aAttrEnum,
@ -92,7 +92,7 @@ class SVGAnimatedLengthList {
mAxis(aAxis),
mCanZeroPadList(aCanZeroPadList) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGAnimatedLengthList* mVal;
@ -101,7 +101,7 @@ class SVGAnimatedLengthList {
uint8_t mAxis;
bool mCanZeroPadList; // See SVGLengthListAndInfo::CanZeroPadList
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;

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

@ -114,8 +114,8 @@ void SVGAnimatedNumberList::ClearAnimValue(SVGElement *aElement,
aElement->DidAnimateNumberList(aAttrEnum);
}
UniquePtr<nsISMILAttr> SVGAnimatedNumberList::ToSMILAttr(
SVGElement *aSVGElement, uint8_t aAttrEnum) {
UniquePtr<SMILAttr> SVGAnimatedNumberList::ToSMILAttr(SVGElement *aSVGElement,
uint8_t aAttrEnum) {
return MakeUnique<SMILAnimatedNumberList>(this, aSVGElement, aAttrEnum);
}

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

@ -8,9 +8,9 @@
#define MOZILLA_SVGANIMATEDNUMBERLIST_H__
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsISMILAttr.h"
#include "SVGNumberList.h"
namespace mozilla {
@ -75,8 +75,8 @@ class SVGAnimatedNumberList {
bool IsAnimating() const { return !!mAnimVal; }
UniquePtr<nsISMILAttr> ToSMILAttr(dom::SVGElement* aSVGElement,
uint8_t aAttrEnum);
UniquePtr<SMILAttr> ToSMILAttr(dom::SVGElement* aSVGElement,
uint8_t aAttrEnum);
private:
// mAnimVal is a pointer to allow us to determine if we're being animated or
@ -88,20 +88,20 @@ class SVGAnimatedNumberList {
nsAutoPtr<SVGNumberList> mAnimVal;
bool mIsBaseSet;
struct SMILAnimatedNumberList : public nsISMILAttr {
struct SMILAnimatedNumberList : public SMILAttr {
public:
SMILAnimatedNumberList(SVGAnimatedNumberList* aVal,
dom::SVGElement* aSVGElement, uint8_t aAttrEnum)
: mVal(aVal), mElement(aSVGElement), mAttrEnum(aAttrEnum) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGAnimatedNumberList* mVal;
dom::SVGElement* mElement;
uint8_t mAttrEnum;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;

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

@ -141,8 +141,7 @@ bool SVGAnimatedPathSegList::IsRendered() const {
return mAnimVal ? !mAnimVal->IsEmpty() : !mBaseVal.IsEmpty();
}
UniquePtr<nsISMILAttr> SVGAnimatedPathSegList::ToSMILAttr(
SVGElement *aElement) {
UniquePtr<SMILAttr> SVGAnimatedPathSegList::ToSMILAttr(SVGElement *aElement) {
return MakeUnique<SMILAnimatedPathSegList>(this, aElement);
}

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

@ -9,9 +9,9 @@
#include "mozilla/Attributes.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsISMILAttr.h"
#include "SVGPathData.h"
namespace mozilla {
@ -83,7 +83,7 @@ class SVGAnimatedPathSegList final {
bool IsAnimating() const { return !!mAnimVal; }
UniquePtr<nsISMILAttr> ToSMILAttr(dom::SVGElement* aElement);
UniquePtr<SMILAttr> ToSMILAttr(dom::SVGElement* aElement);
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const;
@ -96,19 +96,19 @@ class SVGAnimatedPathSegList final {
SVGPathData mBaseVal;
nsAutoPtr<SVGPathData> mAnimVal;
struct SMILAnimatedPathSegList : public nsISMILAttr {
struct SMILAnimatedPathSegList : public SMILAttr {
public:
SMILAnimatedPathSegList(SVGAnimatedPathSegList* aVal,
dom::SVGElement* aElement)
: mVal(aVal), mElement(aElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGAnimatedPathSegList* mVal;
dom::SVGElement* mElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;

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

@ -140,7 +140,7 @@ void SVGAnimatedPointList::ClearAnimValue(SVGElement *aElement) {
aElement->DidAnimatePointList();
}
UniquePtr<nsISMILAttr> SVGAnimatedPointList::ToSMILAttr(SVGElement *aElement) {
UniquePtr<SMILAttr> SVGAnimatedPointList::ToSMILAttr(SVGElement *aElement) {
return MakeUnique<SMILAnimatedPointList>(this, aElement);
}

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

@ -8,9 +8,9 @@
#define MOZILLA_SVGANIMATEDPOINTLIST_H__
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsISMILAttr.h"
#include "SVGPointList.h"
namespace mozilla {
@ -77,7 +77,7 @@ class SVGAnimatedPointList {
bool IsAnimating() const { return !!mAnimVal; }
UniquePtr<nsISMILAttr> ToSMILAttr(dom::SVGElement* aElement);
UniquePtr<SMILAttr> ToSMILAttr(dom::SVGElement* aElement);
private:
// mAnimVal is a pointer to allow us to determine if we're being animated or
@ -88,18 +88,18 @@ class SVGAnimatedPointList {
SVGPointList mBaseVal;
nsAutoPtr<SVGPointList> mAnimVal;
struct SMILAnimatedPointList : public nsISMILAttr {
struct SMILAnimatedPointList : public SMILAttr {
public:
SMILAnimatedPointList(SVGAnimatedPointList* aVal, dom::SVGElement* aElement)
: mVal(aVal), mElement(aElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGAnimatedPointList* mVal;
dom::SVGElement* mElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;

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

@ -168,7 +168,7 @@ DOMSVGAnimatedPreserveAspectRatio::~DOMSVGAnimatedPreserveAspectRatio() {
sSVGAnimatedPAspectRatioTearoffTable.RemoveTearoff(mVal);
}
UniquePtr<nsISMILAttr> SVGAnimatedPreserveAspectRatio::ToSMILAttr(
UniquePtr<SMILAttr> SVGAnimatedPreserveAspectRatio::ToSMILAttr(
SVGElement* aSVGElement) {
return MakeUnique<SMILPreserveAspectRatio>(this, aSVGElement);
}

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

@ -9,11 +9,11 @@
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "nsISMILAttr.h"
#include "SVGElement.h"
#include "SVGPreserveAspectRatio.h"
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/SVGElement.h"
namespace mozilla {
@ -69,7 +69,7 @@ class SVGAnimatedPreserveAspectRatio final {
already_AddRefed<mozilla::dom::DOMSVGAnimatedPreserveAspectRatio>
ToDOMAnimatedPreserveAspectRatio(dom::SVGElement* aSVGElement);
UniquePtr<nsISMILAttr> ToSMILAttr(dom::SVGElement* aSVGElement);
UniquePtr<SMILAttr> ToSMILAttr(dom::SVGElement* aSVGElement);
private:
SVGPreserveAspectRatio mAnimVal;
@ -78,19 +78,19 @@ class SVGAnimatedPreserveAspectRatio final {
bool mIsBaseSet;
public:
struct SMILPreserveAspectRatio final : public nsISMILAttr {
struct SMILPreserveAspectRatio final : public SMILAttr {
public:
SMILPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal,
dom::SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGAnimatedPreserveAspectRatio* mVal;
dom::SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;

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

@ -161,7 +161,7 @@ bool SVGAnimatedTransformList::IsExplicitlySet() const {
return mIsAttrSet || !mBaseVal.IsEmpty() || mAnimVal;
}
UniquePtr<nsISMILAttr> SVGAnimatedTransformList::ToSMILAttr(
UniquePtr<SMILAttr> SVGAnimatedTransformList::ToSMILAttr(
SVGElement* aSVGElement) {
return MakeUnique<SMILAnimatedTransformList>(this, aSVGElement);
}

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

@ -8,9 +8,9 @@
#define MOZILLA_SVGANIMATEDTRANSFORMLIST_H__
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsISMILAttr.h"
#include "SVGTransformList.h"
class nsAtom;
@ -108,7 +108,7 @@ class SVGAnimatedTransformList {
return mRequiresFrameReconstruction;
}
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(dom::SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(dom::SVGElement* aSVGElement);
private:
// mAnimVal is a pointer to allow us to determine if we're being animated or
@ -122,13 +122,13 @@ class SVGAnimatedTransformList {
// (See documentation for accessor, RequiresFrameReconstruction.)
bool mRequiresFrameReconstruction;
struct SMILAnimatedTransformList : public nsISMILAttr {
struct SMILAnimatedTransformList : public SMILAttr {
public:
SMILAnimatedTransformList(SVGAnimatedTransformList* aVal,
dom::SVGElement* aSVGElement)
: mVal(aVal), mElement(aSVGElement) {}
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
@ -142,7 +142,7 @@ class SVGAnimatedTransformList {
static int32_t ParseParameterList(const nsAString& aSpec, float* aVars,
int32_t aNVars);
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGAnimatedTransformList* mVal;

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

@ -18,12 +18,6 @@ namespace dom {
typedef SVGElement SVGAnimationElementBase;
enum nsSMILTargetAttrType {
eSMILTargetAttrType_auto,
eSMILTargetAttrType_CSS,
eSMILTargetAttrType_XML
};
class SVGAnimationElement : public SVGAnimationElementBase, public SVGTests {
protected:
explicit SVGAnimationElement(

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

@ -114,7 +114,7 @@ SVGAnimatedBoolean::~SVGAnimatedBoolean() {
SVGAnimatedBooleanTearoffTable().RemoveTearoff(mVal);
}
UniquePtr<nsISMILAttr> SVGBoolean::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> SVGBoolean::ToSMILAttr(SVGElement* aSVGElement) {
return MakeUnique<SMILBool>(this, aSVGElement);
}

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

@ -8,7 +8,7 @@
#define __NS_SVGBOOLEAN_H__
#include "nsError.h"
#include "nsISMILAttr.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/AlreadyAddRefed.h"
#include "mozilla/Attributes.h"
#include "mozilla/UniquePtr.h"
@ -46,7 +46,7 @@ class SVGBoolean {
already_AddRefed<mozilla::dom::SVGAnimatedBoolean> ToDOMAnimatedBoolean(
SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
bool mAnimVal;
@ -55,18 +55,18 @@ class SVGBoolean {
uint8_t mAttrEnum; // element specified tracking for attribute
public:
struct SMILBool : public nsISMILAttr {
struct SMILBool : public SMILAttr {
public:
SMILBool(SVGBoolean* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGBoolean* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -101,7 +101,7 @@ void DOMAnimatedString::GetAnimVal(nsAString& aResult) {
mVal->GetAnimValue(aResult, mSVGElement);
}
UniquePtr<nsISMILAttr> SVGClass::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> SVGClass::ToSMILAttr(SVGElement* aSVGElement) {
return MakeUnique<SMILString>(this, aSVGElement);
}

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

@ -10,9 +10,9 @@
#include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "nsISMILAttr.h"
#include "nsString.h"
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
namespace mozilla {
@ -40,24 +40,24 @@ class SVGClass {
already_AddRefed<mozilla::dom::SVGAnimatedString> ToDOMAnimatedString(
SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
nsAutoPtr<nsString> mAnimVal;
public:
struct SMILString : public nsISMILAttr {
struct SMILString : public SMILAttr {
public:
SMILString(SVGClass* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGClass* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -2145,8 +2145,8 @@ void SVGElement::RecompileScriptEventListeners() {
}
}
UniquePtr<nsISMILAttr> SVGElement::GetAnimatedAttr(int32_t aNamespaceID,
nsAtom* aName) {
UniquePtr<SMILAttr> SVGElement::GetAnimatedAttr(int32_t aNamespaceID,
nsAtom* aName) {
if (aNamespaceID == kNameSpaceID_None) {
// Transforms:
if (GetTransformListAttrName() == aName) {

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

@ -277,8 +277,8 @@ class SVGElement : public SVGElementBase // nsIContent
return nullptr;
}
mozilla::UniquePtr<nsISMILAttr> GetAnimatedAttr(int32_t aNamespaceID,
nsAtom* aName) override;
mozilla::UniquePtr<SMILAttr> GetAnimatedAttr(int32_t aNamespaceID,
nsAtom* aName) override;
void AnimationNeedsResample();
void FlushAnimations();

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

@ -115,7 +115,7 @@ SVGEnum::DOMAnimatedEnum::~DOMAnimatedEnum() {
sSVGAnimatedEnumTearoffTable.RemoveTearoff(mVal);
}
UniquePtr<nsISMILAttr> SVGEnum::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> SVGEnum::ToSMILAttr(SVGElement* aSVGElement) {
return MakeUnique<SMILEnum>(this, aSVGElement);
}

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

@ -9,8 +9,8 @@
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "nsISMILAttr.h"
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/SVGAnimatedEnumeration.h"
#include "mozilla/dom/SVGElement.h"
@ -55,7 +55,7 @@ class SVGEnum {
already_AddRefed<mozilla::dom::SVGAnimatedEnumeration> ToDOMAnimatedEnum(
SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
SVGEnumValue mAnimVal;
@ -89,18 +89,18 @@ class SVGEnum {
}
};
struct SMILEnum : public nsISMILAttr {
struct SMILEnum : public SMILAttr {
public:
SMILEnum(SVGEnum* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGEnum* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -88,7 +88,7 @@ SVGInteger::DOMAnimatedInteger::~DOMAnimatedInteger() {
sSVGAnimatedIntegerTearoffTable.RemoveTearoff(mVal);
}
UniquePtr<nsISMILAttr> SVGInteger::ToSMILAttr(SVGElement *aSVGElement) {
UniquePtr<SMILAttr> SVGInteger::ToSMILAttr(SVGElement *aSVGElement) {
return MakeUnique<SMILInteger>(this, aSVGElement);
}

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

@ -10,10 +10,10 @@
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "SVGAnimatedInteger.h"
#include "nsISMILAttr.h"
#include "SVGElement.h"
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/SVGElement.h"
namespace mozilla {
@ -52,7 +52,7 @@ class SVGInteger {
already_AddRefed<mozilla::dom::SVGAnimatedInteger> ToDOMAnimatedInteger(
SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
int32_t mAnimVal;
@ -82,18 +82,18 @@ class SVGInteger {
}
};
struct SMILInteger : public nsISMILAttr {
struct SMILInteger : public SMILAttr {
public:
SMILInteger(SVGInteger* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGInteger* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -162,7 +162,7 @@ SVGIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() {
}
}
UniquePtr<nsISMILAttr> SVGIntegerPair::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> SVGIntegerPair::ToSMILAttr(SVGElement* aSVGElement) {
return MakeUnique<SMILIntegerPair>(this, aSVGElement);
}

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

@ -9,8 +9,8 @@
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "nsISMILAttr.h"
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/SVGAnimatedInteger.h"
@ -60,7 +60,7 @@ class SVGIntegerPair {
already_AddRefed<mozilla::dom::SVGAnimatedInteger> ToDOMAnimatedInteger(
PairIndex aIndex, SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
int32_t mAnimVal[2];
@ -94,18 +94,18 @@ class SVGIntegerPair {
}
};
struct SMILIntegerPair : public nsISMILAttr {
struct SMILIntegerPair : public SMILAttr {
public:
SMILIntegerPair(SVGIntegerPair* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGIntegerPair* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -104,14 +104,14 @@ bool SVGMotionSMILAnimationFunction::UnsetAttr(nsAtom* aAttribute) {
return true;
}
SMILAnimationFunction::nsSMILCalcMode
SMILAnimationFunction::SMILCalcMode
SVGMotionSMILAnimationFunction::GetCalcMode() const {
const nsAttrValue* value = GetAttr(nsGkAtoms::calcMode);
if (!value) {
return CALC_PACED; // animateMotion defaults to calcMode="paced"
}
return nsSMILCalcMode(value->GetEnumValue());
return SMILCalcMode(value->GetEnumValue());
}
//----------------------------------------------------------------------
@ -292,7 +292,7 @@ bool SVGMotionSMILAnimationFunction::GenerateValuesForPathAndPoints(
return true;
}
nsresult SVGMotionSMILAnimationFunction::GetValues(const nsISMILAttr& aSMILAttr,
nsresult SVGMotionSMILAnimationFunction::GetValues(const SMILAttr& aSMILAttr,
SMILValueArray& aResult) {
if (mIsPathStale) {
RebuildPathAndVertices(aSMILAttr.GetTargetNode());

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

@ -10,16 +10,16 @@
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "mozilla/SMILAnimationFunction.h"
#include "SVGMotionSMILType.h"
#include "nsTArray.h"
#include "SVGMotionSMILType.h" // for RotateType
class nsAttrValue;
class nsAtom;
class nsIContent;
class nsISMILAttr;
namespace mozilla {
class SMILAttr;
class SMILValue;
namespace dom {
@ -61,8 +61,8 @@ class SVGMotionSMILAnimationFunction final : public SMILAnimationFunction {
ePathSourceType_Mpath
};
virtual nsSMILCalcMode GetCalcMode() const override;
virtual nsresult GetValues(const nsISMILAttr& aSMILAttr,
virtual SMILCalcMode GetCalcMode() const override;
virtual nsresult GetValues(const SMILAttr& aSMILAttr,
SMILValueArray& aResult) override;
virtual void CheckValueListDependentAttrs(uint32_t aNumValues) override;

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

@ -21,7 +21,7 @@ nsresult SVGMotionSMILAttr::ValueFromString(
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
MOZ_ASSERT_UNREACHABLE(
"Shouldn't using nsISMILAttr::ValueFromString for "
"Shouldn't using SMILAttr::ValueFromString for "
"parsing animateMotion's SMIL values.");
return NS_ERROR_FAILURE;
}

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

@ -10,7 +10,7 @@
#define MOZILLA_SVGMOTIONSMILATTR_H_
#include "mozilla/Attributes.h"
#include "nsISMILAttr.h"
#include "mozilla/SMILAttr.h"
class nsIContent;
@ -24,18 +24,18 @@ class SVGElement;
} // namespace dom
/**
* SVGMotionSMILAttr: Implements the nsISMILAttr interface for SMIL animations
* SVGMotionSMILAttr: Implements the SMILAttr interface for SMIL animations
* from <animateMotion>.
*
* NOTE: Even though there's technically no "motion" attribute, we behave in
* many ways as if there were, for simplicity.
*/
class SVGMotionSMILAttr : public nsISMILAttr {
class SVGMotionSMILAttr : public SMILAttr {
public:
explicit SVGMotionSMILAttr(dom::SVGElement* aSVGElement)
: mSVGElement(aSVGElement) {}
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;

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

@ -154,7 +154,7 @@ SVGNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() {
}
}
UniquePtr<nsISMILAttr> SVGNumberPair::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> SVGNumberPair::ToSMILAttr(SVGElement* aSVGElement) {
return MakeUnique<SMILNumberPair>(this, aSVGElement);
}

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

@ -9,11 +9,11 @@
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "nsISMILAttr.h"
#include "nsMathUtils.h"
#include "mozilla/dom/SVGAnimatedNumber.h"
#include "mozilla/Attributes.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
namespace mozilla {
@ -61,7 +61,7 @@ class SVGNumberPair {
already_AddRefed<mozilla::dom::SVGAnimatedNumber> ToDOMAnimatedNumber(
PairIndex aIndex, SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
float mAnimVal[2];
@ -96,18 +96,18 @@ class SVGNumberPair {
}
};
struct SMILNumberPair : public nsISMILAttr {
struct SMILNumberPair : public SMILAttr {
public:
SMILNumberPair(SVGNumberPair* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGNumberPair* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -118,7 +118,7 @@ class SVGPathData {
const float& operator[](uint32_t aIndex) const { return mData[aIndex]; }
// Used by nsSMILCompositor to check if the cached base val is out of date
// Used by SMILCompositor to check if the cached base val is out of date
bool operator==(const SVGPathData& rhs) const {
// We use memcmp so that we don't need to worry that the data encoded in
// the first float may have the same bit pattern as a NaN.

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

@ -230,7 +230,7 @@ void SVGSVGElement::SetCurrentTime(float seconds) {
double fMilliseconds = double(seconds) * PR_MSEC_PER_SEC;
// Round to nearest whole number before converting, to avoid precision
// errors
nsSMILTime lMilliseconds = int64_t(NS_round(fMilliseconds));
SMILTime lMilliseconds = int64_t(NS_round(fMilliseconds));
mTimedDocumentRoot->SetCurrentTime(lMilliseconds);
AnimationNeedsResample();
// Trigger synchronous sample now, to:
@ -526,10 +526,8 @@ SVGElement::EnumAttributesInfo SVGSVGElement::GetEnumInfo() {
void SVGSVGElement::SetImageOverridePreserveAspectRatio(
const SVGPreserveAspectRatio& aPAR) {
#ifdef DEBUG
MOZ_ASSERT(OwnerDoc()->IsBeingUsedAsImage(),
"should only override preserveAspectRatio in images");
#endif
bool hasViewBoxRect = HasViewBoxRect();
if (!hasViewBoxRect && ShouldSynthesizeViewBox()) {
@ -549,10 +547,8 @@ void SVGSVGElement::SetImageOverridePreserveAspectRatio(
}
void SVGSVGElement::ClearImageOverridePreserveAspectRatio() {
#ifdef DEBUG
MOZ_ASSERT(OwnerDoc()->IsBeingUsedAsImage(),
"should only override image preserveAspectRatio in images");
#endif
if (!HasViewBoxRect() && ShouldSynthesizeViewBox()) {
// My non-<svg:image> clients will want to paint me with a synthesized

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

@ -89,7 +89,7 @@ SVGString::DOMAnimatedString::~DOMAnimatedString() {
SVGAnimatedStringTearoffTable().RemoveTearoff(mVal);
}
UniquePtr<nsISMILAttr> SVGString::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> SVGString::ToSMILAttr(SVGElement* aSVGElement) {
return MakeUnique<SMILString>(this, aSVGElement);
}

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

@ -50,7 +50,7 @@ class SVGString {
already_AddRefed<mozilla::dom::SVGAnimatedString> ToDOMAnimatedString(
SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
nsAutoPtr<nsString> mAnimVal;
@ -83,18 +83,18 @@ class SVGString {
private:
virtual ~DOMAnimatedString();
};
struct SMILString : public nsISMILAttr {
struct SMILString : public SMILAttr {
public:
SMILString(SVGString* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGString* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -267,7 +267,7 @@ void SVGViewBox::DOMBaseVal::SetHeight(float aHeight, ErrorResult& aRv) {
mVal->SetBaseValue(rect, mSVGElement);
}
UniquePtr<nsISMILAttr> SVGViewBox::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> SVGViewBox::ToSMILAttr(SVGElement* aSVGElement) {
return MakeUnique<SMILViewBox>(this, aSVGElement);
}

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

@ -12,7 +12,7 @@
#include "nsError.h"
#include "SVGAttrTearoffTable.h"
#include "mozilla/Attributes.h"
#include "nsISMILAttr.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/SVGAnimatedRect.h"
#include "mozilla/dom/SVGIRect.h"
@ -92,7 +92,7 @@ class SVGViewBox {
already_AddRefed<mozilla::dom::SVGIRect> ToDOMAnimVal(
SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
SVGViewBoxRect mBaseVal;
@ -183,18 +183,18 @@ class SVGViewBox {
virtual ~DOMAnimVal();
};
struct SMILViewBox : public nsISMILAttr {
struct SMILViewBox : public SMILAttr {
public:
SMILViewBox(SVGViewBox* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
SVGViewBox* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -414,7 +414,7 @@ SVGAnimatedLength::~SVGAnimatedLength() {
sSVGAnimatedLengthTearoffTable.RemoveTearoff(mVal);
}
UniquePtr<nsISMILAttr> nsSVGLength2::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> nsSVGLength2::ToSMILAttr(SVGElement* aSVGElement) {
return MakeUnique<SMILLength>(this, aSVGElement);
}

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

@ -8,6 +8,7 @@
#define __NS_SVGLENGTH2_H__
#include "mozilla/Attributes.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/SVGContentUtils.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/SVGLengthBinding.h"
@ -16,7 +17,6 @@
#include "nsCoord.h"
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "nsISMILAttr.h"
#include "nsMathUtils.h"
class nsIFrame;
@ -92,6 +92,8 @@ class nsSVGLength2 {
typedef mozilla::dom::SVGElement SVGElement;
typedef mozilla::dom::SVGViewportElement SVGViewportElement;
typedef mozilla::dom::UserSpaceMetrics UserSpaceMetrics;
typedef mozilla::SMILAttr SMILAttr;
typedef mozilla::SMILValue SMILValue;
typedef mozilla::SVGContentUtils SVGContentUtils;
public:
@ -162,7 +164,7 @@ class nsSVGLength2 {
already_AddRefed<mozilla::dom::SVGAnimatedLength> ToDOMAnimatedLength(
SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
float mAnimVal;
@ -198,18 +200,18 @@ class nsSVGLength2 {
already_AddRefed<DOMSVGLength> ToDOMAnimVal(SVGElement* aSVGElement);
public:
struct SMILLength : public nsISMILAttr {
struct SMILLength : public SMILAttr {
public:
SMILLength(nsSVGLength2* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
nsSVGLength2* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -111,7 +111,7 @@ nsSVGNumber2::DOMAnimatedNumber::~DOMAnimatedNumber() {
sSVGAnimatedNumberTearoffTable.RemoveTearoff(mVal);
}
UniquePtr<nsISMILAttr> nsSVGNumber2::ToSMILAttr(SVGElement* aSVGElement) {
UniquePtr<SMILAttr> nsSVGNumber2::ToSMILAttr(SVGElement* aSVGElement) {
return MakeUnique<SMILNumber>(this, aSVGElement);
}

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

@ -9,13 +9,13 @@
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "nsISMILAttr.h"
#include "nsMathUtils.h"
#include "SVGElement.h"
#include "mozilla/Attributes.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/dom/SVGAnimatedNumber.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/SVGAnimatedNumber.h"
#include "mozilla/dom/SVGElement.h"
namespace mozilla {
@ -28,6 +28,8 @@ class SVGAnimationElement;
class nsSVGNumber2 {
public:
typedef mozilla::SMILAttr SMILAttr;
typedef mozilla::SMILValue SMILValue;
typedef mozilla::dom::SVGElement SVGElement;
void Init(uint8_t aAttrEnum = 0xff, float aValue = 0) {
@ -54,7 +56,7 @@ class nsSVGNumber2 {
already_AddRefed<mozilla::dom::SVGAnimatedNumber> ToDOMAnimatedNumber(
SVGElement* aSVGElement);
mozilla::UniquePtr<nsISMILAttr> ToSMILAttr(SVGElement* aSVGElement);
mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
private:
float mAnimVal;
@ -85,18 +87,18 @@ class nsSVGNumber2 {
}
};
struct SMILNumber : public nsISMILAttr {
struct SMILNumber : public SMILAttr {
public:
SMILNumber(nsSVGNumber2* aVal, SVGElement* aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
// These will stay alive because a nsISMILAttr only lives as long
// These will stay alive because a SMILAttr only lives as long
// as the Compositing step, and DOM elements don't get a chance to
// die during that.
nsSVGNumber2* mVal;
SVGElement* mSVGElement;
// nsISMILAttr methods
// SMILAttr methods
virtual nsresult ValueFromString(
const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,

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

@ -45,7 +45,7 @@ DrawTargetD2D1::DrawTargetD2D1()
mTransformedGlyphsSinceLastPurge(0),
mComplexBlendsWithListInList(0),
mDeviceSeq(0),
mIsInitialized(false) {}
mInitState(InitState::Uninitialized) {}
DrawTargetD2D1::~DrawTargetD2D1() {
PopAllClips();
@ -90,7 +90,7 @@ DrawTargetD2D1::~DrawTargetD2D1() {
bool DrawTargetD2D1::IsValid() const {
if (NS_IsMainThread()) {
// Uninitialized DTs are considered valid.
return !mIsInitialized || mDC;
return mInitState != InitState::Failure;
} else {
return const_cast<DrawTargetD2D1 *>(this)->EnsureInitialized();
}
@ -1315,12 +1315,12 @@ void DrawTargetD2D1::FlushInternal(bool aHasDependencyMutex /* = false */) {
}
bool DrawTargetD2D1::EnsureInitialized() {
if (mIsInitialized) {
return !!mDC;
if (mInitState != InitState::Uninitialized) {
return mInitState == InitState::Success;
}
// Don't retry.
mIsInitialized = true;
mInitState = InitState::Failure;
HRESULT hr;
@ -1400,6 +1400,8 @@ bool DrawTargetD2D1::EnsureInitialized() {
mDC->Clear();
}
mInitState = InitState::Success;
return true;
}

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

@ -318,7 +318,12 @@ class DrawTargetD2D1 : public DrawTarget {
bool EnsureLuminanceEffect();
RefPtr<ID2D1Effect> mLuminanceEffect;
bool mIsInitialized;
enum class InitState {
Uninitialized,
Success,
Failure
};
InitState mInitState;
RefPtr<IDXGISurface> mSurface;
};

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

@ -7,7 +7,7 @@ platform(linux,mac) == border-radial-gradient-nine-patch.yaml border-radial-grad
== border-none.yaml border-none-ref.yaml
== border-invisible.yaml border-invisible-ref.yaml
platform(linux,mac) == border-suite.yaml border-suite.png
platform(linux,mac) fuzzy(1,57) == border-suite-2.yaml border-suite-2.png
platform(linux,mac) fuzzy(8,8) == border-suite-2.yaml border-suite-2.png
platform(linux,mac) == border-suite-3.yaml border-suite-3.png
== border-double-simple.yaml border-double-simple-ref.yaml
== border-double-simple-2.yaml border-double-simple-2-ref.yaml

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

@ -2775,10 +2775,9 @@ void TenuringTracer::traverse(T* thingp) {
} // namespace js
template <typename T>
void js::gc::StoreBuffer::MonoTypeBuffer<T>::trace(StoreBuffer* owner,
TenuringTracer& mover) {
mozilla::ReentrancyGuard g(*owner);
MOZ_ASSERT(owner->isEnabled());
void js::gc::StoreBuffer::MonoTypeBuffer<T>::trace(TenuringTracer& mover) {
mozilla::ReentrancyGuard g(*owner_);
MOZ_ASSERT(owner_->isEnabled());
if (last_) {
last_.trace(mover);
}
@ -2790,11 +2789,11 @@ void js::gc::StoreBuffer::MonoTypeBuffer<T>::trace(StoreBuffer* owner,
namespace js {
namespace gc {
template void StoreBuffer::MonoTypeBuffer<StoreBuffer::ValueEdge>::trace(
StoreBuffer*, TenuringTracer&);
TenuringTracer&);
template void StoreBuffer::MonoTypeBuffer<StoreBuffer::SlotsEdge>::trace(
StoreBuffer*, TenuringTracer&);
TenuringTracer&);
template void StoreBuffer::MonoTypeBuffer<StoreBuffer::CellPtrEdge>::trace(
StoreBuffer*, TenuringTracer&);
TenuringTracer&);
} // namespace gc
} // namespace js
@ -2874,9 +2873,8 @@ static void TraceBufferedCells(TenuringTracer& mover, Arena* arena,
}
}
void js::gc::StoreBuffer::WholeCellBuffer::trace(StoreBuffer* owner,
TenuringTracer& mover) {
MOZ_ASSERT(owner->isEnabled());
void js::gc::StoreBuffer::WholeCellBuffer::trace(TenuringTracer& mover) {
MOZ_ASSERT(owner_->isEnabled());
for (ArenaCellSet* cells = head_; cells; cells = cells->next) {
cells->check();

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

@ -17,9 +17,32 @@
using namespace js;
using namespace js::gc;
void StoreBuffer::GenericBuffer::trace(StoreBuffer* owner, JSTracer* trc) {
mozilla::ReentrancyGuard g(*owner);
MOZ_ASSERT(owner->isEnabled());
bool StoreBuffer::WholeCellBuffer::init() {
MOZ_ASSERT(!head_);
if (!storage_) {
storage_ = MakeUnique<LifoAlloc>(LifoAllocBlockSize);
// This prevents LifoAlloc::Enum from crashing with a release
// assertion if we ever allocate one entry larger than
// LifoAllocBlockSize.
if (storage_) {
storage_->disableOversize();
}
}
clear();
return bool(storage_);
}
bool StoreBuffer::GenericBuffer::init() {
if (!storage_) {
storage_ = MakeUnique<LifoAlloc>(LifoAllocBlockSize);
}
clear();
return bool(storage_);
}
void StoreBuffer::GenericBuffer::trace(JSTracer* trc) {
mozilla::ReentrancyGuard g(*owner_);
MOZ_ASSERT(owner_->isEnabled());
if (!storage_) {
return;
}
@ -31,6 +54,25 @@ void StoreBuffer::GenericBuffer::trace(StoreBuffer* owner, JSTracer* trc) {
}
}
StoreBuffer::StoreBuffer(JSRuntime* rt, const Nursery& nursery)
: bufferVal(this),
bufferCell(this),
bufferSlot(this),
bufferWholeCell(this),
bufferGeneric(this),
cancelIonCompilations_(false),
runtime_(rt),
nursery_(nursery),
aboutToOverflow_(false),
enabled_(false)
#ifdef DEBUG
,
mEntered(false)
#endif
{
}
void StoreBuffer::checkEmpty() const {
MOZ_ASSERT(bufferVal.isEmpty());
MOZ_ASSERT(bufferCell.isEmpty());

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

@ -18,6 +18,7 @@
#include "gc/Nursery.h"
#include "js/AllocPolicy.h"
#include "js/MemoryMetrics.h"
#include "js/UniquePtr.h"
namespace js {
namespace gc {
@ -77,10 +78,14 @@ class StoreBuffer {
*/
T last_;
StoreBuffer* owner_;
/* Maximum number of entries before we request a minor GC. */
const static size_t MaxEntries = 48 * 1024 / sizeof(T);
explicit MonoTypeBuffer() : last_(T()) {}
explicit MonoTypeBuffer(StoreBuffer* owner)
: last_(T()), owner_(owner)
{}
void clear() {
last_ = T();
@ -88,13 +93,13 @@ class StoreBuffer {
}
/* Add one item to the buffer. */
void put(StoreBuffer* owner, const T& t) {
sinkStore(owner);
void put(const T& t) {
sinkStore();
last_ = t;
}
/* Remove an item from the store buffer. */
void unput(StoreBuffer* owner, const T& v) {
void unput(const T& v) {
// Fast, hashless remove of last put.
if (last_ == v) {
last_ = T();
@ -104,7 +109,7 @@ class StoreBuffer {
}
/* Move any buffered stores to the canonical store set. */
void sinkStore(StoreBuffer* owner) {
void sinkStore() {
if (last_) {
AutoEnterOOMUnsafeRegion oomUnsafe;
if (!stores_.put(last_)) {
@ -114,17 +119,12 @@ class StoreBuffer {
last_ = T();
if (MOZ_UNLIKELY(stores_.count() > MaxEntries)) {
owner->setAboutToOverflow(T::FullBufferReason);
owner_->setAboutToOverflow(T::FullBufferReason);
}
}
bool has(StoreBuffer* owner, const T& v) {
sinkStore(owner);
return stores_.has(v);
}
/* Trace the source of all edges in the store buffer. */
void trace(StoreBuffer* owner, TenuringTracer& mover);
void trace(TenuringTracer& mover);
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) {
return stores_.shallowSizeOfExcludingThis(mallocSizeOf);
@ -138,26 +138,15 @@ class StoreBuffer {
};
struct WholeCellBuffer {
LifoAlloc* storage_;
UniquePtr<LifoAlloc> storage_;
ArenaCellSet* head_;
StoreBuffer* owner_;
WholeCellBuffer() : storage_(nullptr), head_(nullptr) {}
~WholeCellBuffer() { js_delete(storage_); }
explicit WholeCellBuffer(StoreBuffer* owner)
: storage_(nullptr), head_(nullptr), owner_(owner)
{}
MOZ_MUST_USE bool init() {
MOZ_ASSERT(!head_);
if (!storage_) {
storage_ = js_new<LifoAlloc>(LifoAllocBlockSize);
// This prevents LifoAlloc::Enum from crashing with a release
// assertion if we ever allocate one entry larger than
// LifoAllocBlockSize.
if (storage_) {
storage_->disableOversize();
}
}
clear();
return bool(storage_);
}
MOZ_MUST_USE bool init();
void clear();
@ -166,7 +155,7 @@ class StoreBuffer {
storage_->used() > WholeCellBufferOverflowThresholdBytes;
}
void trace(StoreBuffer* owner, TenuringTracer& mover);
void trace(TenuringTracer& mover);
inline void put(const Cell* cell);
@ -187,25 +176,17 @@ class StoreBuffer {
};
struct GenericBuffer {
LifoAlloc* storage_;
UniquePtr<LifoAlloc> storage_;
StoreBuffer* owner_;
explicit GenericBuffer() : storage_(nullptr) {}
~GenericBuffer() { js_delete(storage_); }
explicit GenericBuffer(StoreBuffer* owner) : storage_(nullptr), owner_(owner) {}
MOZ_MUST_USE bool init() {
if (!storage_) {
storage_ = js_new<LifoAlloc>(LifoAllocBlockSize);
}
clear();
return bool(storage_);
}
MOZ_MUST_USE bool init();
void clear() {
if (!storage_) {
return;
if (storage_) {
storage_->used() ? storage_->releaseAll() : storage_->freeAll();
}
storage_->used() ? storage_->releaseAll() : storage_->freeAll();
}
bool isAboutToOverflow() const {
@ -214,10 +195,10 @@ class StoreBuffer {
}
/* Trace all generic edges. */
void trace(StoreBuffer* owner, JSTracer* trc);
void trace(JSTracer* trc);
template <typename T>
void put(StoreBuffer* owner, const T& t) {
void put(const T& t) {
MOZ_ASSERT(storage_);
/* Ensure T is derived from BufferableRef. */
@ -237,7 +218,7 @@ class StoreBuffer {
}
if (isAboutToOverflow()) {
owner->setAboutToOverflow(JS::GCReason::FULL_GENERIC_BUFFER);
owner_->setAboutToOverflow(JS::GCReason::FULL_GENERIC_BUFFER);
}
}
@ -421,7 +402,7 @@ class StoreBuffer {
return;
}
mozilla::ReentrancyGuard g(*this);
buffer.unput(this, edge);
buffer.unput(edge);
}
template <typename Buffer, typename Edge>
@ -433,7 +414,7 @@ class StoreBuffer {
}
mozilla::ReentrancyGuard g(*this);
if (edge.maybeInRememberedSet(nursery_)) {
buffer.put(this, edge);
buffer.put(edge);
}
}
@ -454,24 +435,7 @@ class StoreBuffer {
#endif
public:
explicit StoreBuffer(JSRuntime* rt, const Nursery& nursery)
: bufferVal(),
bufferCell(),
bufferSlot(),
bufferWholeCell(),
bufferGeneric(),
cancelIonCompilations_(false),
runtime_(rt),
nursery_(nursery),
aboutToOverflow_(false),
enabled_(false)
#ifdef DEBUG
,
mEntered(false)
#endif
{
}
explicit StoreBuffer(JSRuntime* rt, const Nursery& nursery);
MOZ_MUST_USE bool enable();
void disable();
@ -511,13 +475,11 @@ class StoreBuffer {
void setShouldCancelIonCompilations() { cancelIonCompilations_ = true; }
/* Methods to trace the source of all edges in the store buffer. */
void traceValues(TenuringTracer& mover) { bufferVal.trace(this, mover); }
void traceCells(TenuringTracer& mover) { bufferCell.trace(this, mover); }
void traceSlots(TenuringTracer& mover) { bufferSlot.trace(this, mover); }
void traceWholeCells(TenuringTracer& mover) {
bufferWholeCell.trace(this, mover);
}
void traceGenericEntries(JSTracer* trc) { bufferGeneric.trace(this, trc); }
void traceValues(TenuringTracer& mover) { bufferVal.trace(mover); }
void traceCells(TenuringTracer& mover) { bufferCell.trace(mover); }
void traceSlots(TenuringTracer& mover) { bufferSlot.trace(mover); }
void traceWholeCells(TenuringTracer& mover) { bufferWholeCell.trace(mover); }
void traceGenericEntries(JSTracer* trc) { bufferGeneric.trace(trc); }
/* For use by our owned buffers and for testing. */
void setAboutToOverflow(JS::GCReason);

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

@ -761,6 +761,8 @@ static JSObject* MaybeGetDelegate(Cell* cell) {
bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
Cell* value) {
bool ok = true;
DebugOnly<Zone*> zone = map->zone();
MOZ_ASSERT(CurrentThreadCanAccessZone(zone));
MOZ_ASSERT(zone->isGCMarking());
@ -778,7 +780,13 @@ bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
CellColor mapColor =
map->markColor == MarkColor::Black ? CellColor::Black : CellColor::Gray;
MOZ_ASSERT_IF(object, GetCellColor(object) == mapColor);
if (object && GetCellColor(object) != mapColor) {
fprintf(stderr, "WeakMap object is marked differently to the map\n");
fprintf(stderr, "(map %p is %s, object %p is %s)\n",
map, CellColorName(mapColor),
object, CellColorName(GetCellColor(object)));
ok = false;
}
CellColor keyColor = GetCellColor(key);
CellColor valueColor =
@ -789,7 +797,7 @@ bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
fprintf(stderr, "(map %p is %s, key %p is %s, value %p is %s)\n", map,
CellColorName(mapColor), key, CellColorName(keyColor), value,
CellColorName(valueColor));
return false;
ok = false;
}
// Debugger weak maps map have keys in zones that are not or are
@ -797,12 +805,12 @@ bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
// state of these keys.
if (map->allowKeysInOtherZones() &&
!(keyZone->isGCMarking() || keyZone->isGCSweeping())) {
return true;
return ok;
}
JSObject* delegate = MaybeGetDelegate(key);
if (!delegate) {
return true;
return ok;
}
CellColor delegateColor;
@ -818,10 +826,10 @@ bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
fprintf(stderr, "(map %p is %s, delegate %p is %s, key %p is %s)\n", map,
CellColorName(mapColor), delegate, CellColorName(delegateColor),
key, CellColorName(keyColor));
return false;
ok = false;
}
return true;
return ok;
}
#endif // defined(JS_GC_ZEAL) || defined(DEBUG)

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

@ -108,6 +108,14 @@ const ThreadPrefix = 0xfe;
const MozPrefix = 0xff;
// Secondary opcode bytes for misc prefix
const MemoryInitCode = 0x08; // Pending
const DataDropCode = 0x09; // Pending
const MemoryCopyCode = 0x0a; // Pending
const MemoryFillCode = 0x0b; // Pending
const TableInitCode = 0x0c; // Pending
const ElemDropCode = 0x0d; // Pending
const TableCopyCode = 0x0e; // Pending
const StructNew = 0x50; // UNOFFICIAL
const StructGet = 0x51; // UNOFFICIAL
const StructSet = 0x52; // UNOFFICIAL

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

@ -103,7 +103,7 @@ function tab_test_nofail(insn1, insn2) {
//---- memory.{drop,init} -------------------------------------------------
// drop with no memory
mem_test("memory.drop 3", "",
mem_test("data.drop 3", "",
WebAssembly.CompileError, /can't touch memory without memory/,
false);
@ -113,20 +113,20 @@ mem_test("(memory.init 1 (i32.const 1234) (i32.const 1) (i32.const 1))", "",
false);
// drop with data seg ix out of range
mem_test("memory.drop 4", "",
WebAssembly.CompileError, /memory.{drop,init} index out of range/);
mem_test("data.drop 4", "",
WebAssembly.CompileError, /data.drop segment index out of range/);
// init with data seg ix out of range
mem_test("(memory.init 4 (i32.const 1234) (i32.const 1) (i32.const 1))", "",
WebAssembly.CompileError, /memory.{drop,init} index out of range/);
WebAssembly.CompileError, /memory.init segment index out of range/);
// drop with data seg ix indicating an active segment
mem_test("memory.drop 2", "",
WebAssembly.RuntimeError, /use of invalid passive data segment/);
mem_test("data.drop 2", "",
WebAssembly.RuntimeError, /use of dropped data segment/);
// init with data seg ix indicating an active segment
mem_test("(memory.init 2 (i32.const 1234) (i32.const 1) (i32.const 1))", "",
WebAssembly.RuntimeError, /use of invalid passive data segment/);
WebAssembly.RuntimeError, /use of dropped data segment/);
// init, using a data seg ix more than once is OK
mem_test_nofail(
@ -134,14 +134,14 @@ mem_test_nofail(
"(memory.init 1 (i32.const 4321) (i32.const 1) (i32.const 1))");
// drop, then drop
mem_test("memory.drop 1",
"memory.drop 1",
WebAssembly.RuntimeError, /use of invalid passive data segment/);
mem_test("data.drop 1",
"data.drop 1",
WebAssembly.RuntimeError, /use of dropped data segment/);
// drop, then init
mem_test("memory.drop 1",
mem_test("data.drop 1",
"(memory.init 1 (i32.const 1234) (i32.const 1) (i32.const 1))",
WebAssembly.RuntimeError, /use of invalid passive data segment/);
WebAssembly.RuntimeError, /use of dropped data segment/);
// init: seg ix is valid passive, but length to copy > len of seg
mem_test("",
@ -169,7 +169,7 @@ mem_test("",
WebAssembly.RuntimeError, /index out of bounds/);
// drop: too many args
mem_test("memory.drop 1 (i32.const 42)", "",
mem_test("data.drop 1 (i32.const 42)", "",
WebAssembly.CompileError,
/unused values not explicitly dropped by end of block/);
@ -201,8 +201,8 @@ mem_test("(memory.init 1 (i32.const 1) (i32.const 1))", "",
//---- table.{drop,init} --------------------------------------------------
// drop with no table
tab_test("table.drop 3", "",
WebAssembly.CompileError, /can't table.drop without a table/,
tab_test("elem.drop 3", "",
WebAssembly.CompileError, /can't elem.drop without a table/,
false);
// init with no table
@ -211,20 +211,20 @@ tab_test("(table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))", "",
false);
// drop with elem seg ix out of range
tab_test("table.drop 4", "",
WebAssembly.CompileError, /element segment index out of range for table.drop/);
tab_test("elem.drop 4", "",
WebAssembly.CompileError, /element segment index out of range for elem.drop/);
// init with elem seg ix out of range
tab_test("(table.init 4 (i32.const 12) (i32.const 1) (i32.const 1))", "",
WebAssembly.CompileError, /table.init segment index out of range/);
// drop with elem seg ix indicating an active segment
tab_test("table.drop 2", "",
WebAssembly.RuntimeError, /use of invalid passive element segment/);
tab_test("elem.drop 2", "",
WebAssembly.RuntimeError, /use of dropped element segment/);
// init with elem seg ix indicating an active segment
tab_test("(table.init 2 (i32.const 12) (i32.const 1) (i32.const 1))", "",
WebAssembly.RuntimeError, /use of invalid passive element segment/);
WebAssembly.RuntimeError, /use of dropped element segment/);
// init, using an elem seg ix more than once is OK
tab_test_nofail(
@ -232,14 +232,14 @@ tab_test_nofail(
"(table.init 1 (i32.const 21) (i32.const 1) (i32.const 1))");
// drop, then drop
tab_test("table.drop 1",
"table.drop 1",
WebAssembly.RuntimeError, /use of invalid passive element segment/);
tab_test("elem.drop 1",
"elem.drop 1",
WebAssembly.RuntimeError, /use of dropped element segment/);
// drop, then init
tab_test("table.drop 1",
tab_test("elem.drop 1",
"(table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))",
WebAssembly.RuntimeError, /use of invalid passive element segment/);
WebAssembly.RuntimeError, /use of dropped element segment/);
// init: seg ix is valid passive, but length to copy > len of seg
tab_test("",
@ -267,7 +267,7 @@ tab_test("",
WebAssembly.RuntimeError, /index out of bounds/);
// drop: too many args
tab_test("table.drop 1 (i32.const 42)", "",
tab_test("elem.drop 1 (i32.const 42)", "",
WebAssembly.CompileError,
/unused values not explicitly dropped by end of block/);

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

@ -1,5 +1,10 @@
// |jit-test| skip-if: !wasmBulkMemSupported()
load(libdir + "wasm-binary.js");
const v2vSig = {args:[], ret:VoidCode};
const v2vSigSection = sigSection([v2vSig]);
const Module = WebAssembly.Module;
const Instance = WebAssembly.Instance;
@ -146,9 +151,9 @@ tab_test("(table.init 3 (i32.const 15) (i32.const 1) (i32.const 3))",
// Perform active and passive initialisation and then multiple copies
tab_test("(table.init 1 (i32.const 7) (i32.const 0) (i32.const 4)) \n" +
"table.drop 1 \n" +
"elem.drop 1 \n" +
"(table.init 3 (i32.const 15) (i32.const 1) (i32.const 3)) \n" +
"table.drop 3 \n" +
"elem.drop 3 \n" +
"(table.copy (i32.const 20) (i32.const 15) (i32.const 5)) \n" +
"(table.copy (i32.const 21) (i32.const 29) (i32.const 1)) \n" +
"(table.copy (i32.const 24) (i32.const 10) (i32.const 1)) \n" +
@ -243,9 +248,9 @@ mem_test("(memory.init 3 (i32.const 15) (i32.const 1) (i32.const 3))",
// Perform active and passive initialisation and then multiple copies
mem_test("(memory.init 1 (i32.const 7) (i32.const 0) (i32.const 4)) \n" +
"memory.drop 1 \n" +
"data.drop 1 \n" +
"(memory.init 3 (i32.const 15) (i32.const 1) (i32.const 3)) \n" +
"memory.drop 3 \n" +
"data.drop 3 \n" +
"(memory.copy (i32.const 20) (i32.const 15) (i32.const 5)) \n" +
"(memory.copy (i32.const 21) (i32.const 29) (i32.const 1)) \n" +
"(memory.copy (i32.const 24) (i32.const 10) (i32.const 1)) \n" +
@ -253,100 +258,51 @@ mem_test("(memory.init 1 (i32.const 7) (i32.const 0) (i32.const 4)) \n" +
"(memory.copy (i32.const 19) (i32.const 20) (i32.const 5))",
[e,e,3,1,4, 1,e,2,7,1, 8,e,7,e,7, 5,2,7,e,9, e,7,e,8,8, e,e,e,e,e]);
// DataCount section is present but value is too low for the number of data segments
assertErrorMessage(() => wasmEvalText(
`(module
(datacount 1)
(data passive "")
(data passive ""))`),
WebAssembly.CompileError,
/number of data segments does not match declared count/);
// DataCount section is present but value is too high for the number of data segments
assertErrorMessage(() => wasmEvalText(
`(module
(datacount 3)
(data passive "")
(data passive ""))`),
WebAssembly.CompileError,
/number of data segments does not match declared count/);
// DataCount section is not present but memory.init or data.drop uses it
function checkNoDataCount(body, err) {
let binary = moduleWithSections(
[v2vSigSection,
declSection([0]),
memorySection(1),
bodySection(
[funcBody({locals:[], body})])]);
assertErrorMessage(() => new WebAssembly.Module(binary),
WebAssembly.CompileError,
err);
}
checkNoDataCount([I32ConstCode, 0,
I32ConstCode, 0,
I32ConstCode, 0,
MiscPrefix, MemoryInitCode, 0, 0],
/memory.init requires a DataCount section/);
checkNoDataCount([MiscPrefix, DataDropCode, 0],
/data.drop requires a DataCount section/);
//---------------------------------------------------------------------//
//---------------------------------------------------------------------//
// Some further tests for memory.copy and memory.fill. First, validation
// tests.
//-----------------------------------------------------------
// Test helpers. Copied and simplified from binary.js.
load(libdir + "wasm-binary.js");
function toU8(array) {
for (let b of array)
assertEq(b < 256, true);
return Uint8Array.from(array);
}
function varU32(u32) {
assertEq(u32 >= 0, true);
assertEq(u32 < Math.pow(2,32), true);
var bytes = [];
do {
var byte = u32 & 0x7f;
u32 >>>= 7;
if (u32 != 0)
byte |= 0x80;
bytes.push(byte);
} while (u32 != 0);
return bytes;
}
function moduleHeaderThen(...rest) {
return [magic0, magic1, magic2, magic3, ver0, ver1, ver2, ver3, ...rest];
}
function moduleWithSections(sectionArray) {
var bytes = moduleHeaderThen();
for (let section of sectionArray) {
bytes.push(section.name);
bytes.push(...varU32(section.body.length));
bytes.push(...section.body);
}
return toU8(bytes);
}
function sigSection(sigs) {
var body = [];
body.push(...varU32(sigs.length));
for (let sig of sigs) {
body.push(...varU32(FuncCode));
body.push(...varU32(sig.args.length));
for (let arg of sig.args)
body.push(...varU32(arg));
body.push(...varU32(sig.ret == VoidCode ? 0 : 1));
if (sig.ret != VoidCode)
body.push(...varU32(sig.ret));
}
return { name: typeId, body };
}
function declSection(decls) {
var body = [];
body.push(...varU32(decls.length));
for (let decl of decls)
body.push(...varU32(decl));
return { name: functionId, body };
}
function funcBody(func) {
var body = varU32(func.locals.length);
for (let local of func.locals)
body.push(...varU32(local));
body = body.concat(...func.body);
body.push(EndCode);
body.splice(0, 0, ...varU32(body.length));
return body;
}
function bodySection(bodies) {
var body = varU32(bodies.length).concat(...bodies);
return { name: codeId, body };
}
function memorySection(initialSize) {
var body = [];
body.push(...varU32(1)); // number of memories
body.push(...varU32(0x0)); // for now, no maximum
body.push(...varU32(initialSize));
return { name: memoryId, body };
}
const v2vSig = {args:[], ret:VoidCode};
const v2vSigSection = sigSection([v2vSig]);
// Prefixed opcodes
function checkMiscPrefixed(opcode, expect_failure) {
@ -355,7 +311,9 @@ function checkMiscPrefixed(opcode, expect_failure) {
bodySection(
[funcBody(
{locals:[],
body:[0x41, 0x0, 0x41, 0x0, 0x41, 0x0, // 3 x const.i32 0
body:[I32ConstCode, 0x0,
I32ConstCode, 0x0,
I32ConstCode, 0x0,
MiscPrefix, ...opcode]})])]);
if (expect_failure) {
assertErrorMessage(() => new WebAssembly.Module(binary),
@ -368,9 +326,9 @@ function checkMiscPrefixed(opcode, expect_failure) {
//-----------------------------------------------------------
// Verification cases for memory.copy/fill opcode encodings
checkMiscPrefixed([0x0a, 0x00], false); // memory.copy, flags=0
checkMiscPrefixed([0x0b, 0x00], false); // memory.fill, flags=0
checkMiscPrefixed([0x0b, 0x80, 0x00], false); // memory.fill, flags=0 (long encoding)
checkMiscPrefixed([MemoryCopyCode, 0x00, 0x00], false); // memory.copy src=0 dest=0
checkMiscPrefixed([MemoryFillCode, 0x00], false); // memory.fill mem=0
checkMiscPrefixed([MemoryFillCode, 0x80, 0x00], false); // memory.fill, mem=0 (long encoding)
checkMiscPrefixed([0x13], true); // table.size+1, which is currently unassigned
//-----------------------------------------------------------

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

@ -229,6 +229,7 @@ JitCode* BaselineCacheIRCompiler::compile() {
}
bool BaselineCacheIRCompiler::emitGuardShape() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
Register obj = allocator.useRegister(masm, objId);
AutoScratchRegister scratch1(allocator, masm);
@ -259,6 +260,7 @@ bool BaselineCacheIRCompiler::emitGuardShape() {
}
bool BaselineCacheIRCompiler::emitGuardGroup() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
Register obj = allocator.useRegister(masm, objId);
AutoScratchRegister scratch1(allocator, masm);
@ -289,6 +291,7 @@ bool BaselineCacheIRCompiler::emitGuardGroup() {
}
bool BaselineCacheIRCompiler::emitGuardProto() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -304,6 +307,7 @@ bool BaselineCacheIRCompiler::emitGuardProto() {
}
bool BaselineCacheIRCompiler::emitGuardCompartment() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -327,6 +331,7 @@ bool BaselineCacheIRCompiler::emitGuardCompartment() {
}
bool BaselineCacheIRCompiler::emitGuardAnyClass() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
Register obj = allocator.useRegister(masm, objId);
AutoScratchRegister scratch(allocator, masm);
@ -349,6 +354,7 @@ bool BaselineCacheIRCompiler::emitGuardAnyClass() {
}
bool BaselineCacheIRCompiler::emitGuardHasProxyHandler() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -366,6 +372,7 @@ bool BaselineCacheIRCompiler::emitGuardHasProxyHandler() {
}
bool BaselineCacheIRCompiler::emitGuardSpecificObject() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
FailurePath* failure;
@ -379,6 +386,7 @@ bool BaselineCacheIRCompiler::emitGuardSpecificObject() {
}
bool BaselineCacheIRCompiler::emitGuardSpecificAtom() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register str = allocator.useRegister(masm, reader.stringOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -426,6 +434,7 @@ bool BaselineCacheIRCompiler::emitGuardSpecificAtom() {
}
bool BaselineCacheIRCompiler::emitGuardSpecificSymbol() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register sym = allocator.useRegister(masm, reader.symbolOperandId());
FailurePath* failure;
@ -439,12 +448,14 @@ bool BaselineCacheIRCompiler::emitGuardSpecificSymbol() {
}
bool BaselineCacheIRCompiler::emitLoadValueResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
masm.loadValue(stubAddress(reader.stubOffset()), output.valueReg());
return true;
}
bool BaselineCacheIRCompiler::emitLoadFixedSlotResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -455,6 +466,7 @@ bool BaselineCacheIRCompiler::emitLoadFixedSlotResult() {
}
bool BaselineCacheIRCompiler::emitLoadDynamicSlotResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -467,6 +479,7 @@ bool BaselineCacheIRCompiler::emitLoadDynamicSlotResult() {
}
bool BaselineCacheIRCompiler::emitGuardHasGetterSetter() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Address shapeAddr = stubAddress(reader.stubOffset());
@ -499,6 +512,7 @@ bool BaselineCacheIRCompiler::emitGuardHasGetterSetter() {
}
bool BaselineCacheIRCompiler::emitCallScriptedGetterResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Address getterAddr(stubAddress(reader.stubOffset()));
bool isCrossRealm = reader.readBool();
@ -572,6 +586,7 @@ static const VMFunction CallNativeGetterInfo =
FunctionInfo<CallNativeGetterFn>(CallNativeGetter, "CallNativeGetter");
bool BaselineCacheIRCompiler::emitCallNativeGetterResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Address getterAddr(stubAddress(reader.stubOffset()));
@ -597,6 +612,7 @@ bool BaselineCacheIRCompiler::emitCallNativeGetterResult() {
}
bool BaselineCacheIRCompiler::emitCallProxyGetResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Address idAddr(stubAddress(reader.stubOffset()));
@ -622,6 +638,7 @@ bool BaselineCacheIRCompiler::emitCallProxyGetResult() {
}
bool BaselineCacheIRCompiler::emitCallProxyGetByValueResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
ValueOperand idVal = allocator.useValueRegister(masm, reader.valOperandId());
@ -644,6 +661,7 @@ bool BaselineCacheIRCompiler::emitCallProxyGetByValueResult() {
}
bool BaselineCacheIRCompiler::emitCallProxyHasPropResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
ValueOperand idVal = allocator.useValueRegister(masm, reader.valOperandId());
bool hasOwn = reader.readBool();
@ -673,6 +691,7 @@ bool BaselineCacheIRCompiler::emitCallProxyHasPropResult() {
}
bool BaselineCacheIRCompiler::emitCallNativeGetElementResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
@ -696,6 +715,7 @@ bool BaselineCacheIRCompiler::emitCallNativeGetElementResult() {
}
bool BaselineCacheIRCompiler::emitLoadUnboxedPropertyResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -709,6 +729,7 @@ bool BaselineCacheIRCompiler::emitLoadUnboxedPropertyResult() {
}
bool BaselineCacheIRCompiler::emitGuardFrameHasNoArgumentsObject() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
FailurePath* failure;
if (!addFailurePath(&failure)) {
return false;
@ -722,6 +743,7 @@ bool BaselineCacheIRCompiler::emitGuardFrameHasNoArgumentsObject() {
}
bool BaselineCacheIRCompiler::emitLoadFrameCalleeResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -732,6 +754,7 @@ bool BaselineCacheIRCompiler::emitLoadFrameCalleeResult() {
}
bool BaselineCacheIRCompiler::emitLoadFrameNumActualArgsResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -742,6 +765,7 @@ bool BaselineCacheIRCompiler::emitLoadFrameNumActualArgsResult() {
}
bool BaselineCacheIRCompiler::emitLoadTypedObjectResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch1(allocator, masm);
@ -764,6 +788,7 @@ bool BaselineCacheIRCompiler::emitLoadTypedObjectResult() {
}
bool BaselineCacheIRCompiler::emitLoadFrameArgumentResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register index = allocator.useRegister(masm, reader.int32OperandId());
AutoScratchRegister scratch1(allocator, masm);
@ -788,6 +813,7 @@ bool BaselineCacheIRCompiler::emitLoadFrameArgumentResult() {
}
bool BaselineCacheIRCompiler::emitLoadEnvironmentFixedSlotResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -809,6 +835,7 @@ bool BaselineCacheIRCompiler::emitLoadEnvironmentFixedSlotResult() {
}
bool BaselineCacheIRCompiler::emitLoadEnvironmentDynamicSlotResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -832,6 +859,7 @@ bool BaselineCacheIRCompiler::emitLoadEnvironmentDynamicSlotResult() {
}
bool BaselineCacheIRCompiler::emitLoadStringResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -841,6 +869,7 @@ bool BaselineCacheIRCompiler::emitLoadStringResult() {
}
bool BaselineCacheIRCompiler::emitCallStringSplitResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register str = allocator.useRegister(masm, reader.stringOperandId());
Register sep = allocator.useRegister(masm, reader.stringOperandId());
Address groupAddr(stubAddress(reader.stubOffset()));
@ -868,6 +897,7 @@ bool BaselineCacheIRCompiler::emitCallStringSplitResult() {
}
bool BaselineCacheIRCompiler::emitCompareStringResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register left = allocator.useRegister(masm, reader.stringOperandId());
@ -967,6 +997,7 @@ bool BaselineCacheIRCompiler::callTypeUpdateIC(
}
bool BaselineCacheIRCompiler::emitStoreSlotShared(bool isFixed) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
Address offsetAddr = stubAddress(reader.stubOffset());
@ -1007,14 +1038,17 @@ bool BaselineCacheIRCompiler::emitStoreSlotShared(bool isFixed) {
}
bool BaselineCacheIRCompiler::emitStoreFixedSlot() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
return emitStoreSlotShared(true);
}
bool BaselineCacheIRCompiler::emitStoreDynamicSlot() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
return emitStoreSlotShared(false);
}
bool BaselineCacheIRCompiler::emitAddAndStoreSlotShared(CacheOp op) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
Address offsetAddr = stubAddress(reader.stubOffset());
@ -1114,18 +1148,22 @@ bool BaselineCacheIRCompiler::emitAddAndStoreSlotShared(CacheOp op) {
}
bool BaselineCacheIRCompiler::emitAddAndStoreFixedSlot() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
return emitAddAndStoreSlotShared(CacheOp::AddAndStoreFixedSlot);
}
bool BaselineCacheIRCompiler::emitAddAndStoreDynamicSlot() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
return emitAddAndStoreSlotShared(CacheOp::AddAndStoreDynamicSlot);
}
bool BaselineCacheIRCompiler::emitAllocateAndStoreDynamicSlot() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
return emitAddAndStoreSlotShared(CacheOp::AllocateAndStoreDynamicSlot);
}
bool BaselineCacheIRCompiler::emitStoreUnboxedProperty() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
JSValueType fieldType = reader.valueType();
Address offsetAddr = stubAddress(reader.stubOffset());
@ -1165,6 +1203,7 @@ bool BaselineCacheIRCompiler::emitStoreUnboxedProperty() {
}
bool BaselineCacheIRCompiler::emitStoreTypedObjectReferenceProperty() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
Address offsetAddr = stubAddress(reader.stubOffset());
TypedThingLayout layout = reader.typedThingLayout();
@ -1201,6 +1240,7 @@ bool BaselineCacheIRCompiler::emitStoreTypedObjectReferenceProperty() {
}
bool BaselineCacheIRCompiler::emitStoreTypedObjectScalarProperty() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Address offsetAddr = stubAddress(reader.stubOffset());
TypedThingLayout layout = reader.typedThingLayout();
@ -1224,6 +1264,7 @@ bool BaselineCacheIRCompiler::emitStoreTypedObjectScalarProperty() {
}
bool BaselineCacheIRCompiler::emitStoreDenseElement() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
Int32OperandId indexId = reader.int32OperandId();
@ -1301,6 +1342,7 @@ bool BaselineCacheIRCompiler::emitStoreDenseElement() {
}
bool BaselineCacheIRCompiler::emitStoreDenseElementHole() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
Int32OperandId indexId = reader.int32OperandId();
@ -1448,6 +1490,7 @@ bool BaselineCacheIRCompiler::emitStoreDenseElementHole() {
}
bool BaselineCacheIRCompiler::emitArrayPush() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
ValOperandId rhsId = reader.valOperandId();
@ -1561,6 +1604,7 @@ bool BaselineCacheIRCompiler::emitArrayPush() {
}
bool BaselineCacheIRCompiler::emitStoreTypedElement() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -1616,6 +1660,7 @@ static const VMFunction CallNativeSetterInfo =
FunctionInfo<CallNativeSetterFn>(CallNativeSetter, "CallNativeSetter");
bool BaselineCacheIRCompiler::emitCallNativeSetter() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Address setterAddr(stubAddress(reader.stubOffset()));
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -1643,6 +1688,7 @@ bool BaselineCacheIRCompiler::emitCallNativeSetter() {
}
bool BaselineCacheIRCompiler::emitCallScriptedSetter() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoScratchRegister scratch1(allocator, masm);
AutoScratchRegister scratch2(allocator, masm);
@ -1721,6 +1767,7 @@ bool BaselineCacheIRCompiler::emitCallScriptedSetter() {
}
bool BaselineCacheIRCompiler::emitCallSetArrayLength() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
bool strict = reader.readBool();
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -1745,6 +1792,7 @@ bool BaselineCacheIRCompiler::emitCallSetArrayLength() {
}
bool BaselineCacheIRCompiler::emitCallProxySet() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
Address idAddr(stubAddress(reader.stubOffset()));
@ -1774,6 +1822,7 @@ bool BaselineCacheIRCompiler::emitCallProxySet() {
}
bool BaselineCacheIRCompiler::emitCallProxySetByValue() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
ValueOperand idVal = allocator.useValueRegister(masm, reader.valOperandId());
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -1808,6 +1857,7 @@ bool BaselineCacheIRCompiler::emitCallProxySetByValue() {
}
bool BaselineCacheIRCompiler::emitCallAddOrUpdateSparseElementHelper() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register id = allocator.useRegister(masm, reader.int32OperandId());
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -1832,6 +1882,7 @@ bool BaselineCacheIRCompiler::emitCallAddOrUpdateSparseElementHelper() {
}
bool BaselineCacheIRCompiler::emitCallGetSparseElementResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register id = allocator.useRegister(masm, reader.int32OperandId());
AutoScratchRegister scratch(allocator, masm);
@ -1852,6 +1903,7 @@ bool BaselineCacheIRCompiler::emitCallGetSparseElementResult() {
}
bool BaselineCacheIRCompiler::emitMegamorphicSetElement() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
ValueOperand idVal = allocator.useValueRegister(masm, reader.valOperandId());
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -1887,18 +1939,21 @@ bool BaselineCacheIRCompiler::emitMegamorphicSetElement() {
}
bool BaselineCacheIRCompiler::emitTypeMonitorResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
allocator.discardStack(masm);
EmitEnterTypeMonitorIC(masm);
return true;
}
bool BaselineCacheIRCompiler::emitReturnFromIC() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
allocator.discardStack(masm);
EmitReturnFromIC(masm);
return true;
}
bool BaselineCacheIRCompiler::emitLoadStackValue() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValueOperand val = allocator.defineValueRegister(masm, reader.valOperandId());
Address addr =
allocator.addressOf(masm, BaselineFrameSlot(reader.uint32Immediate()));
@ -1907,6 +1962,7 @@ bool BaselineCacheIRCompiler::emitLoadStackValue() {
}
bool BaselineCacheIRCompiler::emitGuardAndGetIterator() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch1(allocator, masm);
@ -1955,6 +2011,7 @@ bool BaselineCacheIRCompiler::emitGuardAndGetIterator() {
}
bool BaselineCacheIRCompiler::emitGuardDOMExpandoMissingOrGuardShape() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
AutoScratchRegister shapeScratch(allocator, masm);
AutoScratchRegister objScratch(allocator, masm);
@ -1981,6 +2038,7 @@ bool BaselineCacheIRCompiler::emitGuardDOMExpandoMissingOrGuardShape() {
}
bool BaselineCacheIRCompiler::emitLoadDOMExpandoValueGuardGeneration() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Address expandoAndGenerationAddr(stubAddress(reader.stubOffset()));
Address generationAddr(stubAddress(reader.stubOffset()));
@ -2324,6 +2382,7 @@ uint8_t* ICCacheIR_Updated::stubDataStart() {
}
bool BaselineCacheIRCompiler::emitCallStringConcatResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.stringOperandId());
Register rhs = allocator.useRegister(masm, reader.stringOperandId());
@ -2348,6 +2407,7 @@ bool BaselineCacheIRCompiler::emitCallStringConcatResult() {
}
bool BaselineCacheIRCompiler::emitCallStringObjectConcatResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValueOperand lhs = allocator.useValueRegister(masm, reader.valOperandId());
ValueOperand rhs = allocator.useValueRegister(masm, reader.valOperandId());

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

@ -1264,6 +1264,7 @@ bool CacheIRCompiler::addFailurePath(FailurePath** failure) {
}
bool CacheIRCompiler::emitFailurePath(size_t index) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
FailurePath& failure = failurePaths[index];
allocator.setStackPushed(failure.stackPushed());
@ -1282,6 +1283,7 @@ bool CacheIRCompiler::emitFailurePath(size_t index) {
}
bool CacheIRCompiler::emitGuardIsNumber() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
JSValueType knownType = allocator.knownType(inputId);
@ -1301,6 +1303,7 @@ bool CacheIRCompiler::emitGuardIsNumber() {
}
bool CacheIRCompiler::emitGuardIsObject() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
if (allocator.knownType(inputId) == JSVAL_TYPE_OBJECT) {
return true;
@ -1316,6 +1319,7 @@ bool CacheIRCompiler::emitGuardIsObject() {
}
bool CacheIRCompiler::emitGuardIsNullOrUndefined() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
JSValueType knownType = allocator.knownType(inputId);
if (knownType == JSVAL_TYPE_UNDEFINED || knownType == JSVAL_TYPE_NULL) {
@ -1337,6 +1341,7 @@ bool CacheIRCompiler::emitGuardIsNullOrUndefined() {
}
bool CacheIRCompiler::emitGuardIsNotNullOrUndefined() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
JSValueType knownType = allocator.knownType(inputId);
if (knownType == JSVAL_TYPE_UNDEFINED || knownType == JSVAL_TYPE_NULL) {
@ -1356,6 +1361,7 @@ bool CacheIRCompiler::emitGuardIsNotNullOrUndefined() {
}
bool CacheIRCompiler::emitGuardIsNull() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
JSValueType knownType = allocator.knownType(inputId);
if (knownType == JSVAL_TYPE_NULL) {
@ -1374,6 +1380,7 @@ bool CacheIRCompiler::emitGuardIsNull() {
}
bool CacheIRCompiler::emitGuardIsUndefined() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
JSValueType knownType = allocator.knownType(inputId);
if (knownType == JSVAL_TYPE_UNDEFINED) {
@ -1391,6 +1398,7 @@ bool CacheIRCompiler::emitGuardIsUndefined() {
}
bool CacheIRCompiler::emitGuardIsObjectOrNull() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
JSValueType knownType = allocator.knownType(inputId);
if (knownType == JSVAL_TYPE_OBJECT || knownType == JSVAL_TYPE_NULL) {
@ -1411,6 +1419,7 @@ bool CacheIRCompiler::emitGuardIsObjectOrNull() {
}
bool CacheIRCompiler::emitGuardIsBoolean() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
Register output = allocator.defineRegister(masm, reader.int32OperandId());
@ -1432,6 +1441,7 @@ bool CacheIRCompiler::emitGuardIsBoolean() {
}
bool CacheIRCompiler::emitGuardIsString() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
if (allocator.knownType(inputId) == JSVAL_TYPE_STRING) {
return true;
@ -1447,6 +1457,7 @@ bool CacheIRCompiler::emitGuardIsString() {
}
bool CacheIRCompiler::emitGuardIsSymbol() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
if (allocator.knownType(inputId) == JSVAL_TYPE_SYMBOL) {
return true;
@ -1462,6 +1473,7 @@ bool CacheIRCompiler::emitGuardIsSymbol() {
}
bool CacheIRCompiler::emitGuardIsInt32() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
Register output = allocator.defineRegister(masm, reader.int32OperandId());
@ -1483,6 +1495,7 @@ bool CacheIRCompiler::emitGuardIsInt32() {
}
bool CacheIRCompiler::emitGuardIsInt32Index() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
Register output = allocator.defineRegister(masm, reader.int32OperandId());
@ -1533,6 +1546,7 @@ bool CacheIRCompiler::emitGuardIsInt32Index() {
}
bool CacheIRCompiler::emitGuardType() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValOperandId inputId = reader.valOperandId();
JSValueType type = reader.valueType();
@ -1577,6 +1591,7 @@ bool CacheIRCompiler::emitGuardType() {
}
bool CacheIRCompiler::emitGuardClass() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
Register obj = allocator.useRegister(masm, objId);
AutoScratchRegister scratch(allocator, masm);
@ -1618,6 +1633,7 @@ bool CacheIRCompiler::emitGuardClass() {
}
bool CacheIRCompiler::emitGuardIsExtensible() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -1645,6 +1661,7 @@ bool CacheIRCompiler::emitGuardIsExtensible() {
}
bool CacheIRCompiler::emitGuardIsNativeFunction() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
JSNative nativeFunc = reinterpret_cast<JSNative>(reader.pointer());
AutoScratchRegister scratch(allocator, masm);
@ -1667,6 +1684,7 @@ bool CacheIRCompiler::emitGuardIsNativeFunction() {
}
bool CacheIRCompiler::emitGuardFunctionPrototype() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register prototypeObject = allocator.useRegister(masm, reader.objOperandId());
@ -1694,6 +1712,7 @@ bool CacheIRCompiler::emitGuardFunctionPrototype() {
}
bool CacheIRCompiler::emitGuardIsNativeObject() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -1707,6 +1726,7 @@ bool CacheIRCompiler::emitGuardIsNativeObject() {
}
bool CacheIRCompiler::emitGuardIsProxy() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -1720,6 +1740,7 @@ bool CacheIRCompiler::emitGuardIsProxy() {
}
bool CacheIRCompiler::emitGuardNotDOMProxy() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -1735,6 +1756,7 @@ bool CacheIRCompiler::emitGuardNotDOMProxy() {
}
bool CacheIRCompiler::emitGuardSpecificInt32Immediate() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register reg = allocator.useRegister(masm, reader.int32OperandId());
int32_t ival = reader.int32Immediate();
Assembler::Condition cond = (Assembler::Condition)reader.readByte();
@ -1750,6 +1772,7 @@ bool CacheIRCompiler::emitGuardSpecificInt32Immediate() {
}
bool CacheIRCompiler::emitGuardMagicValue() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
JSWhyMagic magic = reader.whyMagic();
@ -1763,6 +1786,7 @@ bool CacheIRCompiler::emitGuardMagicValue() {
}
bool CacheIRCompiler::emitGuardNoUnboxedExpando() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
FailurePath* failure;
@ -1777,6 +1801,7 @@ bool CacheIRCompiler::emitGuardNoUnboxedExpando() {
}
bool CacheIRCompiler::emitGuardAndLoadUnboxedExpando() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register output = allocator.defineRegister(masm, reader.objOperandId());
@ -1792,6 +1817,7 @@ bool CacheIRCompiler::emitGuardAndLoadUnboxedExpando() {
}
bool CacheIRCompiler::emitGuardNoDetachedTypedObjects() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
FailurePath* failure;
if (!addFailurePath(&failure)) {
return false;
@ -1807,6 +1833,7 @@ bool CacheIRCompiler::emitGuardNoDetachedTypedObjects() {
}
bool CacheIRCompiler::emitGuardNoDenseElements() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegister scratch(allocator, masm);
@ -1825,6 +1852,7 @@ bool CacheIRCompiler::emitGuardNoDenseElements() {
}
bool CacheIRCompiler::emitGuardAndGetNumberFromString() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register str = allocator.useRegister(masm, reader.stringOperandId());
ValueOperand output =
allocator.defineValueRegister(masm, reader.valOperandId());
@ -1887,6 +1915,7 @@ bool CacheIRCompiler::emitGuardAndGetNumberFromString() {
}
bool CacheIRCompiler::emitGuardAndGetIndexFromString() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register str = allocator.useRegister(masm, reader.stringOperandId());
Register output = allocator.defineRegister(masm, reader.int32OperandId());
@ -1923,6 +1952,7 @@ bool CacheIRCompiler::emitGuardAndGetIndexFromString() {
}
bool CacheIRCompiler::emitLoadProto() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register reg = allocator.defineRegister(masm, reader.objOperandId());
masm.loadObjProto(obj, reg);
@ -1930,6 +1960,7 @@ bool CacheIRCompiler::emitLoadProto() {
}
bool CacheIRCompiler::emitLoadEnclosingEnvironment() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register reg = allocator.defineRegister(masm, reader.objOperandId());
masm.unboxObject(
@ -1938,6 +1969,7 @@ bool CacheIRCompiler::emitLoadEnclosingEnvironment() {
}
bool CacheIRCompiler::emitLoadWrapperTarget() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register reg = allocator.defineRegister(masm, reader.objOperandId());
@ -1948,6 +1980,7 @@ bool CacheIRCompiler::emitLoadWrapperTarget() {
}
bool CacheIRCompiler::emitLoadValueTag() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
Register res = allocator.defineRegister(masm, reader.valueTagOperandId());
@ -1959,6 +1992,7 @@ bool CacheIRCompiler::emitLoadValueTag() {
}
bool CacheIRCompiler::emitLoadDOMExpandoValue() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
ValueOperand val = allocator.defineValueRegister(masm, reader.valOperandId());
@ -1971,6 +2005,7 @@ bool CacheIRCompiler::emitLoadDOMExpandoValue() {
}
bool CacheIRCompiler::emitLoadDOMExpandoValueIgnoreGeneration() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
ValueOperand output =
allocator.defineValueRegister(masm, reader.valOperandId());
@ -1999,6 +2034,7 @@ bool CacheIRCompiler::emitLoadDOMExpandoValueIgnoreGeneration() {
}
bool CacheIRCompiler::emitLoadUndefinedResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
if (output.hasValue()) {
masm.moveValue(UndefinedValue(), output.valueReg());
@ -2020,6 +2056,7 @@ static void EmitStoreBoolean(MacroAssembler& masm, bool b,
}
bool CacheIRCompiler::emitLoadBooleanResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
bool b = reader.readBool();
EmitStoreBoolean(masm, b, output);
@ -2046,6 +2083,7 @@ static void EmitStoreResult(MacroAssembler& masm, Register reg,
}
bool CacheIRCompiler::emitLoadInt32ArrayLengthResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -2065,6 +2103,7 @@ bool CacheIRCompiler::emitLoadInt32ArrayLengthResult() {
}
bool CacheIRCompiler::emitDoubleAddResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
// Float register must be preserved. The BinaryArith ICs use
@ -2079,6 +2118,7 @@ bool CacheIRCompiler::emitDoubleAddResult() {
return true;
}
bool CacheIRCompiler::emitDoubleSubResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
allocator.ensureDoubleRegister(masm, reader.valOperandId(), FloatReg0);
@ -2090,6 +2130,7 @@ bool CacheIRCompiler::emitDoubleSubResult() {
return true;
}
bool CacheIRCompiler::emitDoubleMulResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
allocator.ensureDoubleRegister(masm, reader.valOperandId(), FloatReg0);
@ -2101,6 +2142,7 @@ bool CacheIRCompiler::emitDoubleMulResult() {
return true;
}
bool CacheIRCompiler::emitDoubleDivResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
allocator.ensureDoubleRegister(masm, reader.valOperandId(), FloatReg0);
@ -2112,6 +2154,7 @@ bool CacheIRCompiler::emitDoubleDivResult() {
return true;
}
bool CacheIRCompiler::emitDoubleModResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -2137,6 +2180,7 @@ bool CacheIRCompiler::emitDoubleModResult() {
}
bool CacheIRCompiler::emitInt32AddResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
Register rhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2152,6 +2196,7 @@ bool CacheIRCompiler::emitInt32AddResult() {
return true;
}
bool CacheIRCompiler::emitInt32SubResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
Register rhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2168,6 +2213,7 @@ bool CacheIRCompiler::emitInt32SubResult() {
}
bool CacheIRCompiler::emitInt32MulResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
Register rhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2195,6 +2241,7 @@ bool CacheIRCompiler::emitInt32MulResult() {
}
bool CacheIRCompiler::emitInt32DivResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
Register rhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2227,6 +2274,7 @@ bool CacheIRCompiler::emitInt32DivResult() {
}
bool CacheIRCompiler::emitInt32ModResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
Register rhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2258,6 +2306,7 @@ bool CacheIRCompiler::emitInt32ModResult() {
}
bool CacheIRCompiler::emitInt32BitOrResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2269,6 +2318,7 @@ bool CacheIRCompiler::emitInt32BitOrResult() {
return true;
}
bool CacheIRCompiler::emitInt32BitXorResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2280,6 +2330,7 @@ bool CacheIRCompiler::emitInt32BitXorResult() {
return true;
}
bool CacheIRCompiler::emitInt32BitAndResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2291,6 +2342,7 @@ bool CacheIRCompiler::emitInt32BitAndResult() {
return true;
}
bool CacheIRCompiler::emitInt32LeftShiftResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
Register rhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2304,6 +2356,7 @@ bool CacheIRCompiler::emitInt32LeftShiftResult() {
}
bool CacheIRCompiler::emitInt32RightShiftResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
Register rhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2317,6 +2370,7 @@ bool CacheIRCompiler::emitInt32RightShiftResult() {
}
bool CacheIRCompiler::emitInt32URightShiftResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register lhs = allocator.useRegister(masm, reader.int32OperandId());
@ -2351,6 +2405,7 @@ bool CacheIRCompiler::emitInt32URightShiftResult() {
}
bool CacheIRCompiler::emitInt32NegationResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register val = allocator.useRegister(masm, reader.int32OperandId());
@ -2402,6 +2457,7 @@ bool CacheIRCompiler::emitInt32DecResult() {
}
bool CacheIRCompiler::emitInt32NotResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register val = allocator.useRegister(masm, reader.int32OperandId());
masm.not32(val);
@ -2410,6 +2466,7 @@ bool CacheIRCompiler::emitInt32NotResult() {
}
bool CacheIRCompiler::emitDoubleNegationResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -2491,6 +2548,7 @@ bool CacheIRCompiler::emitDoubleDecResult() {
}
bool CacheIRCompiler::emitTruncateDoubleToUInt32() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
Register res = allocator.defineRegister(masm, reader.int32OperandId());
@ -2538,6 +2596,7 @@ bool CacheIRCompiler::emitTruncateDoubleToUInt32() {
}
bool CacheIRCompiler::emitLoadArgumentsObjectLengthResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -2564,6 +2623,7 @@ bool CacheIRCompiler::emitLoadArgumentsObjectLengthResult() {
}
bool CacheIRCompiler::emitLoadFunctionLengthResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -2615,6 +2675,7 @@ bool CacheIRCompiler::emitLoadFunctionLengthResult() {
}
bool CacheIRCompiler::emitLoadStringLengthResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register str = allocator.useRegister(masm, reader.stringOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -2625,6 +2686,7 @@ bool CacheIRCompiler::emitLoadStringLengthResult() {
}
bool CacheIRCompiler::emitLoadStringCharResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register str = allocator.useRegister(masm, reader.stringOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
@ -2652,6 +2714,7 @@ bool CacheIRCompiler::emitLoadStringCharResult() {
}
bool CacheIRCompiler::emitLoadArgumentsObjectArgResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
@ -2694,6 +2757,7 @@ bool CacheIRCompiler::emitLoadArgumentsObjectArgResult() {
}
bool CacheIRCompiler::emitLoadDenseElementResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
@ -2720,6 +2784,7 @@ bool CacheIRCompiler::emitLoadDenseElementResult() {
}
bool CacheIRCompiler::emitGuardIndexIsNonNegative() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register index = allocator.useRegister(masm, reader.int32OperandId());
FailurePath* failure;
@ -2732,6 +2797,7 @@ bool CacheIRCompiler::emitGuardIndexIsNonNegative() {
}
bool CacheIRCompiler::emitGuardIndexGreaterThanDenseInitLength() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
AutoScratchRegister scratch(allocator, masm);
@ -2756,6 +2822,7 @@ bool CacheIRCompiler::emitGuardIndexGreaterThanDenseInitLength() {
}
bool CacheIRCompiler::emitGuardIndexGreaterThanDenseCapacity() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
AutoScratchRegister scratch(allocator, masm);
@ -2780,6 +2847,7 @@ bool CacheIRCompiler::emitGuardIndexGreaterThanDenseCapacity() {
}
bool CacheIRCompiler::emitGuardIndexGreaterThanArrayLength() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
AutoScratchRegister scratch(allocator, masm);
@ -2803,6 +2871,7 @@ bool CacheIRCompiler::emitGuardIndexGreaterThanArrayLength() {
}
bool CacheIRCompiler::emitGuardIndexIsValidUpdateOrAdd() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
AutoScratchRegister scratch(allocator, masm);
@ -2833,6 +2902,7 @@ bool CacheIRCompiler::emitGuardIndexIsValidUpdateOrAdd() {
}
bool CacheIRCompiler::emitGuardTagNotEqual() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register lhs = allocator.useRegister(masm, reader.valueTagOperandId());
Register rhs = allocator.useRegister(masm, reader.valueTagOperandId());
@ -2855,6 +2925,7 @@ bool CacheIRCompiler::emitGuardTagNotEqual() {
}
bool CacheIRCompiler::emitGuardXrayExpandoShapeAndDefaultProto() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
bool hasExpando = reader.readBool();
StubFieldOffset shapeWrapper(reader.stubOffset(), StubField::Type::JSObject);
@ -2914,6 +2985,7 @@ bool CacheIRCompiler::emitGuardXrayExpandoShapeAndDefaultProto() {
}
bool CacheIRCompiler::emitGuardNoAllocationMetadataBuilder() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
FailurePath* failure;
if (!addFailurePath(&failure)) {
return false;
@ -2927,6 +2999,7 @@ bool CacheIRCompiler::emitGuardNoAllocationMetadataBuilder() {
}
bool CacheIRCompiler::emitGuardObjectGroupNotPretenured() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoScratchRegister scratch(allocator, masm);
FailurePath* failure;
@ -2942,6 +3015,7 @@ bool CacheIRCompiler::emitGuardObjectGroupNotPretenured() {
}
bool CacheIRCompiler::emitLoadDenseElementHoleResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
@ -2984,6 +3058,7 @@ bool CacheIRCompiler::emitLoadDenseElementHoleResult() {
}
bool CacheIRCompiler::emitLoadTypedElementExistsResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
@ -3006,6 +3081,7 @@ bool CacheIRCompiler::emitLoadTypedElementExistsResult() {
}
bool CacheIRCompiler::emitLoadDenseElementExistsResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
@ -3032,6 +3108,7 @@ bool CacheIRCompiler::emitLoadDenseElementExistsResult() {
}
bool CacheIRCompiler::emitLoadDenseElementHoleExistsResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
@ -3069,6 +3146,7 @@ bool CacheIRCompiler::emitLoadDenseElementHoleExistsResult() {
}
bool CacheIRCompiler::emitArrayJoinResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
ObjOperandId objId = reader.objOperandId();
AutoOutputRegister output(*this);
@ -3116,6 +3194,7 @@ bool CacheIRCompiler::emitArrayJoinResult() {
}
bool CacheIRCompiler::emitLoadTypedElementResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Register index = allocator.useRegister(masm, reader.int32OperandId());
@ -3179,6 +3258,7 @@ bool CacheIRCompiler::emitLoadTypedElementResult() {
void CacheIRCompiler::emitLoadTypedObjectResultShared(
const Address& fieldAddr, Register scratch, uint32_t typeDescr,
const AutoOutputRegister& output) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
MOZ_ASSERT(output.hasValue());
if (SimpleTypeDescrKeyIsScalar(typeDescr)) {
@ -3219,6 +3299,7 @@ void CacheIRCompiler::emitLoadTypedObjectResultShared(
}
bool CacheIRCompiler::emitLoadObjectResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
@ -3232,6 +3313,7 @@ bool CacheIRCompiler::emitLoadObjectResult() {
}
bool CacheIRCompiler::emitLoadTypeOfObjectResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -3277,6 +3359,7 @@ bool CacheIRCompiler::emitLoadTypeOfObjectResult() {
}
bool CacheIRCompiler::emitLoadInt32TruthyResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -3293,6 +3376,7 @@ bool CacheIRCompiler::emitLoadInt32TruthyResult() {
}
bool CacheIRCompiler::emitLoadStringTruthyResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register str = allocator.useRegister(masm, reader.stringOperandId());
@ -3310,6 +3394,7 @@ bool CacheIRCompiler::emitLoadStringTruthyResult() {
}
bool CacheIRCompiler::emitLoadDoubleTruthyResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -3337,6 +3422,7 @@ bool CacheIRCompiler::emitLoadDoubleTruthyResult() {
}
bool CacheIRCompiler::emitLoadObjectTruthyResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -3364,6 +3450,7 @@ bool CacheIRCompiler::emitLoadObjectTruthyResult() {
}
bool CacheIRCompiler::emitLoadNewObjectFromTemplateResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
AutoScratchRegister obj(allocator, masm);
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
@ -3386,6 +3473,7 @@ bool CacheIRCompiler::emitLoadNewObjectFromTemplateResult() {
}
bool CacheIRCompiler::emitComparePointerResultShared(bool symbol) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register left = symbol ? allocator.useRegister(masm, reader.symbolOperandId())
@ -3411,14 +3499,17 @@ bool CacheIRCompiler::emitComparePointerResultShared(bool symbol) {
}
bool CacheIRCompiler::emitCompareObjectResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
return emitComparePointerResultShared(false);
}
bool CacheIRCompiler::emitCompareSymbolResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
return emitComparePointerResultShared(true);
}
bool CacheIRCompiler::emitCompareInt32Result() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register left = allocator.useRegister(masm, reader.int32OperandId());
Register right = allocator.useRegister(masm, reader.int32OperandId());
@ -3437,6 +3528,7 @@ bool CacheIRCompiler::emitCompareInt32Result() {
}
bool CacheIRCompiler::emitCompareDoubleResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
FailurePath* failure;
@ -3460,6 +3552,7 @@ bool CacheIRCompiler::emitCompareDoubleResult() {
}
bool CacheIRCompiler::emitCompareObjectUndefinedNullResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
@ -3489,12 +3582,14 @@ bool CacheIRCompiler::emitCompareObjectUndefinedNullResult() {
}
bool CacheIRCompiler::emitCallPrintString() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
const char* str = reinterpret_cast<char*>(reader.pointer());
masm.printf(str);
return true;
}
bool CacheIRCompiler::emitBreakpoint() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
masm.breakpoint();
return true;
}
@ -3503,6 +3598,7 @@ void CacheIRCompiler::emitStoreTypedObjectReferenceProp(ValueOperand val,
ReferenceType type,
const Address& dest,
Register scratch) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
// Callers will post-barrier this store.
switch (type) {
@ -3537,6 +3633,7 @@ void CacheIRCompiler::emitStoreTypedObjectReferenceProp(ValueOperand val,
void CacheIRCompiler::emitRegisterEnumerator(Register enumeratorsList,
Register iter, Register scratch) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
// iter->next = list
masm.storePtr(enumeratorsList, Address(iter, NativeIterator::offsetOfNext()));
@ -3556,6 +3653,7 @@ void CacheIRCompiler::emitPostBarrierShared(Register obj,
const ConstantOrRegister& val,
Register scratch,
Register maybeIndex) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
if (!cx_->nursery().exists()) {
return;
}
@ -3607,6 +3705,7 @@ void CacheIRCompiler::emitPostBarrierShared(Register obj,
}
bool CacheIRCompiler::emitWrapResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
AutoScratchRegister scratch(allocator, masm);
@ -3647,6 +3746,7 @@ bool CacheIRCompiler::emitWrapResult() {
}
bool CacheIRCompiler::emitMegamorphicLoadSlotByValueResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
@ -3708,6 +3808,7 @@ bool CacheIRCompiler::emitMegamorphicLoadSlotByValueResult() {
}
bool CacheIRCompiler::emitMegamorphicHasPropResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
@ -3763,6 +3864,7 @@ bool CacheIRCompiler::emitMegamorphicHasPropResult() {
}
bool CacheIRCompiler::emitCallObjectHasSparseElementResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
@ -3813,6 +3915,7 @@ bool CacheIRCompiler::emitCallObjectHasSparseElementResult() {
*/
void CacheIRCompiler::emitLoadStubFieldConstant(StubFieldOffset val,
Register dest) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
MOZ_ASSERT(mode_ == Mode::Ion);
switch (val.getStubFieldType()) {
case StubField::Type::Shape:
@ -3845,6 +3948,7 @@ void CacheIRCompiler::emitLoadStubFieldConstant(StubFieldOffset val,
* constants in the IC.
*/
void CacheIRCompiler::emitLoadStubField(StubFieldOffset val, Register dest) {
JitSpew(JitSpew_Codegen, __FUNCTION__);
if (stubFieldPolicy_ == StubFieldPolicy::Constant) {
emitLoadStubFieldConstant(val, dest);
} else {
@ -3854,6 +3958,7 @@ void CacheIRCompiler::emitLoadStubField(StubFieldOffset val, Register dest) {
}
bool CacheIRCompiler::emitLoadInstanceOfObjectResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
ValueOperand lhs = allocator.useValueRegister(masm, reader.valOperandId());
Register proto = allocator.useRegister(masm, reader.objOperandId());
@ -3899,6 +4004,7 @@ bool CacheIRCompiler::emitLoadInstanceOfObjectResult() {
}
bool CacheIRCompiler::emitMegamorphicLoadSlotResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
Register obj = allocator.useRegister(masm, reader.objOperandId());
@ -3956,6 +4062,7 @@ bool CacheIRCompiler::emitMegamorphicLoadSlotResult() {
}
bool CacheIRCompiler::emitMegamorphicStoreSlot() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register obj = allocator.useRegister(masm, reader.objOperandId());
StubFieldOffset name(reader.stubOffset(), StubField::Type::String);
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
@ -4004,6 +4111,7 @@ bool CacheIRCompiler::emitMegamorphicStoreSlot() {
}
bool CacheIRCompiler::emitGuardGroupHasUnanalyzedNewScript() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
StubFieldOffset group(reader.stubOffset(), StubField::Type::ObjectGroup);
AutoScratchRegister scratch1(allocator, masm);
AutoScratchRegister scratch2(allocator, masm);
@ -4019,6 +4127,7 @@ bool CacheIRCompiler::emitGuardGroupHasUnanalyzedNewScript() {
}
bool CacheIRCompiler::emitLoadObject() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register reg = allocator.defineRegister(masm, reader.objOperandId());
StubFieldOffset obj(reader.stubOffset(), StubField::Type::JSObject);
emitLoadStubField(obj, reg);
@ -4026,6 +4135,7 @@ bool CacheIRCompiler::emitLoadObject() {
}
bool CacheIRCompiler::emitCallInt32ToString() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
Register input = allocator.useRegister(masm, reader.int32OperandId());
Register result = allocator.defineRegister(masm, reader.stringOperandId());
@ -4053,6 +4163,7 @@ bool CacheIRCompiler::emitCallInt32ToString() {
}
bool CacheIRCompiler::emitCallNumberToString() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
// Float register must be preserved. The BinaryArith ICs use
// the fact that baseline has them available, as well as fixed temps on
// LBinaryCache.
@ -4118,6 +4229,7 @@ void js::jit::LoadTypedThingLength(MacroAssembler& masm,
}
bool CacheIRCompiler::emitCallIsSuspendedGeneratorResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
AutoOutputRegister output(*this);
AutoScratchRegisterMaybeOutput scratch(allocator, masm, output);
AutoScratchRegister scratch2(allocator, masm);

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