| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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/ast_transformer.h" | 5 #include "vm/ast_transformer.h" |
| 6 | 6 |
| 7 #include "vm/parser.h" | 7 #include "vm/parser.h" |
| 8 | 8 |
| 9 namespace dart { | 9 namespace dart { |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 | 43 |
| 44 AstNode* AwaitTransformer::Transform(AstNode* expr) { | 44 AstNode* AwaitTransformer::Transform(AstNode* expr) { |
| 45 expr->Visit(this); | 45 expr->Visit(this); |
| 46 return result_; | 46 return result_; |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 LocalVariable* AwaitTransformer::EnsureCurrentTempVar() { | 50 LocalVariable* AwaitTransformer::EnsureCurrentTempVar() { |
| 51 const char* await_temp_prefix = ":await_temp_var_"; | 51 const char* await_temp_prefix = ":await_temp_var_"; |
| 52 const String& cnt_str = String::ZoneHandle(I, | 52 const String& cnt_str = String::ZoneHandle( |
| 53 String::NewFormatted( | 53 I, String::NewFormatted("%s%d", await_temp_prefix, temp_cnt_)); |
| 54 "%s%" Pd "", await_temp_prefix, temp_cnt_)); | |
| 55 const String& symbol = String::ZoneHandle(I, Symbols::New(cnt_str)); | 54 const String& symbol = String::ZoneHandle(I, Symbols::New(cnt_str)); |
| 56 ASSERT(!symbol.IsNull()); | 55 ASSERT(!symbol.IsNull()); |
| 57 LocalVariable* await_tmp = | 56 LocalVariable* await_tmp = |
| 58 parsed_function_->await_temps_scope()->LookupVariable(symbol, false); | 57 parsed_function_->await_temps_scope()->LookupVariable(symbol, false); |
| 59 if (await_tmp == NULL) { | 58 if (await_tmp == NULL) { |
| 60 await_tmp = new(I) LocalVariable( | 59 await_tmp = new(I) LocalVariable( |
| 61 Scanner::kNoSourcePos, | 60 Scanner::kNoSourcePos, |
| 62 symbol, | 61 symbol, |
| 63 Type::ZoneHandle(I, Type::DynamicType())); | 62 Type::ZoneHandle(I, Type::DynamicType())); |
| 64 parsed_function_->await_temps_scope()->AddVariable(await_tmp); | 63 parsed_function_->await_temps_scope()->AddVariable(await_tmp); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 void AwaitTransformer::VisitThrowNode(ThrowNode* node) { | 498 void AwaitTransformer::VisitThrowNode(ThrowNode* node) { |
| 500 // TODO(mlippautz): Check if relevant. | 499 // TODO(mlippautz): Check if relevant. |
| 501 AstNode* new_exception = Transform(node->exception()); | 500 AstNode* new_exception = Transform(node->exception()); |
| 502 AstNode* new_stacktrace = Transform(node->stacktrace()); | 501 AstNode* new_stacktrace = Transform(node->stacktrace()); |
| 503 result_ = new(I) ThrowNode(node->token_pos(), | 502 result_ = new(I) ThrowNode(node->token_pos(), |
| 504 new_exception, | 503 new_exception, |
| 505 new_stacktrace); | 504 new_stacktrace); |
| 506 } | 505 } |
| 507 | 506 |
| 508 } // namespace dart | 507 } // namespace dart |
| OLD | NEW |