| 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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 void BytecodeGraphBuilder::VisitCreateClosure() { | 919 void BytecodeGraphBuilder::VisitCreateClosure() { |
| 920 Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast( | 920 Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast( |
| 921 bytecode_iterator().GetConstantForIndexOperand(0)); | 921 bytecode_iterator().GetConstantForIndexOperand(0)); |
| 922 PretenureFlag tenured = | 922 PretenureFlag tenured = |
| 923 bytecode_iterator().GetFlagOperand(1) ? TENURED : NOT_TENURED; | 923 bytecode_iterator().GetFlagOperand(1) ? TENURED : NOT_TENURED; |
| 924 const Operator* op = javascript()->CreateClosure(shared_info, tenured); | 924 const Operator* op = javascript()->CreateClosure(shared_info, tenured); |
| 925 Node* closure = NewNode(op); | 925 Node* closure = NewNode(op); |
| 926 environment()->BindAccumulator(closure); | 926 environment()->BindAccumulator(closure); |
| 927 } | 927 } |
| 928 | 928 |
| 929 void BytecodeGraphBuilder::VisitCreateBlockContext() { |
| 930 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( |
| 931 bytecode_iterator().GetConstantForIndexOperand(0)); |
| 932 |
| 933 const Operator* op = javascript()->CreateBlockContext(scope_info); |
| 934 Node* context = NewNode(op, environment()->LookupAccumulator()); |
| 935 environment()->BindAccumulator(context); |
| 936 } |
| 937 |
| 929 void BytecodeGraphBuilder::VisitCreateFunctionContext() { | 938 void BytecodeGraphBuilder::VisitCreateFunctionContext() { |
| 930 uint32_t slots = bytecode_iterator().GetIndexOperand(0); | 939 uint32_t slots = bytecode_iterator().GetIndexOperand(0); |
| 931 const Operator* op = javascript()->CreateFunctionContext(slots); | 940 const Operator* op = javascript()->CreateFunctionContext(slots); |
| 932 Node* context = NewNode(op, GetFunctionClosure()); | 941 Node* context = NewNode(op, GetFunctionClosure()); |
| 933 environment()->BindAccumulator(context); | 942 environment()->BindAccumulator(context); |
| 934 } | 943 } |
| 935 | 944 |
| 936 void BytecodeGraphBuilder::BuildCreateArguments(CreateArgumentsType type) { | 945 void BytecodeGraphBuilder::BuildCreateArguments(CreateArgumentsType type) { |
| 937 FrameStateBeforeAndAfter states(this); | 946 FrameStateBeforeAndAfter states(this); |
| 938 const Operator* op = javascript()->CreateArguments(type); | 947 const Operator* op = javascript()->CreateArguments(type); |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 // Phi does not exist yet, introduce one. | 1895 // Phi does not exist yet, introduce one. |
| 1887 value = NewPhi(inputs, value, control); | 1896 value = NewPhi(inputs, value, control); |
| 1888 value->ReplaceInput(inputs - 1, other); | 1897 value->ReplaceInput(inputs - 1, other); |
| 1889 } | 1898 } |
| 1890 return value; | 1899 return value; |
| 1891 } | 1900 } |
| 1892 | 1901 |
| 1893 } // namespace compiler | 1902 } // namespace compiler |
| 1894 } // namespace internal | 1903 } // namespace internal |
| 1895 } // namespace v8 | 1904 } // namespace v8 |
| OLD | NEW |