Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_PREPROCESS_LIVE_RANGES_H_ | 5 #ifndef V8_PREPROCESS_LIVE_RANGES_H_ |
|
Benedikt Meurer
2015/08/24 04:33:26
Nit: Rename header guard.
Mircea Trofin
2015/08/24 20:55:10
Done.
| |
| 6 #define V8_PREPROCESS_LIVE_RANGES_H_ | 6 #define V8_PREPROCESS_LIVE_RANGES_H_ |
| 7 | 7 |
| 8 #include "src/compiler/register-allocator.h" | 8 #include "src/compiler/register-allocator.h" |
|
Benedikt Meurer
2015/08/24 04:33:26
Don't include the header here, but forward declare
Mircea Trofin
2015/08/24 20:55:10
Done.
| |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 namespace compiler { | 12 namespace compiler { |
| 13 | 13 |
| 14 | 14 |
| 15 class PreprocessLiveRanges final { | 15 // A register allocation pair of transformations: splinter and merge live ranges |
| 16 class LiveRangeSeparator final { | |
| 16 public: | 17 public: |
| 17 PreprocessLiveRanges(RegisterAllocationData* data, Zone* zone) | 18 LiveRangeSeparator(RegisterAllocationData* data, Zone* zone) |
| 18 : data_(data), zone_(zone) {} | 19 : data_(data), zone_(zone) {} |
| 19 void PreprocessRanges(); | 20 |
| 21 void Splinter(); | |
| 20 | 22 |
| 21 private: | 23 private: |
| 22 void SplitRangesAroundDeferredBlocks(); | |
| 23 | |
| 24 RegisterAllocationData* data() { return data_; } | 24 RegisterAllocationData* data() { return data_; } |
|
Benedikt Meurer
2015/08/24 04:33:26
Nit: mark these accessors const.
Mircea Trofin
2015/08/24 20:55:10
Done.
| |
| 25 Zone* zone() { return zone_; } | 25 Zone* zone() { return zone_; } |
| 26 | 26 |
| 27 RegisterAllocationData* data_; | |
|
Benedikt Meurer
2015/08/24 04:33:26
Nit: use const fields, i.e. RegisterAllocationData
Mircea Trofin
2015/08/24 20:55:10
Done.
| |
| 28 Zone* zone_; | |
| 29 }; | |
| 30 | |
| 31 | |
| 32 class LiveRangeMerger final { | |
| 33 public: | |
| 34 LiveRangeMerger(RegisterAllocationData* data, Zone* zone) | |
| 35 : data_(data), zone_(zone) {} | |
| 36 | |
| 37 void Merge(); | |
| 38 | |
| 39 private: | |
| 40 RegisterAllocationData* data() { return data_; } | |
|
Benedikt Meurer
2015/08/24 04:33:26
See above.
Mircea Trofin
2015/08/24 20:55:10
Done.
| |
| 41 Zone* zone() { return zone_; } | |
| 42 | |
| 27 RegisterAllocationData* data_; | 43 RegisterAllocationData* data_; |
|
Benedikt Meurer
2015/08/24 04:33:26
See above.
Mircea Trofin
2015/08/24 20:55:10
Done.
| |
| 28 Zone* zone_; | 44 Zone* zone_; |
| 29 }; | 45 }; |
| 30 | 46 |
| 31 | 47 |
| 32 } // namespace compiler | 48 } // namespace compiler |
| 33 } // namespace internal | 49 } // namespace internal |
| 34 } // namespace v8 | 50 } // namespace v8 |
| 35 #endif // V8_PREPROCESS_LIVE_RANGES_H_ | 51 #endif // V8_PREPROCESS_LIVE_RANGES_H_ |
| OLD | NEW |