OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_GRAPH_BUILDER_H_ | 5 #ifndef V8_COMPILER_GRAPH_BUILDER_H_ |
6 #define V8_COMPILER_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_GRAPH_BUILDER_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 Environment* CopyForConditional() { return builder()->CopyEnvironment(this); } | 211 Environment* CopyForConditional() { return builder()->CopyEnvironment(this); } |
212 | 212 |
213 // Copies this environment to a potentially unreachable control-flow point. | 213 // Copies this environment to a potentially unreachable control-flow point. |
214 Environment* CopyAsUnreachable() { | 214 Environment* CopyAsUnreachable() { |
215 Environment* env = builder()->CopyEnvironment(this); | 215 Environment* env = builder()->CopyEnvironment(this); |
216 env->MarkAsUnreachable(); | 216 env->MarkAsUnreachable(); |
217 return env; | 217 return env; |
218 } | 218 } |
219 | 219 |
220 // Copies this environment at a loop header control-flow point. | 220 // Copies this environment at a loop header control-flow point. |
221 Environment* CopyForLoop(BitVector* assigned) { | 221 Environment* CopyForLoop(BitVector* assigned, bool is_osr = false) { |
222 PrepareForLoop(assigned); | 222 PrepareForLoop(assigned, is_osr); |
223 return builder()->CopyEnvironment(this); | 223 return builder()->CopyEnvironment(this); |
224 } | 224 } |
225 | 225 |
226 Node* GetContext() { return builder_->current_context(); } | 226 Node* GetContext() { return builder_->current_context(); } |
227 | 227 |
228 protected: | 228 protected: |
229 Zone* zone() const { return builder_->local_zone(); } | 229 Zone* zone() const { return builder_->local_zone(); } |
230 Graph* graph() const { return builder_->graph(); } | 230 Graph* graph() const { return builder_->graph(); } |
231 StructuredGraphBuilder* builder() const { return builder_; } | 231 StructuredGraphBuilder* builder() const { return builder_; } |
232 CommonOperatorBuilder* common() { return builder_->common(); } | 232 CommonOperatorBuilder* common() { return builder_->common(); } |
233 NodeVector* values() { return &values_; } | 233 NodeVector* values() { return &values_; } |
234 | 234 |
235 // Prepare environment to be used as loop header. | 235 // Prepare environment to be used as loop header. |
236 void PrepareForLoop(BitVector* assigned); | 236 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
237 | 237 |
238 private: | 238 private: |
239 StructuredGraphBuilder* builder_; | 239 StructuredGraphBuilder* builder_; |
240 Node* control_dependency_; | 240 Node* control_dependency_; |
241 Node* effect_dependency_; | 241 Node* effect_dependency_; |
242 NodeVector values_; | 242 NodeVector values_; |
243 }; | 243 }; |
244 } | 244 } |
245 } | 245 } |
246 } // namespace v8::internal::compiler | 246 } // namespace v8::internal::compiler |
247 | 247 |
248 #endif // V8_COMPILER_GRAPH_BUILDER_H__ | 248 #endif // V8_COMPILER_GRAPH_BUILDER_H__ |
OLD | NEW |