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 #ifndef V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ |
6 #define V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ | 6 #define V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Control flow. | 87 // Control flow. |
88 void Return(Node* value); | 88 void Return(Node* value); |
89 | 89 |
90 // MachineAssembler is invalid after export. | 90 // MachineAssembler is invalid after export. |
91 Schedule* Export(); | 91 Schedule* Export(); |
92 | 92 |
93 protected: | 93 protected: |
94 virtual Node* MakeNode(Operator* op, int input_count, Node** inputs); | 94 virtual Node* MakeNode(Operator* op, int input_count, Node** inputs); |
95 | 95 |
96 Schedule* schedule() { | 96 Schedule* schedule() { |
97 ASSERT(ScheduleValid()); | 97 DCHECK(ScheduleValid()); |
98 return schedule_; | 98 return schedule_; |
99 } | 99 } |
100 | 100 |
101 private: | 101 private: |
102 bool ScheduleValid() { return schedule_ != NULL; } | 102 bool ScheduleValid() { return schedule_ != NULL; } |
103 | 103 |
104 typedef std::vector<Environment*, zone_allocator<Environment*> > | 104 typedef std::vector<Environment*, zone_allocator<Environment*> > |
105 EnvironmentVector; | 105 EnvironmentVector; |
106 | 106 |
107 NodeVector* CurrentVars() { return ¤t_environment_->variables_; } | 107 NodeVector* CurrentVars() { return ¤t_environment_->variables_; } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 IfBuilder& If(Node* condition); | 175 IfBuilder& If(Node* condition); |
176 void Then(); | 176 void Then(); |
177 void Else(); | 177 void Else(); |
178 void End(); | 178 void End(); |
179 | 179 |
180 // The next 4 functions are exposed for expression support. | 180 // The next 4 functions are exposed for expression support. |
181 // They will be private once I have a nice expression api. | 181 // They will be private once I have a nice expression api. |
182 void And(); | 182 void And(); |
183 void Or(); | 183 void Or(); |
184 IfBuilder& OpenParen() { | 184 IfBuilder& OpenParen() { |
185 ASSERT(smasm_->current_environment_ != NULL); | 185 DCHECK(smasm_->current_environment_ != NULL); |
186 CurrentClause()->PushNewExpressionState(); | 186 CurrentClause()->PushNewExpressionState(); |
187 return *this; | 187 return *this; |
188 } | 188 } |
189 IfBuilder& CloseParen() { | 189 IfBuilder& CloseParen() { |
190 ASSERT(smasm_->current_environment_ == NULL); | 190 DCHECK(smasm_->current_environment_ == NULL); |
191 CurrentClause()->PopExpressionState(); | 191 CurrentClause()->PopExpressionState(); |
192 return *this; | 192 return *this; |
193 } | 193 } |
194 | 194 |
195 private: | 195 private: |
196 // UnresolvedBranch represents the chain of environments created while | 196 // UnresolvedBranch represents the chain of environments created while |
197 // generating an expression. At this point, a branch Node | 197 // generating an expression. At this point, a branch Node |
198 // cannot be created, as the target environments of the branch are not yet | 198 // cannot be created, as the target environments of the branch are not yet |
199 // available, so everything required to create the branch Node is | 199 // available, so everything required to create the branch Node is |
200 // stored in this structure until the target environments are resolved. | 200 // stored in this structure until the target environments are resolved. |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 EnvironmentVector pending_header_merges_; | 303 EnvironmentVector pending_header_merges_; |
304 EnvironmentVector pending_exit_merges_; | 304 EnvironmentVector pending_exit_merges_; |
305 DISALLOW_COPY_AND_ASSIGN(LoopBuilder); | 305 DISALLOW_COPY_AND_ASSIGN(LoopBuilder); |
306 }; | 306 }; |
307 | 307 |
308 } // namespace compiler | 308 } // namespace compiler |
309 } // namespace internal | 309 } // namespace internal |
310 } // namespace v8 | 310 } // namespace v8 |
311 | 311 |
312 #endif // V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ | 312 #endif // V8_COMPILER_STRUCTURED_MACHINE_ASSEMBLER_H_ |
OLD | NEW |