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

Side by Side Diff: runtime/vm/assembler_ia32.cc

Issue 10559035: Implement a simple register allocator that tries to keep instruction results in registers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/memory_region.h" 10 #include "vm/memory_region.h"
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 } 1286 }
1287 1287
1288 1288
1289 void Assembler::MoveRegister(Register to, Register from) { 1289 void Assembler::MoveRegister(Register to, Register from) {
1290 if (to != from) { 1290 if (to != from) {
1291 movl(to, from); 1291 movl(to, from);
1292 } 1292 }
1293 } 1293 }
1294 1294
1295 1295
1296 void Assembler::PushRegister(Register r) {
1297 pushl(r);
1298 }
1299
1300
1301 void Assembler::PopRegister(Register r) {
1302 popl(r);
1303 }
1304
1305
1296 void Assembler::AddImmediate(Register reg, const Immediate& imm) { 1306 void Assembler::AddImmediate(Register reg, const Immediate& imm) {
1297 int value = imm.value(); 1307 int value = imm.value();
1298 if (value > 0) { 1308 if (value > 0) {
1299 if (value == 1) { 1309 if (value == 1) {
1300 incl(reg); 1310 incl(reg);
1301 } else if (value != 0) { 1311 } else if (value != 0) {
1302 addl(reg, imm); 1312 addl(reg, imm);
1303 } 1313 }
1304 } else if (value < 0) { 1314 } else if (value < 0) {
1305 value = -value; 1315 value = -value;
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 comments.SetCommentAt(i, comments_[i]->comment()); 1656 comments.SetCommentAt(i, comments_[i]->comment());
1647 } 1657 }
1648 1658
1649 return comments; 1659 return comments;
1650 } 1660 }
1651 1661
1652 1662
1653 } // namespace dart 1663 } // namespace dart
1654 1664
1655 #endif // defined TARGET_ARCH_IA32 1665 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698