OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
6 | 6 |
7 #include "src/compiler/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1868 DCHECK_EQ(op->ValueInputCount(), value_input_count); | 1868 DCHECK_EQ(op->ValueInputCount(), value_input_count); |
1869 | 1869 |
1870 bool has_context = OperatorProperties::HasContextInput(op); | 1870 bool has_context = OperatorProperties::HasContextInput(op); |
1871 int frame_state_count = OperatorProperties::GetFrameStateInputCount(op); | 1871 int frame_state_count = OperatorProperties::GetFrameStateInputCount(op); |
1872 bool has_control = op->ControlInputCount() == 1; | 1872 bool has_control = op->ControlInputCount() == 1; |
1873 bool has_effect = op->EffectInputCount() == 1; | 1873 bool has_effect = op->EffectInputCount() == 1; |
1874 | 1874 |
1875 DCHECK_LT(op->ControlInputCount(), 2); | 1875 DCHECK_LT(op->ControlInputCount(), 2); |
1876 DCHECK_LT(op->EffectInputCount(), 2); | 1876 DCHECK_LT(op->EffectInputCount(), 2); |
1877 | 1877 |
1878 Node* result = NULL; | 1878 Node* result = nullptr; |
1879 if (!has_context && frame_state_count == 0 && !has_control && !has_effect) { | 1879 if (!has_context && frame_state_count == 0 && !has_control && !has_effect) { |
1880 result = graph()->NewNode(op, value_input_count, value_inputs, incomplete); | 1880 result = graph()->NewNode(op, value_input_count, value_inputs, incomplete); |
1881 } else { | 1881 } else { |
1882 int input_count_with_deps = value_input_count; | 1882 int input_count_with_deps = value_input_count; |
1883 if (has_context) ++input_count_with_deps; | 1883 if (has_context) ++input_count_with_deps; |
1884 input_count_with_deps += frame_state_count; | 1884 input_count_with_deps += frame_state_count; |
1885 if (has_control) ++input_count_with_deps; | 1885 if (has_control) ++input_count_with_deps; |
1886 if (has_effect) ++input_count_with_deps; | 1886 if (has_effect) ++input_count_with_deps; |
1887 Node** buffer = EnsureInputBufferSize(input_count_with_deps); | 1887 Node** buffer = EnsureInputBufferSize(input_count_with_deps); |
1888 memcpy(buffer, value_inputs, kPointerSize * value_input_count); | 1888 memcpy(buffer, value_inputs, kPointerSize * value_input_count); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 | 2003 |
2004 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 2004 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
2005 if (environment()->IsMarkedAsUnreachable()) return; | 2005 if (environment()->IsMarkedAsUnreachable()) return; |
2006 environment()->MarkAsUnreachable(); | 2006 environment()->MarkAsUnreachable(); |
2007 exit_controls_.push_back(exit); | 2007 exit_controls_.push_back(exit); |
2008 } | 2008 } |
2009 | 2009 |
2010 } // namespace compiler | 2010 } // namespace compiler |
2011 } // namespace internal | 2011 } // namespace internal |
2012 } // namespace v8 | 2012 } // namespace v8 |
OLD | NEW |