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

Side by Side Diff: src/register-allocator.cc

Issue 42565: Remove register counts from VirtualFrame, use register indices instead. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/jump-target.cc ('k') | src/virtual-frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 101
102 Result RegisterAllocator::Allocate(Register target) { 102 Result RegisterAllocator::Allocate(Register target) {
103 // If the target is not referenced, it can simply be allocated. 103 // If the target is not referenced, it can simply be allocated.
104 if (!is_used(target)) { 104 if (!is_used(target)) {
105 return Result(target, cgen_); 105 return Result(target, cgen_);
106 } 106 }
107 // If the target is only referenced in the frame, it can be spilled and 107 // If the target is only referenced in the frame, it can be spilled and
108 // then allocated. 108 // then allocated.
109 ASSERT(cgen_->has_valid_frame()); 109 ASSERT(cgen_->has_valid_frame());
110 if (count(target) == cgen_->frame()->register_count(target)) { 110 if (cgen_->frame()->is_used(target) && count(target) == 1) {
111 cgen_->frame()->Spill(target); 111 cgen_->frame()->Spill(target);
112 ASSERT(!is_used(target)); 112 ASSERT(!is_used(target));
113 return Result(target, cgen_); 113 return Result(target, cgen_);
114 } 114 }
115 // Otherwise (if it's referenced outside the frame) we cannot allocate it. 115 // Otherwise (if it's referenced outside the frame) we cannot allocate it.
116 return Result(cgen_); 116 return Result(cgen_);
117 } 117 }
118 118
119 119
120 } } // namespace v8::internal 120 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/jump-target.cc ('k') | src/virtual-frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698