Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index f50a2d5796c3880b0a3a0fc3d4b4d3e327d690da..e583e506a95c09cf1c6744bfb3f6b4259422f876 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -10096,7 +10096,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 +10104,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. |