Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index dbf61835f8c2c76fd1b01fbc3e7a64a9f6e32cc3..a59e262488bacd8fddbc5e4b44819da9acd53588 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -6518,15 +6518,19 @@ 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 { |
+ // This is a store of either an undefined value to a field or a hole/NaN to |
+ // an entry of a newly allocated object. |
+ PREINITIALIZING_STORE, |
+ // The entry could be either previously initialized or not. |
INITIALIZING_STORE, |
+ // At the time of this store it is guaranteed that the entry is already |
+ // initialized. |
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); |
@@ -6633,12 +6637,17 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
HStoreNamedField(HValue* obj, |
HObjectAccess access, |
HValue* val, |
- StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE) |
+ StoreFieldOrKeyedMode store_mode) |
: access_(access), |
new_space_dominator_(NULL), |
write_barrier_mode_(UPDATE_WRITE_BARRIER), |
has_transition_(false), |
store_mode_(store_mode) { |
+ // PREINITIALIZING_STORE is only used to mark stores that initialize a |
+ // memory region resulting from HAllocate (possibly through an |
+ // HInnerAllocatedObject). |
+ ASSERT(store_mode != PREINITIALIZING_STORE || |
+ obj->IsAllocate() || obj->IsInnerAllocatedObject()); |
SetOperandAt(0, obj); |
SetOperandAt(1, val); |
SetOperandAt(2, obj); |
@@ -6649,7 +6658,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; |
+ StoreFieldOrKeyedMode store_mode_ : 2; |
}; |
@@ -6694,8 +6703,6 @@ class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> { |
class HStoreKeyed V8_FINAL |
: public HTemplateInstruction<3>, public ArrayInstructionInterface { |
public: |
- DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, |
- ElementsKind); |
DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, |
ElementsKind, StoreFieldOrKeyedMode); |
@@ -6815,7 +6822,7 @@ class HStoreKeyed V8_FINAL |
private: |
HStoreKeyed(HValue* obj, HValue* key, HValue* val, |
ElementsKind elements_kind, |
- StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE) |
+ StoreFieldOrKeyedMode store_mode) |
: elements_kind_(elements_kind), |
index_offset_(0), |
is_dehoisted_(false), |
@@ -6826,6 +6833,12 @@ class HStoreKeyed V8_FINAL |
SetOperandAt(1, key); |
SetOperandAt(2, val); |
+ // PREINITIALIZING_STORE is only used to mark stores that initialize a |
+ // memory region resulting from HAllocate (possibly through an |
+ // HInnerAllocatedObject). |
+ ASSERT(store_mode != PREINITIALIZING_STORE || |
+ obj->IsAllocate() || obj->IsInnerAllocatedObject()); |
+ |
ASSERT(store_mode != STORE_TO_INITIALIZED_ENTRY || |
elements_kind == FAST_SMI_ELEMENTS); |
@@ -6860,7 +6873,7 @@ class HStoreKeyed V8_FINAL |
uint32_t index_offset_; |
bool is_dehoisted_ : 1; |
bool is_uninitialized_ : 1; |
- StoreFieldOrKeyedMode store_mode_: 1; |
+ StoreFieldOrKeyedMode store_mode_: 2; |
HValue* new_space_dominator_; |
}; |