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

Unified Diff: src/register-allocator-ia32.cc

Issue 13127: Initial real implementation of simple merge for frames. Does not yet... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 12 years 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-ia32.h ('k') | src/virtual-frame-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/register-allocator-ia32.cc
===================================================================
--- src/register-allocator-ia32.cc (revision 894)
+++ src/register-allocator-ia32.cc (working copy)
@@ -41,7 +41,7 @@
}
-Register RegisterAllocator::Allocate() {
+Register RegisterAllocator::AllocateWithoutSpilling() {
// Return the first free register, if any.
for (int i = 0; i < num_registers(); i++) {
if (!registers_.is_used(i)) {
@@ -50,15 +50,21 @@
return result;
}
}
+ return no_reg;
+}
- // Ask the current frame to spill a register.
- ASSERT(code_generator_->frame() != NULL);
- Register result = code_generator_->frame()->SpillAnyRegister();
- if (!result.is(no_reg)) {
- ASSERT(!registers_.is_used(result.code()));
- registers_.Use(result);
+
+Register RegisterAllocator::Allocate() {
+ Register result = AllocateWithoutSpilling();
+ if (result.is(no_reg)) {
+ // Ask the current frame to spill a register.
+ ASSERT(code_generator_->frame() != NULL);
+ result = code_generator_->frame()->SpillAnyRegister();
+ if (!result.is(no_reg)) {
+ ASSERT(!registers_.is_used(result.code()));
+ registers_.Use(result);
+ }
}
-
return result;
}
« no previous file with comments | « src/register-allocator-ia32.h ('k') | src/virtual-frame-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698