| 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 | 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 6283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6294 ASSERT(var != NULL); | 6294 ASSERT(var != NULL); |
| 6295 ASSERT(catch_excp_var != NULL); | 6295 ASSERT(catch_excp_var != NULL); |
| 6296 current_block_->statements->Add( | 6296 current_block_->statements->Add( |
| 6297 new StoreLocalNode(catch_pos, var, | 6297 new StoreLocalNode(catch_pos, var, |
| 6298 new LoadLocalNode(catch_pos, catch_excp_var))); | 6298 new LoadLocalNode(catch_pos, catch_excp_var))); |
| 6299 } | 6299 } |
| 6300 if (stack_trace_param.var != NULL) { | 6300 if (stack_trace_param.var != NULL) { |
| 6301 // A stack trace variable is specified in this block, so generate code | 6301 // A stack trace variable is specified in this block, so generate code |
| 6302 // to load the stack trace object (:stacktrace_var) into the stack trace | 6302 // to load the stack trace object (:stacktrace_var) into the stack trace |
| 6303 // variable specified in this block. | 6303 // variable specified in this block. |
| 6304 ArgumentListNode* no_args = new ArgumentListNode(catch_pos); |
| 6304 LocalVariable* trace = LookupLocalScope(*stack_trace_param.var); | 6305 LocalVariable* trace = LookupLocalScope(*stack_trace_param.var); |
| 6305 ASSERT(catch_trace_var != NULL); | 6306 ASSERT(catch_trace_var != NULL); |
| 6306 current_block_->statements->Add( | 6307 current_block_->statements->Add( |
| 6307 new StoreLocalNode(catch_pos, trace, | 6308 new StoreLocalNode(catch_pos, trace, |
| 6308 new LoadLocalNode(catch_pos, catch_trace_var))); | 6309 new LoadLocalNode(catch_pos, catch_trace_var))); |
| 6310 current_block_->statements->Add( |
| 6311 new InstanceCallNode( |
| 6312 catch_pos, |
| 6313 new LoadLocalNode(catch_pos, trace), |
| 6314 PrivateCoreLibName(Symbols::_setupFullStackTrace()), |
| 6315 no_args)); |
| 6309 } | 6316 } |
| 6310 | 6317 |
| 6311 ParseStatementSequence(); // Parse the catch handler code. | 6318 ParseStatementSequence(); // Parse the catch handler code. |
| 6312 current_block_->statements->Add( | 6319 current_block_->statements->Add( |
| 6313 new JumpNode(catch_pos, Token::kCONTINUE, end_catch_label)); | 6320 new JumpNode(catch_pos, Token::kCONTINUE, end_catch_label)); |
| 6314 SequenceNode* catch_handler = CloseBlock(); | 6321 SequenceNode* catch_handler = CloseBlock(); |
| 6315 ExpectToken(Token::kRBRACE); | 6322 ExpectToken(Token::kRBRACE); |
| 6316 | 6323 |
| 6317 if (!exception_param.type->IsDynamicType()) { // Has a type specification. | 6324 if (!exception_param.type->IsDynamicType()) { // Has a type specification. |
| 6318 // Now form an 'if type check' as an exception type exists in | 6325 // Now form an 'if type check' as an exception type exists in |
| (...skipping 3746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10065 void Parser::SkipQualIdent() { | 10072 void Parser::SkipQualIdent() { |
| 10066 ASSERT(IsIdentifier()); | 10073 ASSERT(IsIdentifier()); |
| 10067 ConsumeToken(); | 10074 ConsumeToken(); |
| 10068 if (CurrentToken() == Token::kPERIOD) { | 10075 if (CurrentToken() == Token::kPERIOD) { |
| 10069 ConsumeToken(); // Consume the kPERIOD token. | 10076 ConsumeToken(); // Consume the kPERIOD token. |
| 10070 ExpectIdentifier("identifier expected after '.'"); | 10077 ExpectIdentifier("identifier expected after '.'"); |
| 10071 } | 10078 } |
| 10072 } | 10079 } |
| 10073 | 10080 |
| 10074 } // namespace dart | 10081 } // namespace dart |
| OLD | NEW |