OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/compiler/load-elimination.h" | 5 #include "src/compiler/load-elimination.h" |
6 | 6 |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/compiler/simplified-operator.h" | 9 #include "src/compiler/simplified-operator.h" |
10 | 10 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 212 } |
213 return true; | 213 return true; |
214 } | 214 } |
215 | 215 |
216 void LoadElimination::AbstractState::Merge(AbstractState const* that, | 216 void LoadElimination::AbstractState::Merge(AbstractState const* that, |
217 Zone* zone) { | 217 Zone* zone) { |
218 // Merge the information we have about the elements. | 218 // Merge the information we have about the elements. |
219 if (this->elements_) { | 219 if (this->elements_) { |
220 this->elements_ = that->elements_ | 220 this->elements_ = that->elements_ |
221 ? that->elements_->Merge(this->elements_, zone) | 221 ? that->elements_->Merge(this->elements_, zone) |
222 : that->elements_; | 222 : nullptr; |
223 } else { | |
224 this->elements_ = that->elements_; | |
225 } | 223 } |
226 | 224 |
227 // Merge the information we have about the fields. | 225 // Merge the information we have about the fields. |
228 for (size_t i = 0; i < arraysize(fields_); ++i) { | 226 for (size_t i = 0; i < arraysize(fields_); ++i) { |
229 if (this->fields_[i]) { | 227 if (this->fields_[i]) { |
230 if (that->fields_[i]) { | 228 if (that->fields_[i]) { |
231 this->fields_[i] = this->fields_[i]->Merge(that->fields_[i], zone); | 229 this->fields_[i] = this->fields_[i]->Merge(that->fields_[i], zone); |
232 } else { | 230 } else { |
233 this->fields_[i] = nullptr; | 231 this->fields_[i] = nullptr; |
234 } | 232 } |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 DCHECK_EQ(kTaggedBase, access.base_is_tagged); | 699 DCHECK_EQ(kTaggedBase, access.base_is_tagged); |
702 DCHECK_EQ(0, access.offset % kPointerSize); | 700 DCHECK_EQ(0, access.offset % kPointerSize); |
703 int field_index = access.offset / kPointerSize; | 701 int field_index = access.offset / kPointerSize; |
704 if (field_index >= static_cast<int>(kMaxTrackedFields)) return -1; | 702 if (field_index >= static_cast<int>(kMaxTrackedFields)) return -1; |
705 return field_index; | 703 return field_index; |
706 } | 704 } |
707 | 705 |
708 } // namespace compiler | 706 } // namespace compiler |
709 } // namespace internal | 707 } // namespace internal |
710 } // namespace v8 | 708 } // namespace v8 |
OLD | NEW |