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