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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 environment()->BindAccumulator(context); | 935 environment()->BindAccumulator(context); |
936 } | 936 } |
937 | 937 |
938 void BytecodeGraphBuilder::VisitCreateFunctionContext() { | 938 void BytecodeGraphBuilder::VisitCreateFunctionContext() { |
939 uint32_t slots = bytecode_iterator().GetIndexOperand(0); | 939 uint32_t slots = bytecode_iterator().GetIndexOperand(0); |
940 const Operator* op = javascript()->CreateFunctionContext(slots); | 940 const Operator* op = javascript()->CreateFunctionContext(slots); |
941 Node* context = NewNode(op, GetFunctionClosure()); | 941 Node* context = NewNode(op, GetFunctionClosure()); |
942 environment()->BindAccumulator(context); | 942 environment()->BindAccumulator(context); |
943 } | 943 } |
944 | 944 |
| 945 void BytecodeGraphBuilder::VisitCreateWithContext() { |
| 946 Node* object = |
| 947 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 948 |
| 949 const Operator* op = javascript()->CreateWithContext(); |
| 950 Node* context = NewNode(op, object, environment()->LookupAccumulator()); |
| 951 environment()->BindAccumulator(context); |
| 952 } |
| 953 |
945 void BytecodeGraphBuilder::BuildCreateArguments(CreateArgumentsType type) { | 954 void BytecodeGraphBuilder::BuildCreateArguments(CreateArgumentsType type) { |
946 FrameStateBeforeAndAfter states(this); | 955 FrameStateBeforeAndAfter states(this); |
947 const Operator* op = javascript()->CreateArguments(type); | 956 const Operator* op = javascript()->CreateArguments(type); |
948 Node* object = NewNode(op, GetFunctionClosure()); | 957 Node* object = NewNode(op, GetFunctionClosure()); |
949 environment()->BindAccumulator(object, &states); | 958 environment()->BindAccumulator(object, &states); |
950 } | 959 } |
951 | 960 |
952 void BytecodeGraphBuilder::VisitCreateMappedArguments() { | 961 void BytecodeGraphBuilder::VisitCreateMappedArguments() { |
953 BuildCreateArguments(CreateArgumentsType::kMappedArguments); | 962 BuildCreateArguments(CreateArgumentsType::kMappedArguments); |
954 } | 963 } |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 // Phi does not exist yet, introduce one. | 1904 // Phi does not exist yet, introduce one. |
1896 value = NewPhi(inputs, value, control); | 1905 value = NewPhi(inputs, value, control); |
1897 value->ReplaceInput(inputs - 1, other); | 1906 value->ReplaceInput(inputs - 1, other); |
1898 } | 1907 } |
1899 return value; | 1908 return value; |
1900 } | 1909 } |
1901 | 1910 |
1902 } // namespace compiler | 1911 } // namespace compiler |
1903 } // namespace internal | 1912 } // namespace internal |
1904 } // namespace v8 | 1913 } // namespace v8 |
OLD | NEW |