Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 4dd24fd871552456a10bb77ab8f6a0e4b4b25138..93b3758df8fdbfe670a943f5fe3e6f044c5e3544 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -6512,10 +6512,20 @@ class HLoadKeyedGeneric V8_FINAL : public HTemplateInstruction<3> { |
}; |
+// Indicates whether the store is a store to an entry that was previously |
+// initialized or not. |
+enum StoreFieldOrKeyedMode { |
+ INITIALIZING_STORE, |
+ STORE_TO_INITIALIZED_ENTRY |
+}; |
+ |
+ |
class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
public: |
DECLARE_INSTRUCTION_FACTORY_P3(HStoreNamedField, HValue*, |
HObjectAccess, HValue*); |
+ DECLARE_INSTRUCTION_FACTORY_P4(HStoreNamedField, HValue*, |
+ HObjectAccess, HValue*, StoreFieldOrKeyedMode); |
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField) |
@@ -6536,8 +6546,12 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
field_representation().IsUInteger16() || |
field_representation().IsInteger32()) { |
return Representation::Integer32(); |
- } else if (field_representation().IsDouble() || |
- field_representation().IsSmi()) { |
+ } else if (field_representation().IsDouble()) { |
+ return field_representation(); |
+ } else if (field_representation().IsSmi()) { |
+ if (SmiValuesAre32Bits() && store_mode_ == STORE_TO_INITIALIZED_ENTRY) { |
+ return Representation::Integer32(); |
+ } |
return field_representation(); |
} else if (field_representation().IsExternal()) { |
return Representation::External(); |
@@ -6564,6 +6578,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
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()) { |
@@ -6614,11 +6629,13 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
private: |
HStoreNamedField(HValue* obj, |
HObjectAccess access, |
- HValue* val) |
+ HValue* val, |
+ StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE) |
: access_(access), |
new_space_dominator_(NULL), |
write_barrier_mode_(UPDATE_WRITE_BARRIER), |
- has_transition_(false) { |
+ has_transition_(false), |
+ store_mode_(store_mode) { |
SetOperandAt(0, obj); |
SetOperandAt(1, val); |
SetOperandAt(2, obj); |
@@ -6629,6 +6646,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
HValue* new_space_dominator_; |
WriteBarrierMode write_barrier_mode_ : 1; |
bool has_transition_ : 1; |
+ StoreFieldOrKeyedMode store_mode_ : 1; |
}; |