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

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

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Changes from review Created 4 years 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/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/compiler-source-position-table.h" 10 #include "src/compiler/compiler-source-position-table.h"
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( 1133 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast(
1134 bytecode_iterator().GetConstantForIndexOperand(0)); 1134 bytecode_iterator().GetConstantForIndexOperand(0));
1135 1135
1136 const Operator* op = javascript()->CreateBlockContext(scope_info); 1136 const Operator* op = javascript()->CreateBlockContext(scope_info);
1137 Node* context = NewNode(op, environment()->LookupAccumulator()); 1137 Node* context = NewNode(op, environment()->LookupAccumulator());
1138 environment()->BindAccumulator(context); 1138 environment()->BindAccumulator(context);
1139 } 1139 }
1140 1140
1141 void BytecodeGraphBuilder::VisitCreateFunctionContext() { 1141 void BytecodeGraphBuilder::VisitCreateFunctionContext() {
1142 uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0); 1142 uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0);
1143 const Operator* op = javascript()->CreateFunctionContext(slots); 1143 const Operator* op =
1144 javascript()->CreateFunctionContext(slots, FUNCTION_SCOPE);
1144 Node* context = NewNode(op, GetFunctionClosure()); 1145 Node* context = NewNode(op, GetFunctionClosure());
1145 environment()->BindAccumulator(context); 1146 environment()->BindAccumulator(context);
1146 } 1147 }
1148
1149 void BytecodeGraphBuilder::VisitCreateEvalContext() {
1150 uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0);
1151 const Operator* op = javascript()->CreateFunctionContext(slots, EVAL_SCOPE);
1152 Node* context = NewNode(op, GetFunctionClosure());
1153 environment()->BindAccumulator(context);
1154 }
1147 1155
1148 void BytecodeGraphBuilder::VisitCreateCatchContext() { 1156 void BytecodeGraphBuilder::VisitCreateCatchContext() {
1149 interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0); 1157 interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0);
1150 Node* exception = environment()->LookupRegister(reg); 1158 Node* exception = environment()->LookupRegister(reg);
1151 Handle<String> name = 1159 Handle<String> name =
1152 Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); 1160 Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1));
1153 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( 1161 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast(
1154 bytecode_iterator().GetConstantForIndexOperand(2)); 1162 bytecode_iterator().GetConstantForIndexOperand(2));
1155 Node* closure = environment()->LookupAccumulator(); 1163 Node* closure = environment()->LookupAccumulator();
1156 1164
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 it->source_position().ScriptOffset(), start_position_.InliningId())); 2268 it->source_position().ScriptOffset(), start_position_.InliningId()));
2261 it->Advance(); 2269 it->Advance();
2262 } else { 2270 } else {
2263 DCHECK_GT(it->code_offset(), offset); 2271 DCHECK_GT(it->code_offset(), offset);
2264 } 2272 }
2265 } 2273 }
2266 2274
2267 } // namespace compiler 2275 } // namespace compiler
2268 } // namespace internal 2276 } // namespace internal
2269 } // namespace v8 2277 } // 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