Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: src/hydrogen-instructions.h

Issue 143413019: Load elimination fix with a test case. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Making store_mode parameter of HStoreNamedField explicit. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index dbf61835f8c2c76fd1b01fbc3e7a64a9f6e32cc3..2d6a92dbfeeb85b70ced84301e4dfa1b530da05d 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,15 @@ 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 stores are made only to just allocated objects.
+ ASSERT(store_mode != PREINITIALIZING_STORE ||
+ obj->IsAllocate() || obj->IsInnerAllocatedObject());
SetOperandAt(0, obj);
SetOperandAt(1, val);
SetOperandAt(2, obj);
@@ -6649,7 +6656,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;
};
@@ -6860,7 +6867,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_;
};
« src/hydrogen.cc ('K') | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698