| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/base/adapters.h" |
| 6 #include "src/compiler/js-graph.h" |
| 5 #include "src/compiler/liveness-analyzer.h" | 7 #include "src/compiler/liveness-analyzer.h" |
| 6 #include "src/compiler/js-graph.h" | |
| 7 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
| 8 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/state-values-utils.h" | 10 #include "src/compiler/state-values-utils.h" |
| 10 | 11 |
| 11 namespace v8 { | 12 namespace v8 { |
| 12 namespace internal { | 13 namespace internal { |
| 13 namespace compiler { | 14 namespace compiler { |
| 14 | 15 |
| 15 | 16 |
| 16 LivenessAnalyzer::LivenessAnalyzer(size_t local_count, Zone* zone) | 17 LivenessAnalyzer::LivenessAnalyzer(size_t local_count, Zone* zone) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 queued_(false), | 91 queued_(false), |
| 91 id_(id) {} | 92 id_(id) {} |
| 92 | 93 |
| 93 void LivenessAnalyzerBlock::Process(BitVector* result, | 94 void LivenessAnalyzerBlock::Process(BitVector* result, |
| 94 NonLiveFrameStateSlotReplacer* replacer) { | 95 NonLiveFrameStateSlotReplacer* replacer) { |
| 95 queued_ = false; | 96 queued_ = false; |
| 96 | 97 |
| 97 // Copy the bitvector to the target bit vector. | 98 // Copy the bitvector to the target bit vector. |
| 98 result->CopyFrom(live_); | 99 result->CopyFrom(live_); |
| 99 | 100 |
| 100 for (auto i = entries_.rbegin(); i != entries_.rend(); i++) { | 101 for (auto entry : base::Reversed(entries_)) { |
| 101 auto entry = *i; | |
| 102 switch (entry.kind()) { | 102 switch (entry.kind()) { |
| 103 case Entry::kLookup: | 103 case Entry::kLookup: |
| 104 result->Add(entry.var()); | 104 result->Add(entry.var()); |
| 105 break; | 105 break; |
| 106 case Entry::kBind: | 106 case Entry::kBind: |
| 107 result->Remove(entry.var()); | 107 result->Remove(entry.var()); |
| 108 break; | 108 break; |
| 109 case Entry::kCheckpoint: | 109 case Entry::kCheckpoint: |
| 110 if (replacer != nullptr) { | 110 if (replacer != nullptr) { |
| 111 replacer->ClearNonLiveFrameStateSlots(entry.node(), result); | 111 replacer->ClearNonLiveFrameStateSlots(entry.node(), result); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 for (int i = 0; i < live_.length(); i++) { | 191 for (int i = 0; i < live_.length(); i++) { |
| 192 os << (live_.Contains(i) ? "L" : "."); | 192 os << (live_.Contains(i) ? "L" : "."); |
| 193 } | 193 } |
| 194 os << std::endl; | 194 os << std::endl; |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace compiler | 198 } // namespace compiler |
| 199 } // namespace internal | 199 } // namespace internal |
| 200 } // namespace v8 | 200 } // namespace v8 |
| OLD | NEW |