| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/parser.h" | 5 #include "vm/parser.h" |
| 6 #include "vm/flags.h" | 6 #include "vm/flags.h" |
| 7 | 7 |
| 8 #ifndef DART_PRECOMPILED_RUNTIME | 8 #ifndef DART_PRECOMPILED_RUNTIME |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 6619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6630 current_block_->scope->LookupVariable(Symbols::ColonController(), false); | 6630 current_block_->scope->LookupVariable(Symbols::ColonController(), false); |
| 6631 ASSERT(controller != NULL); | 6631 ASSERT(controller != NULL); |
| 6632 ArgumentListNode* args = new (Z) ArgumentListNode(TokenPosition::kNoSource); | 6632 ArgumentListNode* args = new (Z) ArgumentListNode(TokenPosition::kNoSource); |
| 6633 args->Add(new (Z) | 6633 args->Add(new (Z) |
| 6634 LoadLocalNode(TokenPosition::kNoSource, exception_param.var)); | 6634 LoadLocalNode(TokenPosition::kNoSource, exception_param.var)); |
| 6635 args->Add(new (Z) | 6635 args->Add(new (Z) |
| 6636 LoadLocalNode(TokenPosition::kNoSource, stack_trace_param.var)); | 6636 LoadLocalNode(TokenPosition::kNoSource, stack_trace_param.var)); |
| 6637 current_block_->statements->Add(new (Z) InstanceCallNode( | 6637 current_block_->statements->Add(new (Z) InstanceCallNode( |
| 6638 try_end_pos, new (Z) LoadLocalNode(TokenPosition::kNoSource, controller), | 6638 try_end_pos, new (Z) LoadLocalNode(TokenPosition::kNoSource, controller), |
| 6639 Symbols::AddError(), args)); | 6639 Symbols::AddError(), args)); |
| 6640 ReturnNode* return_node = new (Z) ReturnNode(TokenPosition::kNoSource); | 6640 ReturnNode* return_node = new (Z) ReturnNode(try_end_pos); |
| 6641 AddNodeForFinallyInlining(return_node); | 6641 AddNodeForFinallyInlining(return_node); |
| 6642 current_block_->statements->Add(return_node); | 6642 current_block_->statements->Add(return_node); |
| 6643 AstNode* catch_block = CloseBlock(); | 6643 AstNode* catch_block = CloseBlock(); |
| 6644 current_block_->statements->Add(catch_block); | 6644 current_block_->statements->Add(catch_block); |
| 6645 SequenceNode* catch_handler_list = CloseBlock(); | 6645 SequenceNode* catch_handler_list = CloseBlock(); |
| 6646 | 6646 |
| 6647 TryStack* try_statement = PopTry(); | 6647 TryStack* try_statement = PopTry(); |
| 6648 ASSERT(try_stack_ == NULL); // We popped the outermost try block. | 6648 ASSERT(try_stack_ == NULL); // We popped the outermost try block. |
| 6649 | 6649 |
| 6650 // Finally block: closing the stream and returning. Instead of simply | 6650 // Finally block: closing the stream and returning. Instead of simply |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6780 ArgumentListNode* completer_args = | 6780 ArgumentListNode* completer_args = |
| 6781 new (Z) ArgumentListNode(TokenPosition::kNoSource); | 6781 new (Z) ArgumentListNode(TokenPosition::kNoSource); |
| 6782 completer_args->Add( | 6782 completer_args->Add( |
| 6783 new (Z) LoadLocalNode(TokenPosition::kNoSource, exception_param.var)); | 6783 new (Z) LoadLocalNode(TokenPosition::kNoSource, exception_param.var)); |
| 6784 completer_args->Add( | 6784 completer_args->Add( |
| 6785 new (Z) LoadLocalNode(TokenPosition::kNoSource, stack_trace_param.var)); | 6785 new (Z) LoadLocalNode(TokenPosition::kNoSource, stack_trace_param.var)); |
| 6786 current_block_->statements->Add(new (Z) InstanceCallNode( | 6786 current_block_->statements->Add(new (Z) InstanceCallNode( |
| 6787 func_end_pos, | 6787 func_end_pos, |
| 6788 new (Z) LoadLocalNode(TokenPosition::kNoSource, async_completer), | 6788 new (Z) LoadLocalNode(TokenPosition::kNoSource, async_completer), |
| 6789 Symbols::CompleterCompleteError(), completer_args)); | 6789 Symbols::CompleterCompleteError(), completer_args)); |
| 6790 ReturnNode* return_node = new (Z) ReturnNode(TokenPosition::kNoSource); | 6790 ReturnNode* return_node = new (Z) ReturnNode(func_end_pos); |
| 6791 // Behavior like a continuation return, i.e,. don't call a completer. | 6791 // Behavior like a continuation return, i.e,. don't call a completer. |
| 6792 return_node->set_return_type(ReturnNode::kContinuation); | 6792 return_node->set_return_type(ReturnNode::kContinuation); |
| 6793 current_block_->statements->Add(return_node); | 6793 current_block_->statements->Add(return_node); |
| 6794 AstNode* catch_block = CloseBlock(); | 6794 AstNode* catch_block = CloseBlock(); |
| 6795 current_block_->statements->Add(catch_block); | 6795 current_block_->statements->Add(catch_block); |
| 6796 SequenceNode* catch_handler_list = CloseBlock(); | 6796 SequenceNode* catch_handler_list = CloseBlock(); |
| 6797 | 6797 |
| 6798 const GrowableObjectArray& handler_types = | 6798 const GrowableObjectArray& handler_types = |
| 6799 GrowableObjectArray::Handle(Z, GrowableObjectArray::New(Heap::kOld)); | 6799 GrowableObjectArray::Handle(Z, GrowableObjectArray::New(Heap::kOld)); |
| 6800 handler_types.SetLength(0); | 6800 handler_types.SetLength(0); |
| (...skipping 2557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9358 if (outer_saved_try_ctx != NULL) { | 9358 if (outer_saved_try_ctx != NULL) { |
| 9359 current_block_->statements->Add(new (Z) StoreLocalNode( | 9359 current_block_->statements->Add(new (Z) StoreLocalNode( |
| 9360 TokenPosition::kNoSource, outer_saved_try_ctx, | 9360 TokenPosition::kNoSource, outer_saved_try_ctx, |
| 9361 new (Z) LoadLocalNode(TokenPosition::kNoSource, | 9361 new (Z) LoadLocalNode(TokenPosition::kNoSource, |
| 9362 outer_async_saved_try_ctx))); | 9362 outer_async_saved_try_ctx))); |
| 9363 } | 9363 } |
| 9364 // :for-in-iter.cancel(); | 9364 // :for-in-iter.cancel(); |
| 9365 ArgumentListNode* no_args = | 9365 ArgumentListNode* no_args = |
| 9366 new (Z) ArgumentListNode(TokenPosition::kNoSource); | 9366 new (Z) ArgumentListNode(TokenPosition::kNoSource); |
| 9367 current_block_->statements->Add(new (Z) InstanceCallNode( | 9367 current_block_->statements->Add(new (Z) InstanceCallNode( |
| 9368 TokenPosition::kNoSource, | 9368 ST(await_for_pos), |
| 9369 new (Z) LoadLocalNode(TokenPosition::kNoSource, iterator_var), | 9369 new (Z) LoadLocalNode(TokenPosition::kNoSource, iterator_var), |
| 9370 Symbols::Cancel(), no_args)); | 9370 Symbols::Cancel(), no_args)); |
| 9371 finally_clause = CloseBlock(); | 9371 finally_clause = CloseBlock(); |
| 9372 | 9372 |
| 9373 AstNode* node_to_inline = try_statement->GetNodeToInlineFinally(node_index); | 9373 AstNode* node_to_inline = try_statement->GetNodeToInlineFinally(node_index); |
| 9374 if (node_to_inline != NULL) { | 9374 if (node_to_inline != NULL) { |
| 9375 InlinedFinallyNode* node = | 9375 InlinedFinallyNode* node = |
| 9376 new (Z) InlinedFinallyNode(TokenPosition::kNoSource, finally_clause, | 9376 new (Z) InlinedFinallyNode(TokenPosition::kNoSource, finally_clause, |
| 9377 context_var, outer_try_index); | 9377 context_var, outer_try_index); |
| 9378 finally_clause = NULL; | 9378 finally_clause = NULL; |
| (...skipping 5828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15207 const ArgumentListNode& function_args, | 15207 const ArgumentListNode& function_args, |
| 15208 const LocalVariable* temp_for_last_arg, | 15208 const LocalVariable* temp_for_last_arg, |
| 15209 bool is_super_invocation) { | 15209 bool is_super_invocation) { |
| 15210 UNREACHABLE(); | 15210 UNREACHABLE(); |
| 15211 return NULL; | 15211 return NULL; |
| 15212 } | 15212 } |
| 15213 | 15213 |
| 15214 } // namespace dart | 15214 } // namespace dart |
| 15215 | 15215 |
| 15216 #endif // DART_PRECOMPILED_RUNTIME | 15216 #endif // DART_PRECOMPILED_RUNTIME |
| OLD | NEW |