OLD | NEW |
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 Loading... |
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 |
OLD | NEW |