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

Unified Diff: src/hydrogen.cc

Issue 108503004: HStoreKeyed for Smis optimized for x64 + related redundant moves of elements removed (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A couple of static asserts added Created 7 years 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.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 176dd9fa77a04f8c401cef6fd8da191bd736cefa..6375f66d7d33f377e9225f031e41a5d7b5b9c56d 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1296,7 +1296,8 @@ HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object,
ElementsKind kind,
HValue* length,
HValue* key,
- bool is_js_array) {
+ bool is_js_array,
+ bool is_store) {
IfBuilder length_checker(this);
Token::Value token = IsHoleyElementsKind(kind) ? Token::GTE : Token::EQ;
@@ -1339,6 +1340,13 @@ HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object,
new_length);
}
+ if (is_store && IsFastPackedSmiElementsKind(kind)) {
+ HValue* checked_elements = environment()->Top();
+
+ // Write zero to ensure that the new element is initialized with some smi.
+ Add<HStoreKeyed>(checked_elements, key, graph()->GetConstant0(), kind);
+ }
+
length_checker.Else();
Add<HBoundsCheck>(key, length);
@@ -2102,8 +2110,9 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
NoObservableSideEffectsScope no_effects(this);
elements = BuildCheckForCapacityGrow(checked_object, elements,
elements_kind, length, key,
- is_js_array);
+ is_js_array, is_store);
checked_key = key;
+
Toon Verwaest 2013/12/17 13:53:04 spurious whitespace addition
Igor Sheludko 2013/12/18 10:01:33 Done.
} else {
checked_key = Add<HBoundsCheck>(key, length);
@@ -2266,7 +2275,12 @@ HInstruction* HGraphBuilder::AddElementAccess(
if (elements_kind == EXTERNAL_PIXEL_ELEMENTS) {
val = Add<HClampToUint8>(val);
}
- return Add<HStoreKeyed>(elements, checked_key, val, elements_kind);
+ HStoreKeyed* store =
+ Add<HStoreKeyed>(elements, checked_key, val, elements_kind);
+ if (IsFastPackedSmiElementsKind(elements_kind)) {
Toon Verwaest 2013/12/17 13:53:04 store->set_store_to_initialize_element(elements_ki
Igor Sheludko 2013/12/18 10:01:33 Done.
+ store->set_store_to_initialized_element(true);
+ }
+ return store;
}
ASSERT(!is_store);

Powered by Google App Engine
This is Rietveld 408576698