Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 37f735a1a883c31a7f6ab99844f521b8833721c4..918229b1ae11f8e9141944139fdac15f0f7c813d 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -6656,7 +6656,7 @@ enum StoreFieldOrKeyedMode { |
}; |
-class HStoreNamedField V8_FINAL : public HTemplateInstruction<2> { |
+class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
public: |
DECLARE_INSTRUCTION_FACTORY_P3(HStoreNamedField, HValue*, |
HObjectAccess, HValue*); |
@@ -6706,12 +6706,30 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<2> { |
HValue* object() const { return OperandAt(0); } |
HValue* value() const { return OperandAt(1); } |
+ HValue* transition() const { return OperandAt(2); } |
HObjectAccess access() const { return access_; } |
HValue* new_space_dominator() const { return new_space_dominator_; } |
+ bool has_transition() const { return has_transition_; } |
StoreFieldOrKeyedMode store_mode() const { return store_mode_; } |
+ Handle<Map> transition_map() const { |
+ if (has_transition()) { |
+ return Handle<Map>::cast( |
+ HConstant::cast(transition())->handle(Isolate::Current())); |
+ } else { |
+ return Handle<Map>(); |
+ } |
+ } |
+ |
+ void SetTransition(HConstant* transition) { |
+ ASSERT(!has_transition()); // Only set once. |
+ SetOperandAt(2, transition); |
+ has_transition_ = true; |
+ } |
+ |
bool NeedsWriteBarrier() { |
+ ASSERT(!field_representation().IsDouble() || !has_transition()); |
if (field_representation().IsDouble()) return false; |
if (field_representation().IsSmi()) return false; |
if (field_representation().IsInteger32()) return false; |
@@ -6721,6 +6739,11 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<2> { |
new_space_dominator()); |
} |
+ bool NeedsWriteBarrierForMap() { |
+ return ReceiverObjectNeedsWriteBarrier(object(), transition(), |
+ new_space_dominator()); |
+ } |
+ |
Representation field_representation() const { |
return access_.representation(); |
} |
@@ -6736,6 +6759,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<2> { |
StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE) |
: access_(access), |
new_space_dominator_(NULL), |
+ has_transition_(false), |
store_mode_(store_mode) { |
// Stores to a non existing in-object property are allowed only to the |
// newly allocated objects (via HAllocate or HInnerAllocatedObject). |
@@ -6743,11 +6767,13 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<2> { |
obj->IsAllocate() || obj->IsInnerAllocatedObject()); |
SetOperandAt(0, obj); |
SetOperandAt(1, val); |
+ SetOperandAt(2, obj); |
access.SetGVNFlags(this, STORE); |
} |
HObjectAccess access_; |
HValue* new_space_dominator_; |
+ bool has_transition_ : 1; |
StoreFieldOrKeyedMode store_mode_ : 1; |
}; |