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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 Node* value_; | 693 Node* value_; |
694 MachineRepresentation rep_; | 694 MachineRepresentation rep_; |
695 }; | 695 }; |
696 | 696 |
697 CodeAssemblerVariable::CodeAssemblerVariable(CodeAssembler* assembler, | 697 CodeAssemblerVariable::CodeAssemblerVariable(CodeAssembler* assembler, |
698 MachineRepresentation rep) | 698 MachineRepresentation rep) |
699 : impl_(new (assembler->zone()) Impl(rep)), state_(assembler->state()) { | 699 : impl_(new (assembler->zone()) Impl(rep)), state_(assembler->state()) { |
700 state_->variables_.insert(impl_); | 700 state_->variables_.insert(impl_); |
701 } | 701 } |
702 | 702 |
| 703 CodeAssemblerVariable::CodeAssemblerVariable(CodeAssembler* assembler, |
| 704 MachineRepresentation rep, |
| 705 Node* initial_value) |
| 706 : CodeAssemblerVariable(assembler, rep) { |
| 707 Bind(initial_value); |
| 708 } |
| 709 |
703 CodeAssemblerVariable::~CodeAssemblerVariable() { | 710 CodeAssemblerVariable::~CodeAssemblerVariable() { |
704 state_->variables_.erase(impl_); | 711 state_->variables_.erase(impl_); |
705 } | 712 } |
706 | 713 |
707 void CodeAssemblerVariable::Bind(Node* value) { impl_->value_ = value; } | 714 void CodeAssemblerVariable::Bind(Node* value) { impl_->value_ = value; } |
708 | 715 |
709 Node* CodeAssemblerVariable::value() const { | 716 Node* CodeAssemblerVariable::value() const { |
710 DCHECK_NOT_NULL(impl_->value_); | 717 DCHECK_NOT_NULL(impl_->value_); |
711 return impl_->value_; | 718 return impl_->value_; |
712 } | 719 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 } | 840 } |
834 } | 841 } |
835 } | 842 } |
836 | 843 |
837 bound_ = true; | 844 bound_ = true; |
838 } | 845 } |
839 | 846 |
840 } // namespace compiler | 847 } // namespace compiler |
841 } // namespace internal | 848 } // namespace internal |
842 } // namespace v8 | 849 } // namespace v8 |
OLD | NEW |