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

Side by Side Diff: src/virtual-frame-heavy.cc

Issue 1604002: Simple register allocation for ARM. Only top of expression... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 if (!elements_[i].is_memory()) { 288 if (!elements_[i].is_memory()) {
289 SpillElementAt(i); 289 SpillElementAt(i);
290 } 290 }
291 } 291 }
292 292
293 // Forget the frame elements that will be popped by the call. 293 // Forget the frame elements that will be popped by the call.
294 Forget(dropped_args); 294 Forget(dropped_args);
295 } 295 }
296 296
297 297
298 // If there are any registers referenced only by the frame, spill one.
299 Register VirtualFrame::SpillAnyRegister() {
300 // Find the leftmost (ordered by register number) register whose only
301 // reference is in the frame.
302 for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
303 if (is_used(i) && cgen()->allocator()->count(i) == 1) {
304 SpillElementAt(register_location(i));
305 ASSERT(!cgen()->allocator()->is_used(i));
306 return RegisterAllocator::ToRegister(i);
307 }
308 }
309 return no_reg;
310 }
311
298 } } // namespace v8::internal 312 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698