Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 65fc4df4bd8ec35883577a8c4899332a1736dafe..3770254ac5d1e27c65070d4ecae9ed599f0f0258 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -183,6 +183,7 @@ class LChunkBuilder; |
V(Calls) \ |
V(InobjectFields) \ |
V(BackingStoreFields) \ |
+ V(ElementsKind) \ |
V(ArrayElements) \ |
V(DoubleArrayElements) \ |
V(SpecializedArrayElements) \ |
@@ -621,8 +622,14 @@ class HValue: public ZoneObject { |
void SetAllSideEffects() { flags_ |= AllSideEffects(); } |
void ClearAllSideEffects() { flags_ &= ~AllSideEffects(); } |
bool HasSideEffects() const { return (flags_ & AllSideEffects()) != 0; } |
+ bool HasObservableSideEffects() const { |
+ return (flags_ & ObservableSideEffects()) != 0; |
+ } |
int ChangesFlags() const { return flags_ & ChangesFlagsMask(); } |
+ int ObservableChangesFlags() const { |
+ return flags_ & ChangesFlagsMask() & ObservableSideEffects(); |
+ } |
Range* range() const { return range_; } |
bool HasRange() const { return range_ != NULL; } |
@@ -702,6 +709,12 @@ class HValue: public ZoneObject { |
return ChangesFlagsMask() & ~(1 << kChangesOsrEntries); |
} |
+ // A flag mask of all side effects that can make observable changes in |
+ // an executing program (i.e. are not safe to repeat, move or remove); |
+ static int ObservableSideEffects() { |
+ return ChangesFlagsMask() & ~(1 << kChangesElementsKind); |
+ } |
+ |
// Remove the matching use from the use list if present. Returns the |
// removed list node or NULL. |
HUseListNode* RemoveUse(HValue* value, int index); |
@@ -1739,7 +1752,7 @@ class HElementsKind: public HUnaryOperation { |
explicit HElementsKind(HValue* value) : HUnaryOperation(value) { |
set_representation(Representation::Integer32()); |
SetFlag(kUseGVN); |
- SetFlag(kDependsOnMaps); |
+ SetFlag(kDependsOnElementsKind); |
} |
virtual Representation RequiredInputRepresentation(int index) { |
@@ -1866,6 +1879,7 @@ class HLoadElements: public HUnaryOperation { |
set_representation(Representation::Tagged()); |
SetFlag(kUseGVN); |
SetFlag(kDependsOnMaps); |
+ SetFlag(kDependsOnElementsKind); |
} |
virtual Representation RequiredInputRepresentation(int index) { |
@@ -3915,7 +3929,7 @@ class HTransitionElementsKind: public HTemplateInstruction<1> { |
transitioned_map_(transitioned_map) { |
SetOperandAt(0, object); |
SetFlag(kUseGVN); |
- SetFlag(kDependsOnMaps); |
+ SetFlag(kChangesElementsKind); |
set_representation(Representation::Tagged()); |
} |