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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 1901083002: [Interpreter] Introduce IncStub and DecStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Omit ToNumber where possible Created 4 years, 8 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
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 71e9eefd17fa76831a0669c5e98c5ff29bffa650..7184959d98f01c20219d1e2dbd2d41e91e370739 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2801,13 +2801,12 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) {
}
}
- // Convert old value into a number.
- builder()->CastAccumulatorToNumber();
-
// Save result for postfix expressions.
if (is_postfix) {
old_value = register_allocator()->outer()->NewRegister();
- builder()->StoreAccumulatorInRegister(old_value);
+
+ // Convert old value into a number before saving it.
+ builder()->CastAccumulatorToNumber().StoreAccumulatorInRegister(old_value);
}
// Perform +1/-1 operation.

Powered by Google App Engine
This is Rietveld 408576698