Chromium Code Reviews| 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 23 matching lines...) Expand all Loading... | |
| 34 | 34 |
| 35 bool has_context = OperatorProperties::HasContextInput(op); | 35 bool has_context = OperatorProperties::HasContextInput(op); |
| 36 bool has_framestate = OperatorProperties::HasFrameStateInput(op); | 36 bool has_framestate = OperatorProperties::HasFrameStateInput(op); |
| 37 bool has_control = OperatorProperties::GetControlInputCount(op) == 1; | 37 bool has_control = OperatorProperties::GetControlInputCount(op) == 1; |
| 38 bool has_effect = OperatorProperties::GetEffectInputCount(op) == 1; | 38 bool has_effect = OperatorProperties::GetEffectInputCount(op) == 1; |
| 39 | 39 |
| 40 DCHECK(OperatorProperties::GetControlInputCount(op) < 2); | 40 DCHECK(OperatorProperties::GetControlInputCount(op) < 2); |
| 41 DCHECK(OperatorProperties::GetEffectInputCount(op) < 2); | 41 DCHECK(OperatorProperties::GetEffectInputCount(op) < 2); |
| 42 | 42 |
| 43 Node* result = NULL; | 43 Node* result = NULL; |
| 44 if (!has_context && !has_control && !has_effect) { | 44 if (!has_context && !has_framestate && !has_control && !has_effect) { |
|
Jarin
2014/08/29 15:07:07
Good catch! Thanks for fixing.
sigurds
2014/09/01 08:48:18
Done.
| |
| 45 result = graph()->NewNode(op, value_input_count, value_inputs); | 45 result = graph()->NewNode(op, value_input_count, value_inputs); |
| 46 } else { | 46 } else { |
| 47 int input_count_with_deps = value_input_count; | 47 int input_count_with_deps = value_input_count; |
| 48 if (has_context) ++input_count_with_deps; | 48 if (has_context) ++input_count_with_deps; |
| 49 if (has_framestate) ++input_count_with_deps; | 49 if (has_framestate) ++input_count_with_deps; |
| 50 if (has_control) ++input_count_with_deps; | 50 if (has_control) ++input_count_with_deps; |
| 51 if (has_effect) ++input_count_with_deps; | 51 if (has_effect) ++input_count_with_deps; |
| 52 void* raw_buffer = alloca(kPointerSize * input_count_with_deps); | 52 void* raw_buffer = alloca(kPointerSize * input_count_with_deps); |
| 53 Node** buffer = reinterpret_cast<Node**>(raw_buffer); | 53 Node** buffer = reinterpret_cast<Node**>(raw_buffer); |
| 54 memcpy(buffer, value_inputs, kPointerSize * value_input_count); | 54 memcpy(buffer, value_inputs, kPointerSize * value_input_count); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 if (!dead_control_.is_set()) { | 242 if (!dead_control_.is_set()) { |
| 243 Node* dead_node = graph()->NewNode(common_->Dead()); | 243 Node* dead_node = graph()->NewNode(common_->Dead()); |
| 244 dead_control_.set(dead_node); | 244 dead_control_.set(dead_node); |
| 245 return dead_node; | 245 return dead_node; |
| 246 } | 246 } |
| 247 return dead_control_.get(); | 247 return dead_control_.get(); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 } // namespace v8::internal::compiler | 251 } // namespace v8::internal::compiler |
| OLD | NEW |