OLD | NEW |
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/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/compiler/ast-loop-assignment-analyzer.h" | 10 #include "src/compiler/ast-loop-assignment-analyzer.h" |
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1475 | 1475 |
1476 // If requested, clear message object as we enter the catch block. | 1476 // If requested, clear message object as we enter the catch block. |
1477 if (stmt->clear_pending_message()) { | 1477 if (stmt->clear_pending_message()) { |
1478 Node* the_hole = jsgraph()->TheHoleConstant(); | 1478 Node* the_hole = jsgraph()->TheHoleConstant(); |
1479 NewNode(javascript()->StoreMessage(), the_hole); | 1479 NewNode(javascript()->StoreMessage(), the_hole); |
1480 } | 1480 } |
1481 | 1481 |
1482 // Create a catch scope that binds the exception. | 1482 // Create a catch scope that binds the exception. |
1483 Node* exception = try_control.GetExceptionNode(); | 1483 Node* exception = try_control.GetExceptionNode(); |
1484 Handle<String> name = stmt->variable()->name(); | 1484 Handle<String> name = stmt->variable()->name(); |
1485 const Operator* op = javascript()->CreateCatchContext(name); | 1485 Handle<ScopeInfo> scope_info = stmt->scope()->scope_info(); |
| 1486 const Operator* op = javascript()->CreateCatchContext(name, scope_info); |
1486 Node* context = NewNode(op, exception, GetFunctionClosureForContext()); | 1487 Node* context = NewNode(op, exception, GetFunctionClosureForContext()); |
1487 | 1488 |
1488 // Evaluate the catch-block. | 1489 // Evaluate the catch-block. |
1489 VisitInScope(stmt->catch_block(), stmt->scope(), context); | 1490 VisitInScope(stmt->catch_block(), stmt->scope(), context); |
1490 try_control.EndCatch(); | 1491 try_control.EndCatch(); |
1491 } | 1492 } |
1492 | 1493 |
1493 | 1494 |
1494 void AstGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) { | 1495 void AstGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) { |
1495 TryFinallyBuilder try_control(this); | 1496 TryFinallyBuilder try_control(this); |
(...skipping 2841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4337 // Phi does not exist yet, introduce one. | 4338 // Phi does not exist yet, introduce one. |
4338 value = NewPhi(inputs, value, control); | 4339 value = NewPhi(inputs, value, control); |
4339 value->ReplaceInput(inputs - 1, other); | 4340 value->ReplaceInput(inputs - 1, other); |
4340 } | 4341 } |
4341 return value; | 4342 return value; |
4342 } | 4343 } |
4343 | 4344 |
4344 } // namespace compiler | 4345 } // namespace compiler |
4345 } // namespace internal | 4346 } // namespace internal |
4346 } // namespace v8 | 4347 } // namespace v8 |
OLD | NEW |