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

Unified Diff: src/hydrogen.cc

Issue 14696015: Verify that no-side-effects scope does not add unsafe phis and does not change push-pop balance of … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test Created 7 years, 7 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 | « src/hydrogen.h ('k') | test/mjsunit/regress/regress-2671-1.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 f50a2d5796c3880b0a3a0fc3d4b4d3e327d690da..5d98dd5c2ba62b7c6c0ee6e693d146826c30f905 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8372,14 +8372,15 @@ void HOptimizedGraphBuilder::VisitProperty(Property* expr) {
} else {
CHECK_ALIVE(VisitForValue(expr->key()));
- HValue* key = Pop();
- HValue* obj = Pop();
+ HValue* key = environment()->ExpressionStackAt(0);
ulan 2013/05/08 14:01:47 This doesn't trigger the verification check. Chang
+ HValue* obj = environment()->ExpressionStackAt(1);
bool has_side_effects = false;
HValue* load = HandleKeyedElementAccess(
obj, key, NULL, expr, expr->id(), expr->position(),
false, // is_store
&has_side_effects);
+ Drop(2);
if (has_side_effects) {
if (ast_context()->IsEffect()) {
AddSimulate(expr->id(), REMOVABLE_SIMULATE);
@@ -10096,7 +10097,7 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) {
if (has_side_effects) AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE);
after = BuildIncrement(returns_original_input, expr);
- input = Pop();
+ input = environment()->ExpressionStackAt(0);
expr->RecordTypeFeedback(oracle(), zone());
HandleKeyedElementAccess(obj, key, after, expr, expr->AssignmentId(),
@@ -10104,10 +10105,10 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) {
true, // is_store
&has_side_effects);
- // Drop the key from the bailout environment. Overwrite the receiver
- // with the result of the operation, and the placeholder with the
- // original value if necessary.
- Drop(1);
+ // Drop the key and the original value from the bailout environment.
+ // Overwrite the receiver with the result of the operation, and the
+ // placeholder with the original value if necessary.
+ Drop(2);
environment()->SetExpressionStackAt(0, after);
if (returns_original_input) environment()->SetExpressionStackAt(1, input);
ASSERT(has_side_effects); // Stores always have side effects.
« no previous file with comments | « src/hydrogen.h ('k') | test/mjsunit/regress/regress-2671-1.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698