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/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 try_control.BeginTry(); | 1467 try_control.BeginTry(); |
1468 { | 1468 { |
1469 ControlScopeForCatch scope(this, &try_control); | 1469 ControlScopeForCatch scope(this, &try_control); |
1470 STATIC_ASSERT(TryBlockConstant::kElementCount == 1); | 1470 STATIC_ASSERT(TryBlockConstant::kElementCount == 1); |
1471 environment()->Push(current_context()); | 1471 environment()->Push(current_context()); |
1472 Visit(stmt->try_block()); | 1472 Visit(stmt->try_block()); |
1473 environment()->Pop(); | 1473 environment()->Pop(); |
1474 } | 1474 } |
1475 try_control.EndTry(); | 1475 try_control.EndTry(); |
1476 | 1476 |
| 1477 // Clear message object as we enter the catch block. |
| 1478 ExternalReference message_object = |
| 1479 ExternalReference::address_of_pending_message_obj(isolate()); |
| 1480 Node* the_hole = jsgraph()->TheHoleConstant(); |
| 1481 BuildStoreExternal(message_object, kMachAnyTagged, the_hole); |
| 1482 |
1477 // Create a catch scope that binds the exception. | 1483 // Create a catch scope that binds the exception. |
1478 Node* exception = try_control.GetExceptionNode(); | 1484 Node* exception = try_control.GetExceptionNode(); |
1479 Unique<String> name = MakeUnique(stmt->variable()->name()); | 1485 Unique<String> name = MakeUnique(stmt->variable()->name()); |
1480 const Operator* op = javascript()->CreateCatchContext(name); | 1486 const Operator* op = javascript()->CreateCatchContext(name); |
1481 Node* context = NewNode(op, exception, GetFunctionClosure()); | 1487 Node* context = NewNode(op, exception, GetFunctionClosure()); |
1482 PrepareFrameState(context, BailoutId::None()); | 1488 PrepareFrameState(context, BailoutId::None()); |
1483 { | 1489 { |
1484 ContextScope scope(this, stmt->scope(), context); | 1490 ContextScope scope(this, stmt->scope(), context); |
1485 DCHECK(stmt->scope()->declarations()->is_empty()); | 1491 DCHECK(stmt->scope()->declarations()->is_empty()); |
1486 // Evaluate the catch-block. | 1492 // Evaluate the catch-block. |
(...skipping 2291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3778 // Phi does not exist yet, introduce one. | 3784 // Phi does not exist yet, introduce one. |
3779 value = NewPhi(inputs, value, control); | 3785 value = NewPhi(inputs, value, control); |
3780 value->ReplaceInput(inputs - 1, other); | 3786 value->ReplaceInput(inputs - 1, other); |
3781 } | 3787 } |
3782 return value; | 3788 return value; |
3783 } | 3789 } |
3784 | 3790 |
3785 } // namespace compiler | 3791 } // namespace compiler |
3786 } // namespace internal | 3792 } // namespace internal |
3787 } // namespace v8 | 3793 } // namespace v8 |
OLD | NEW |