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

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

Issue 1961004: First step towards making JumpTarget work on ARM. Instead... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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 unified diff | Download patch | Annotate | Revision Log
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 ASSERT(!is_used(free_reg)); 77 ASSERT(!is_used(free_reg));
78 return Result(free_reg); 78 return Result(free_reg);
79 } 79 }
80 } 80 }
81 return result; 81 return result;
82 } 82 }
83 83
84 84
85 Result RegisterAllocator::Allocate(Register target) { 85 Result RegisterAllocator::Allocate(Register target) {
86 // If the target is not referenced, it can simply be allocated. 86 // If the target is not referenced, it can simply be allocated.
87 if (!is_used(target)) { 87 if (!is_used(RegisterAllocator::ToNumber(target))) {
88 return Result(target); 88 return Result(target);
89 } 89 }
90 // If the target is only referenced in the frame, it can be spilled and 90 // If the target is only referenced in the frame, it can be spilled and
91 // then allocated. 91 // then allocated.
92 ASSERT(cgen_->has_valid_frame()); 92 ASSERT(cgen_->has_valid_frame());
93 if (cgen_->frame()->is_used(target) && count(target) == 1) { 93 if (cgen_->frame()->is_used(RegisterAllocator::ToNumber(target)) && count(targ et) == 1) {
94 cgen_->frame()->Spill(target); 94 cgen_->frame()->Spill(target);
95 ASSERT(!is_used(target)); 95 ASSERT(!is_used(RegisterAllocator::ToNumber(target)));
96 return Result(target); 96 return Result(target);
97 } 97 }
98 // Otherwise (if it's referenced outside the frame) we cannot allocate it. 98 // Otherwise (if it's referenced outside the frame) we cannot allocate it.
99 return Result(); 99 return Result();
100 } 100 }
101 101
102 102
103 } } // namespace v8::internal 103 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698