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

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

Issue 2314483002: Store the ScopeInfo in WithContexts (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/ast/scopes.cc ('k') | src/compiler/bytecode-graph-builder.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/ast/compile-time-value.h" 7 #include "src/ast/compile-time-value.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.h" 10 #include "src/compiler.h"
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 VisitForValue(stmt->expression()); 1229 VisitForValue(stmt->expression());
1230 Node* result = environment()->Pop(); 1230 Node* result = environment()->Pop();
1231 execution_control()->ReturnValue(result); 1231 execution_control()->ReturnValue(result);
1232 } 1232 }
1233 1233
1234 1234
1235 void AstGraphBuilder::VisitWithStatement(WithStatement* stmt) { 1235 void AstGraphBuilder::VisitWithStatement(WithStatement* stmt) {
1236 VisitForValue(stmt->expression()); 1236 VisitForValue(stmt->expression());
1237 Node* value = environment()->Pop(); 1237 Node* value = environment()->Pop();
1238 Node* object = BuildToObject(value, stmt->ToObjectId()); 1238 Node* object = BuildToObject(value, stmt->ToObjectId());
1239 const Operator* op = javascript()->CreateWithContext(); 1239 Handle<ScopeInfo> scope_info = stmt->scope()->scope_info();
1240 const Operator* op = javascript()->CreateWithContext(scope_info);
1240 Node* context = NewNode(op, object, GetFunctionClosureForContext()); 1241 Node* context = NewNode(op, object, GetFunctionClosureForContext());
1241 PrepareFrameState(context, stmt->EntryId()); 1242 PrepareFrameState(context, stmt->EntryId());
1242 VisitInScope(stmt->statement(), stmt->scope(), context); 1243 VisitInScope(stmt->statement(), stmt->scope(), context);
1243 } 1244 }
1244 1245
1245 1246
1246 void AstGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { 1247 void AstGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
1247 ZoneList<CaseClause*>* clauses = stmt->cases(); 1248 ZoneList<CaseClause*>* clauses = stmt->cases();
1248 SwitchBuilder compare_switch(this, clauses->length()); 1249 SwitchBuilder compare_switch(this, clauses->length());
1249 ControlScopeForBreakable scope(this, stmt, &compare_switch); 1250 ControlScopeForBreakable scope(this, stmt, &compare_switch);
(...skipping 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after
4333 // Phi does not exist yet, introduce one. 4334 // Phi does not exist yet, introduce one.
4334 value = NewPhi(inputs, value, control); 4335 value = NewPhi(inputs, value, control);
4335 value->ReplaceInput(inputs - 1, other); 4336 value->ReplaceInput(inputs - 1, other);
4336 } 4337 }
4337 return value; 4338 return value;
4338 } 4339 }
4339 4340
4340 } // namespace compiler 4341 } // namespace compiler
4341 } // namespace internal 4342 } // namespace internal
4342 } // namespace v8 4343 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698