Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 417873f47665cb2add328976e2ac7cc7fb23cc24..5cc9e224cffd613b4ad14dec6f5415d4cdebb137 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -2976,17 +2976,19 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) { |
} |
// Save result for postfix expressions. |
+ FeedbackSlot count_slot = expr->CountBinaryOpFeedbackSlot(); |
if (is_postfix) { |
// Convert old value into a number before saving it. |
old_value = register_allocator()->NewRegister(); |
+ // TODO(ignition): Think about adding proper PostInc/PostDec bytecodes |
+ // instead of this ToNumber + Inc/Dec dance. |
builder() |
- ->ConvertAccumulatorToNumber(old_value) |
+ ->ConvertAccumulatorToNumber(old_value, feedback_index(count_slot)) |
.LoadAccumulatorWithRegister(old_value); |
} |
// Perform +1/-1 operation. |
- FeedbackSlot slot = expr->CountBinaryOpFeedbackSlot(); |
- builder()->CountOperation(expr->binary_op(), feedback_index(slot)); |
+ builder()->CountOperation(expr->binary_op(), feedback_index(count_slot)); |
// Store the value. |
builder()->SetExpressionPosition(expr); |