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

Side by Side Diff: src/compiler/ast-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/access-builder.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 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 1473
1474 // If requested, clear message object as we enter the catch block. 1474 // If requested, clear message object as we enter the catch block.
1475 if (stmt->clear_pending_message()) { 1475 if (stmt->clear_pending_message()) {
1476 Node* the_hole = jsgraph()->TheHoleConstant(); 1476 Node* the_hole = jsgraph()->TheHoleConstant();
1477 NewNode(javascript()->StoreMessage(), the_hole); 1477 NewNode(javascript()->StoreMessage(), the_hole);
1478 } 1478 }
1479 1479
1480 // Create a catch scope that binds the exception. 1480 // Create a catch scope that binds the exception.
1481 Node* exception = try_control.GetExceptionNode(); 1481 Node* exception = try_control.GetExceptionNode();
1482 Handle<String> name = stmt->variable()->name(); 1482 Handle<String> name = stmt->variable()->name();
1483 const Operator* op = javascript()->CreateCatchContext(name); 1483 Handle<ScopeInfo> scope_info = stmt->scope()->scope_info();
1484 const Operator* op = javascript()->CreateCatchContext(name, scope_info);
1484 Node* context = NewNode(op, exception, GetFunctionClosureForContext()); 1485 Node* context = NewNode(op, exception, GetFunctionClosureForContext());
1485 1486
1486 // Evaluate the catch-block. 1487 // Evaluate the catch-block.
1487 VisitInScope(stmt->catch_block(), stmt->scope(), context); 1488 VisitInScope(stmt->catch_block(), stmt->scope(), context);
1488 try_control.EndCatch(); 1489 try_control.EndCatch();
1489 } 1490 }
1490 1491
1491 1492
1492 void AstGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) { 1493 void AstGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
1493 TryFinallyBuilder try_control(this); 1494 TryFinallyBuilder try_control(this);
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after
4332 // Phi does not exist yet, introduce one. 4333 // Phi does not exist yet, introduce one.
4333 value = NewPhi(inputs, value, control); 4334 value = NewPhi(inputs, value, control);
4334 value->ReplaceInput(inputs - 1, other); 4335 value->ReplaceInput(inputs - 1, other);
4335 } 4336 }
4336 return value; 4337 return value;
4337 } 4338 }
4338 4339
4339 } // namespace compiler 4340 } // namespace compiler
4340 } // namespace internal 4341 } // namespace internal
4341 } // namespace v8 4342 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-builder.cc ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698