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

Unified Diff: runtime/vm/parser.cc

Issue 149603003: Fix stack height assertion code and free up a bit in the Function tag bits. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 32017)
+++ runtime/vm/parser.cc (working copy)
@@ -6785,12 +6785,19 @@
// Add the inlined finally block to the specified node.
void Parser::AddFinallyBlockToNode(AstNode* node,
InlinedFinallyNode* finally_node) {
- if (node->IsReturnNode()) {
- node->AsReturnNode()->AddInlinedFinallyNode(finally_node);
- } else {
- ASSERT(node->IsJumpNode());
- node->AsJumpNode()->AddInlinedFinallyNode(finally_node);
+ ReturnNode* return_node = node->AsReturnNode();
+ if (return_node != NULL) {
+ return_node->AddInlinedFinallyNode(finally_node);
+ if (return_node->saved_return_value_var() == NULL) {
+ LocalVariable* temp =
+ CreateTempConstVariable(node->token_pos(), "finally_ret_val");
+ return_node->set_saved_return_value_var(temp);
+ }
+ return;
}
+ JumpNode* jump_node = node->AsJumpNode();
+ ASSERT(jump_node != NULL);
+ jump_node->AddInlinedFinallyNode(finally_node);
}
@@ -7053,7 +7060,6 @@
// Finally parse the 'finally' block.
SequenceNode* finally_block = NULL;
if (CurrentToken() == Token::kFINALLY) {
- current_function().set_has_finally(true);
ConsumeToken(); // Consume the 'finally'.
const intptr_t finally_pos = TokenPos();
// Add the finally block to the exit points recorded so far.
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698