| 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/compilation-info.h" | 7 #include "src/compilation-info.h" |
| 8 #include "src/compiler/bytecode-branch-analysis.h" | 8 #include "src/compiler/bytecode-branch-analysis.h" |
| 9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 const Operator* op = javascript()->CreateFunctionContext(slots); | 945 const Operator* op = javascript()->CreateFunctionContext(slots); |
| 946 Node* context = NewNode(op, GetFunctionClosure()); | 946 Node* context = NewNode(op, GetFunctionClosure()); |
| 947 environment()->BindAccumulator(context); | 947 environment()->BindAccumulator(context); |
| 948 } | 948 } |
| 949 | 949 |
| 950 void BytecodeGraphBuilder::VisitCreateCatchContext() { | 950 void BytecodeGraphBuilder::VisitCreateCatchContext() { |
| 951 interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0); | 951 interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0); |
| 952 Node* exception = environment()->LookupRegister(reg); | 952 Node* exception = environment()->LookupRegister(reg); |
| 953 Handle<String> name = | 953 Handle<String> name = |
| 954 Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); | 954 Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); |
| 955 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( |
| 956 bytecode_iterator().GetConstantForIndexOperand(2)); |
| 955 Node* closure = environment()->LookupAccumulator(); | 957 Node* closure = environment()->LookupAccumulator(); |
| 956 | 958 |
| 957 const Operator* op = javascript()->CreateCatchContext(name); | 959 const Operator* op = javascript()->CreateCatchContext(name, scope_info); |
| 958 Node* context = NewNode(op, exception, closure); | 960 Node* context = NewNode(op, exception, closure); |
| 959 environment()->BindAccumulator(context); | 961 environment()->BindAccumulator(context); |
| 960 } | 962 } |
| 961 | 963 |
| 962 void BytecodeGraphBuilder::VisitCreateWithContext() { | 964 void BytecodeGraphBuilder::VisitCreateWithContext() { |
| 963 Node* object = | 965 Node* object = |
| 964 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 966 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 965 | 967 |
| 966 const Operator* op = javascript()->CreateWithContext(); | 968 const Operator* op = javascript()->CreateWithContext(); |
| 967 Node* context = NewNode(op, object, environment()->LookupAccumulator()); | 969 Node* context = NewNode(op, object, environment()->LookupAccumulator()); |
| (...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1954 // Phi does not exist yet, introduce one. | 1956 // Phi does not exist yet, introduce one. |
| 1955 value = NewPhi(inputs, value, control); | 1957 value = NewPhi(inputs, value, control); |
| 1956 value->ReplaceInput(inputs - 1, other); | 1958 value->ReplaceInput(inputs - 1, other); |
| 1957 } | 1959 } |
| 1958 return value; | 1960 return value; |
| 1959 } | 1961 } |
| 1960 | 1962 |
| 1961 } // namespace compiler | 1963 } // namespace compiler |
| 1962 } // namespace internal | 1964 } // namespace internal |
| 1963 } // namespace v8 | 1965 } // namespace v8 |
| OLD | NEW |