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

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

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Changes based on review commnets 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
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 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( 1120 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast(
1121 bytecode_iterator().GetConstantForIndexOperand(0)); 1121 bytecode_iterator().GetConstantForIndexOperand(0));
1122 1122
1123 const Operator* op = javascript()->CreateBlockContext(scope_info); 1123 const Operator* op = javascript()->CreateBlockContext(scope_info);
1124 Node* context = NewNode(op, environment()->LookupAccumulator()); 1124 Node* context = NewNode(op, environment()->LookupAccumulator());
1125 environment()->BindAccumulator(context); 1125 environment()->BindAccumulator(context);
1126 } 1126 }
1127 1127
1128 void BytecodeGraphBuilder::VisitCreateFunctionContext() { 1128 void BytecodeGraphBuilder::VisitCreateFunctionContext() {
1129 uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0); 1129 uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0);
1130 const Operator* op = javascript()->CreateFunctionContext(slots); 1130 const Operator* op =
1131 javascript()->CreateFunctionContext(slots, FUNCTION_SCOPE);
1131 Node* context = NewNode(op, GetFunctionClosure()); 1132 Node* context = NewNode(op, GetFunctionClosure());
1132 environment()->BindAccumulator(context); 1133 environment()->BindAccumulator(context);
1133 } 1134 }
1135
1136 void BytecodeGraphBuilder::VisitCreateEvalContext() {
1137 uint32_t slots = bytecode_iterator().GetUnsignedImmediateOperand(0);
1138 const Operator* op = javascript()->CreateFunctionContext(slots, EVAL_SCOPE);
1139 Node* context = NewNode(op, GetFunctionClosure());
1140 environment()->BindAccumulator(context);
1141 }
1134 1142
1135 void BytecodeGraphBuilder::VisitCreateCatchContext() { 1143 void BytecodeGraphBuilder::VisitCreateCatchContext() {
1136 interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0); 1144 interpreter::Register reg = bytecode_iterator().GetRegisterOperand(0);
1137 Node* exception = environment()->LookupRegister(reg); 1145 Node* exception = environment()->LookupRegister(reg);
1138 Handle<String> name = 1146 Handle<String> name =
1139 Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); 1147 Handle<String>::cast(bytecode_iterator().GetConstantForIndexOperand(1));
1140 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast( 1148 Handle<ScopeInfo> scope_info = Handle<ScopeInfo>::cast(
1141 bytecode_iterator().GetConstantForIndexOperand(2)); 1149 bytecode_iterator().GetConstantForIndexOperand(2));
1142 Node* closure = environment()->LookupAccumulator(); 1150 Node* closure = environment()->LookupAccumulator();
1143 1151
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 it->source_position().ScriptOffset(), start_position_.InliningId())); 2244 it->source_position().ScriptOffset(), start_position_.InliningId()));
2237 it->Advance(); 2245 it->Advance();
2238 } else { 2246 } else {
2239 DCHECK_GT(it->code_offset(), offset); 2247 DCHECK_GT(it->code_offset(), offset);
2240 } 2248 }
2241 } 2249 }
2242 2250
2243 } // namespace compiler 2251 } // namespace compiler
2244 } // namespace internal 2252 } // namespace internal
2245 } // namespace v8 2253 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698