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

Side by Side Diff: runtime/vm/parser.cc

Issue 14757017: Enable optimizing try-finally. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 6188 matching lines...) Expand 10 before | Expand all | Expand 10 after
6199 6199
6200 // Add this individual catch handler to the catch handlers list. 6200 // Add this individual catch handler to the catch handlers list.
6201 current_block_->statements->Add(catch_clause); 6201 current_block_->statements->Add(catch_clause);
6202 } 6202 }
6203 catch_handler_list = CloseBlock(); 6203 catch_handler_list = CloseBlock();
6204 TryBlocks* inner_try_block = PopTryBlock(); 6204 TryBlocks* inner_try_block = PopTryBlock();
6205 6205
6206 // Finally parse the 'finally' block. 6206 // Finally parse the 'finally' block.
6207 SequenceNode* finally_block = NULL; 6207 SequenceNode* finally_block = NULL;
6208 if (CurrentToken() == Token::kFINALLY) { 6208 if (CurrentToken() == Token::kFINALLY) {
6209 current_function().set_is_optimizable(false);
6210 current_function().set_has_finally(true); 6209 current_function().set_has_finally(true);
6211 ConsumeToken(); // Consume the 'finally'. 6210 ConsumeToken(); // Consume the 'finally'.
6212 const intptr_t finally_pos = TokenPos(); 6211 const intptr_t finally_pos = TokenPos();
6213 // Add the finally block to the exit points recorded so far. 6212 // Add the finally block to the exit points recorded so far.
6214 intptr_t node_index = 0; 6213 intptr_t node_index = 0;
6215 AstNode* node_to_inline = 6214 AstNode* node_to_inline =
6216 inner_try_block->GetNodeToInlineFinally(node_index); 6215 inner_try_block->GetNodeToInlineFinally(node_index);
6217 while (node_to_inline != NULL) { 6216 while (node_to_inline != NULL) {
6218 finally_block = ParseFinallyBlock(); 6217 finally_block = ParseFinallyBlock();
6219 InlinedFinallyNode* node = new InlinedFinallyNode(finally_pos, 6218 InlinedFinallyNode* node = new InlinedFinallyNode(finally_pos,
(...skipping 3734 matching lines...) Expand 10 before | Expand all | Expand 10 after
9954 void Parser::SkipQualIdent() { 9953 void Parser::SkipQualIdent() {
9955 ASSERT(IsIdentifier()); 9954 ASSERT(IsIdentifier());
9956 ConsumeToken(); 9955 ConsumeToken();
9957 if (CurrentToken() == Token::kPERIOD) { 9956 if (CurrentToken() == Token::kPERIOD) {
9958 ConsumeToken(); // Consume the kPERIOD token. 9957 ConsumeToken(); // Consume the kPERIOD token.
9959 ExpectIdentifier("identifier expected after '.'"); 9958 ExpectIdentifier("identifier expected after '.'");
9960 } 9959 }
9961 } 9960 }
9962 9961
9963 } // namespace dart 9962 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698