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

Unified Diff: src/register-allocator.cc

Issue 42296: Speed up the inner loop of free register allocation. (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 | « src/register-allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/register-allocator.cc
===================================================================
--- src/register-allocator.cc (revision 1525)
+++ src/register-allocator.cc (working copy)
@@ -83,11 +83,10 @@
Result RegisterAllocator::AllocateWithoutSpilling() {
// Return the first free register, if any.
- for (int i = 0; i < kNumRegisters; i++) {
- if (!is_used(i)) {
- Register free_reg = { i };
- return Result(free_reg, cgen_);
- }
+ int free_reg = registers_.ScanForFreeRegister();
+ if (free_reg < kNumRegisters) {
+ Register free_result = { free_reg };
+ return Result(free_result, cgen_);
}
return Result(cgen_);
}
« no previous file with comments | « src/register-allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698