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

Unified Diff: src/ia32/codegen-ia32.cc

Issue 1075004: Update number info for count operations.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/codegen-ia32.cc
===================================================================
--- src/ia32/codegen-ia32.cc (revision 4174)
+++ src/ia32/codegen-ia32.cc (working copy)
@@ -6884,8 +6884,8 @@
ASSERT(old_value.is_valid());
__ mov(old_value.reg(), new_value.reg());
- // The old value that is return for postfix operations has the
- // same type as the input value we got from the frame.
+ // The return value for postfix operations is the
+ // same as the input, and has the same number info.
old_value.set_number_info(new_value.number_info());
}
@@ -6952,8 +6952,13 @@
}
deferred->BindExit();
- // The result of ++ or -- is always a number.
- new_value.set_number_info(NumberInfo::Number());
+ // The result of ++ or -- is an Integer32 if the
+ // input is a smi. Otherwise it is a number.
+ if (new_value.is_smi()) {
+ new_value.set_number_info(NumberInfo::Integer32());
+ } else {
+ new_value.set_number_info(NumberInfo::Number());
+ }
// Postfix: store the old value in the allocated slot under the
// reference.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698