Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 2302013002: Store the scope info in catch contexts (Closed)
Patch Set: updates Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/js-create-lowering.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/js-create-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698