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

Unified Diff: src/codegen-ia32.cc

Issue 56106: Keep the result of postfix increment and decrement in a register. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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/codegen-ia32.cc
===================================================================
--- src/codegen-ia32.cc (revision 1653)
+++ src/codegen-ia32.cc (working copy)
@@ -4799,17 +4799,25 @@
target.size() * kPointerSize);
Result value = frame_->Pop();
- value.ToRegister();
- ASSERT(value.is_valid());
// Postfix: Store the old value as the result.
if (is_postfix) {
- Result old_value = value;
- frame_->SetElementAt(target.size(), &old_value);
+ if (value.is_register()) {
+ Result old_value = allocator_->Allocate();
+ ASSERT(old_value.is_valid());
+ __ mov(old_value.reg(), value.reg());
+ frame_->SetElementAt(target.size(), &old_value);
+ } else {
+ ASSERT(value.is_constant());
+ Result old_value = value;
+ frame_->SetElementAt(target.size(), &old_value);
+ }
}
// Perform optimistic increment/decrement. Ensure the value is
// writable.
+ value.ToRegister();
+ ASSERT(value.is_valid());
frame_->Spill(value.reg());
ASSERT(allocator_->count(value.reg()) == 1);
« 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