Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_FLOW_GRAPH_ALLOCATOR_H_ | 5 #ifndef VM_FLOW_GRAPH_ALLOCATOR_H_ |
| 6 #define VM_FLOW_GRAPH_ALLOCATOR_H_ | 6 #define VM_FLOW_GRAPH_ALLOCATOR_H_ |
| 7 | 7 |
| 8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 | 10 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 // Per register lists of allocated live ranges. Contain only those | 213 // Per register lists of allocated live ranges. Contain only those |
| 214 // ranges that can be affected by future allocation decisions. | 214 // ranges that can be affected by future allocation decisions. |
| 215 // Those live ranges that end before the start of the current live range are | 215 // Those live ranges that end before the start of the current live range are |
| 216 // removed from the list and will not be affected. | 216 // removed from the list and will not be affected. |
| 217 GrowableArray<LiveRange*> cpu_regs_[kNumberOfCpuRegisters]; | 217 GrowableArray<LiveRange*> cpu_regs_[kNumberOfCpuRegisters]; |
| 218 | 218 |
| 219 // List of used spill slots. Contains positions after which spill slots | 219 // List of used spill slots. Contains positions after which spill slots |
| 220 // become free and can be reused for allocation. | 220 // become free and can be reused for allocation. |
| 221 GrowableArray<intptr_t> spill_slots_; | 221 GrowableArray<intptr_t> spill_slots_; |
| 222 | 222 |
| 223 // List of safepoints. | |
| 224 struct Safepoint { | |
|
Vyacheslav Egorov (Google)
2012/08/13 12:54:46
: public ValueObject ?
Kevin Millikin (Google)
2012/08/13 15:10:37
Nah. The comment in that class indicates that Val
| |
| 225 intptr_t position; | |
| 226 BitmapBuilder* stack_bitmap; | |
| 227 }; | |
| 228 GrowableArray<Safepoint> safepoints_; | |
| 229 | |
| 223 bool blocked_cpu_regs_[kNumberOfCpuRegisters]; | 230 bool blocked_cpu_regs_[kNumberOfCpuRegisters]; |
| 224 | 231 |
| 225 DISALLOW_COPY_AND_ASSIGN(FlowGraphAllocator); | 232 DISALLOW_COPY_AND_ASSIGN(FlowGraphAllocator); |
| 226 }; | 233 }; |
| 227 | 234 |
| 228 | 235 |
| 229 // Additional information about a block that is not contained in a | 236 // Additional information about a block that is not contained in a |
| 230 // block entry. | 237 // block entry. |
| 231 class BlockInfo : public ZoneAllocated { | 238 class BlockInfo : public ZoneAllocated { |
| 232 public: | 239 public: |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 void Print(); | 428 void Print(); |
| 422 | 429 |
| 423 void AssignLocation(UseInterval* use, Location loc); | 430 void AssignLocation(UseInterval* use, Location loc); |
| 424 | 431 |
| 425 LiveRange* SplitAt(intptr_t pos); | 432 LiveRange* SplitAt(intptr_t pos); |
| 426 | 433 |
| 427 bool CanCover(intptr_t pos) const { | 434 bool CanCover(intptr_t pos) const { |
| 428 return (Start() <= pos) && (pos < End()); | 435 return (Start() <= pos) && (pos < End()); |
| 429 } | 436 } |
| 430 | 437 |
| 438 bool Covers(intptr_t pos) const; | |
|
srdjan
2012/08/10 23:11:05
Could you add a brief comment differentiating betw
Vyacheslav Egorov (Google)
2012/08/13 12:54:46
I suggest renaming Covers to Contains to match nam
Kevin Millikin (Google)
2012/08/13 15:10:37
Done.
| |
| 439 | |
| 431 Location spill_slot() const { | 440 Location spill_slot() const { |
| 432 return spill_slot_; | 441 return spill_slot_; |
| 433 } | 442 } |
| 434 | 443 |
| 435 private: | 444 private: |
| 436 LiveRange(intptr_t vreg, | 445 LiveRange(intptr_t vreg, |
| 437 UsePosition* uses, | 446 UsePosition* uses, |
| 438 UseInterval* first_use_interval, | 447 UseInterval* first_use_interval, |
| 439 UseInterval* last_use_interval, | 448 UseInterval* last_use_interval, |
| 440 LiveRange* next_sibling) | 449 LiveRange* next_sibling) |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 459 | 468 |
| 460 AllocationFinger finger_; | 469 AllocationFinger finger_; |
| 461 | 470 |
| 462 DISALLOW_COPY_AND_ASSIGN(LiveRange); | 471 DISALLOW_COPY_AND_ASSIGN(LiveRange); |
| 463 }; | 472 }; |
| 464 | 473 |
| 465 | 474 |
| 466 } // namespace dart | 475 } // namespace dart |
| 467 | 476 |
| 468 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ | 477 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ |
| OLD | NEW |