| 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 #include "src/compiler/graph-builder.h" | 5 #include "src/compiler/graph-builder.h" |
| 6 | 6 |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/compiler/generic-graph.h" | 8 #include "src/compiler/generic-graph.h" |
| 9 #include "src/compiler/generic-node.h" | 9 #include "src/compiler/generic-node.h" |
| 10 #include "src/compiler/generic-node-inl.h" | 10 #include "src/compiler/generic-node-inl.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 Node** buffer = reinterpret_cast<Node**>(raw_buffer); | 49 Node** buffer = reinterpret_cast<Node**>(raw_buffer); |
| 50 memcpy(buffer, value_inputs, kPointerSize * value_input_count); | 50 memcpy(buffer, value_inputs, kPointerSize * value_input_count); |
| 51 Node** current_input = buffer + value_input_count; | 51 Node** current_input = buffer + value_input_count; |
| 52 if (has_context) { | 52 if (has_context) { |
| 53 *current_input++ = current_context(); | 53 *current_input++ = current_context(); |
| 54 } | 54 } |
| 55 if (has_effect) { | 55 if (has_effect) { |
| 56 *current_input++ = environment_->GetEffectDependency(); | 56 *current_input++ = environment_->GetEffectDependency(); |
| 57 } | 57 } |
| 58 if (has_control) { | 58 if (has_control) { |
| 59 *current_input++ = GetControlDependency(); | 59 *current_input++ = environment_->GetControlDependency(); |
| 60 } | 60 } |
| 61 result = graph()->NewNode(op, input_count_with_deps, buffer); | 61 result = graph()->NewNode(op, input_count_with_deps, buffer); |
| 62 if (has_effect) { | 62 if (has_effect) { |
| 63 environment_->UpdateEffectDependency(result); | 63 environment_->UpdateEffectDependency(result); |
| 64 } | 64 } |
| 65 if (NodeProperties::HasControlOutput(result) && | 65 if (NodeProperties::HasControlOutput(result) && |
| 66 !environment_internal()->IsMarkedAsUnreachable()) { | 66 !environment()->IsMarkedAsUnreachable()) { |
| 67 UpdateControlDependency(result); | 67 environment_->UpdateControlDependency(result); |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 | 70 |
| 71 return result; | 71 return result; |
| 72 } | 72 } |
| 73 | 73 |
| 74 | 74 |
| 75 Node* StructuredGraphBuilder::GetControlDependency() { | |
| 76 return environment_->GetControlDependency(); | |
| 77 } | |
| 78 | |
| 79 | |
| 80 void StructuredGraphBuilder::UpdateControlDependency(Node* new_control) { | |
| 81 environment_->UpdateControlDependency(new_control); | |
| 82 } | |
| 83 | |
| 84 | |
| 85 void StructuredGraphBuilder::UpdateControlDependencyToLeaveFunction( | 75 void StructuredGraphBuilder::UpdateControlDependencyToLeaveFunction( |
| 86 Node* exit) { | 76 Node* exit) { |
| 87 if (environment_internal()->IsMarkedAsUnreachable()) return; | 77 if (environment()->IsMarkedAsUnreachable()) return; |
| 88 if (exit_control() != NULL) { | 78 if (exit_control() != NULL) { |
| 89 exit = MergeControl(exit_control(), exit); | 79 exit = MergeControl(exit_control(), exit); |
| 90 } | 80 } |
| 91 environment_internal()->MarkAsUnreachable(); | 81 environment()->MarkAsUnreachable(); |
| 92 set_exit_control(exit); | 82 set_exit_control(exit); |
| 93 } | 83 } |
| 94 | 84 |
| 95 | 85 |
| 96 StructuredGraphBuilder::Environment* StructuredGraphBuilder::CopyEnvironment( | 86 StructuredGraphBuilder::Environment* StructuredGraphBuilder::CopyEnvironment( |
| 97 Environment* env) { | 87 Environment* env) { |
| 98 return new (zone()) Environment(*env); | 88 return new (zone()) Environment(*env); |
| 99 } | 89 } |
| 100 | 90 |
| 101 | 91 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 if (!dead_control_.is_set()) { | 232 if (!dead_control_.is_set()) { |
| 243 Node* dead_node = graph()->NewNode(common_->Dead()); | 233 Node* dead_node = graph()->NewNode(common_->Dead()); |
| 244 dead_control_.set(dead_node); | 234 dead_control_.set(dead_node); |
| 245 return dead_node; | 235 return dead_node; |
| 246 } | 236 } |
| 247 return dead_control_.get(); | 237 return dead_control_.get(); |
| 248 } | 238 } |
| 249 } | 239 } |
| 250 } | 240 } |
| 251 } // namespace v8::internal::compiler | 241 } // namespace v8::internal::compiler |
| OLD | NEW |