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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 10458033: Do pops instead of addq(RSP when possible). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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: runtime/vm/assembler_x64.cc
===================================================================
--- runtime/vm/assembler_x64.cc (revision 8108)
+++ runtime/vm/assembler_x64.cc (working copy)
@@ -1291,11 +1291,13 @@
void Assembler::Drop(intptr_t stack_elements) {
ASSERT(stack_elements >= 0);
- if (stack_elements > 0) {
- // TODO(fschneider): When optimizing for code size, we could
- // consider using pop for stack_elements < 4 instead.
- addq(RSP, Immediate(stack_elements * kWordSize));
+ if (stack_elements <= 4) {
+ for (intptr_t i = 0; i < stack_elements; i++) {
+ popq(TMP);
+ }
+ return;
}
+ addq(RSP, Immediate(stack_elements * kWordSize));
}
« 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