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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 PretenureFlag tenured = | 1010 PretenureFlag tenured = |
1011 bytecode_iterator().GetImmediateOperand(1) ? TENURED : NOT_TENURED; | 1011 bytecode_iterator().GetImmediateOperand(1) ? TENURED : NOT_TENURED; |
1012 const Operator* op = javascript()->CreateClosure(shared_info, tenured); | 1012 const Operator* op = javascript()->CreateClosure(shared_info, tenured); |
1013 Node* closure = NewNode(op); | 1013 Node* closure = NewNode(op); |
1014 environment()->BindAccumulator(closure); | 1014 environment()->BindAccumulator(closure); |
1015 } | 1015 } |
1016 | 1016 |
1017 void BytecodeGraphBuilder::VisitCreateClosureWide() { VisitCreateClosure(); } | 1017 void BytecodeGraphBuilder::VisitCreateClosureWide() { VisitCreateClosure(); } |
1018 | 1018 |
1019 void BytecodeGraphBuilder::BuildCreateArguments( | 1019 void BytecodeGraphBuilder::BuildCreateArguments( |
1020 CreateArgumentsParameters::Type type) { | 1020 CreateArgumentsParameters::Type type, int rest_index) { |
1021 FrameStateBeforeAndAfter states(this); | 1021 FrameStateBeforeAndAfter states(this); |
1022 const Operator* op = javascript()->CreateArguments(type, 0); | 1022 const Operator* op = javascript()->CreateArguments(type, rest_index); |
1023 Node* object = NewNode(op, GetFunctionClosure()); | 1023 Node* object = NewNode(op, GetFunctionClosure()); |
1024 environment()->BindAccumulator(object, &states); | 1024 environment()->BindAccumulator(object, &states); |
1025 } | 1025 } |
1026 | 1026 |
1027 void BytecodeGraphBuilder::VisitCreateMappedArguments() { | 1027 void BytecodeGraphBuilder::VisitCreateMappedArguments() { |
1028 BuildCreateArguments(CreateArgumentsParameters::kMappedArguments); | 1028 BuildCreateArguments(CreateArgumentsParameters::kMappedArguments, 0); |
1029 } | 1029 } |
1030 | 1030 |
1031 void BytecodeGraphBuilder::VisitCreateUnmappedArguments() { | 1031 void BytecodeGraphBuilder::VisitCreateUnmappedArguments() { |
1032 BuildCreateArguments(CreateArgumentsParameters::kUnmappedArguments); | 1032 BuildCreateArguments(CreateArgumentsParameters::kUnmappedArguments, 0); |
| 1033 } |
| 1034 |
| 1035 void BytecodeGraphBuilder::VisitCreateRestArguments() { |
| 1036 int index = |
| 1037 Smi::cast(*bytecode_iterator().GetConstantForIndexOperand(0))->value(); |
| 1038 BuildCreateArguments(CreateArgumentsParameters::kRestArray, index); |
1033 } | 1039 } |
1034 | 1040 |
1035 void BytecodeGraphBuilder::BuildCreateLiteral(const Operator* op) { | 1041 void BytecodeGraphBuilder::BuildCreateLiteral(const Operator* op) { |
1036 FrameStateBeforeAndAfter states(this); | 1042 FrameStateBeforeAndAfter states(this); |
1037 Node* literal = NewNode(op, GetFunctionClosure()); | 1043 Node* literal = NewNode(op, GetFunctionClosure()); |
1038 environment()->BindAccumulator(literal, &states); | 1044 environment()->BindAccumulator(literal, &states); |
1039 } | 1045 } |
1040 | 1046 |
1041 void BytecodeGraphBuilder::BuildCreateRegExpLiteral() { | 1047 void BytecodeGraphBuilder::BuildCreateRegExpLiteral() { |
1042 Handle<String> constant_pattern = | 1048 Handle<String> constant_pattern = |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 // Phi does not exist yet, introduce one. | 1847 // Phi does not exist yet, introduce one. |
1842 value = NewPhi(inputs, value, control); | 1848 value = NewPhi(inputs, value, control); |
1843 value->ReplaceInput(inputs - 1, other); | 1849 value->ReplaceInput(inputs - 1, other); |
1844 } | 1850 } |
1845 return value; | 1851 return value; |
1846 } | 1852 } |
1847 | 1853 |
1848 } // namespace compiler | 1854 } // namespace compiler |
1849 } // namespace internal | 1855 } // namespace internal |
1850 } // namespace v8 | 1856 } // namespace v8 |
OLD | NEW |