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

Unified Diff: src/hydrogen.cc

Issue 612423002: Fix Hydrogen's BuildStore() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 80col Created 6 years, 3 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
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-417508.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index e2508e76dcd66fd02a2526461abd73b655f54294..e1e3af2f1e54c05d49273672abfea60278335133 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -6450,16 +6450,19 @@ void HOptimizedGraphBuilder::BuildStore(Expression* expr,
bool is_uninitialized) {
if (!prop->key()->IsPropertyName()) {
// Keyed store.
- HValue* value = environment()->ExpressionStackAt(0);
- HValue* key = environment()->ExpressionStackAt(1);
- HValue* object = environment()->ExpressionStackAt(2);
+ HValue* value = Pop();
+ HValue* key = Pop();
+ HValue* object = Pop();
bool has_side_effects = false;
- HandleKeyedElementAccess(object, key, value, expr, ast_id, return_id, STORE,
- &has_side_effects);
- Drop(3);
- Push(value);
- Add<HSimulate>(return_id, REMOVABLE_SIMULATE);
- return ast_context()->ReturnValue(Pop());
+ HValue* result = HandleKeyedElementAccess(
+ object, key, value, expr, ast_id, return_id, STORE, &has_side_effects);
+ if (has_side_effects) {
+ if (!ast_context()->IsEffect()) Push(value);
+ Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
+ if (!ast_context()->IsEffect()) Drop(1);
+ }
+ if (result == NULL) return;
+ return ast_context()->ReturnValue(value);
}
// Named store.
@@ -7089,7 +7092,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
store_mode);
}
*has_side_effects |= instr->HasObservableSideEffects();
- return access_type == STORE ? NULL : instr;
+ return access_type == STORE ? val : instr;
}
HBasicBlock* join = graph()->CreateBasicBlock();
@@ -7142,7 +7145,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
NoObservableSideEffectsScope scope(this);
FinishExitWithHardDeoptimization("Unknown map in polymorphic element access");
set_current_block(join);
- return access_type == STORE ? NULL : Pop();
+ return access_type == STORE ? val : Pop();
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-417508.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698