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 #include "src/compiler/code-assembler.h" | 5 #include "src/compiler/code-assembler.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 label_(nullptr) { | 712 label_(nullptr) { |
713 void* buffer = assembler->zone()->New(sizeof(RawMachineLabel)); | 713 void* buffer = assembler->zone()->New(sizeof(RawMachineLabel)); |
714 label_ = new (buffer) | 714 label_ = new (buffer) |
715 RawMachineLabel(type == kDeferred ? RawMachineLabel::kDeferred | 715 RawMachineLabel(type == kDeferred ? RawMachineLabel::kDeferred |
716 : RawMachineLabel::kNonDeferred); | 716 : RawMachineLabel::kNonDeferred); |
717 for (size_t i = 0; i < vars_count; ++i) { | 717 for (size_t i = 0; i < vars_count; ++i) { |
718 variable_phis_[vars[i]->impl_] = nullptr; | 718 variable_phis_[vars[i]->impl_] = nullptr; |
719 } | 719 } |
720 } | 720 } |
721 | 721 |
| 722 CodeAssemblerLabel::~CodeAssemblerLabel() { label_->~RawMachineLabel(); } |
| 723 |
722 void CodeAssemblerLabel::MergeVariables() { | 724 void CodeAssemblerLabel::MergeVariables() { |
723 ++merge_count_; | 725 ++merge_count_; |
724 for (auto var : state_->variables_) { | 726 for (auto var : state_->variables_) { |
725 size_t count = 0; | 727 size_t count = 0; |
726 Node* node = var->value_; | 728 Node* node = var->value_; |
727 if (node != nullptr) { | 729 if (node != nullptr) { |
728 auto i = variable_merges_.find(var); | 730 auto i = variable_merges_.find(var); |
729 if (i != variable_merges_.end()) { | 731 if (i != variable_merges_.end()) { |
730 i->second.push_back(node); | 732 i->second.push_back(node); |
731 count = i->second.size(); | 733 count = i->second.size(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 } | 820 } |
819 } | 821 } |
820 } | 822 } |
821 | 823 |
822 bound_ = true; | 824 bound_ = true; |
823 } | 825 } |
824 | 826 |
825 } // namespace compiler | 827 } // namespace compiler |
826 } // namespace internal | 828 } // namespace internal |
827 } // namespace v8 | 829 } // namespace v8 |
OLD | NEW |