Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1009)

Side by Side Diff: src/compiler/code-assembler.cc

Issue 2657533003: [stubs] Add initializing constructor to CSA::Variable (Closed)
Patch Set: Address comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/code-assembler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler/code-assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698