From ad93d158ffedf36cb374c3be9b321f90079fd1fc Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 29 Jan 2013 17:53:53 -0500 Subject: [PATCH] Bug 835417 part 3. Add the notion of aliasing DOM stuff to MIR and flag MGetDOMProperty with the right alias set if it's pure. r=jandem --- js/src/ion/MIR.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index 4d95f21e7bd..0aa55b40bda 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -196,10 +196,11 @@ class AliasSet { DynamicSlot = 1 << 2, // A member of obj->slots. FixedSlot = 1 << 3, // A member of obj->fixedSlots(). TypedArrayElement = 1 << 4, // A typed array element. - Last = TypedArrayElement, + DOMProperty = 1 << 5, // A DOM property + Last = DOMProperty, Any = Last | (Last - 1), - NumCategories = 5, + NumCategories = 6, // Indicates load or store. Store_ = 1 << 31 @@ -5394,7 +5395,7 @@ class MGetDOMProperty setOperand(1, guard); // We are movable iff the jitinfo says we can be. - if (jitinfo->isConstant) + if (jitinfo->isPure) setMovable(); setResultType(MIRType_Value); @@ -5422,6 +5423,9 @@ class MGetDOMProperty bool isDomConstant() const { return info_->isConstant; } + bool isDomPure() const { + return info_->isPure; + } MDefinition *object() { return getOperand(0); } @@ -5431,7 +5435,7 @@ class MGetDOMProperty } bool congruentTo(MDefinition *const &ins) const { - if (!isDomConstant()) + if (!isDomPure()) return false; if (!ins->isGetDOMProperty()) @@ -5449,6 +5453,10 @@ class MGetDOMProperty // conflict with anything if (isDomConstant()) return AliasSet::None(); + // Pure DOM attributes can only alias things that alias the world or + // explicitly alias DOM properties. + if (isDomPure()) + return AliasSet::Load(AliasSet::DOMProperty); return AliasSet::Store(AliasSet::Any); }