| 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/object_store.h" | 7 #include "vm/object_store.h" |
| 8 #include "vm/parser.h" | 8 #include "vm/parser.h" |
| 9 #include "vm/thread.h" | 9 #include "vm/thread.h" |
| 10 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 SequenceNode* error_ne_null_branch = | 208 SequenceNode* error_ne_null_branch = |
| 209 new (Z) SequenceNode(token_pos, ChainNewScope(preamble_->scope())); | 209 new (Z) SequenceNode(token_pos, ChainNewScope(preamble_->scope())); |
| 210 error_ne_null_branch->Add( | 210 error_ne_null_branch->Add( |
| 211 new (Z) ThrowNode(token_pos, load_error_param, load_stack_trace_param)); | 211 new (Z) ThrowNode(token_pos, load_error_param, load_stack_trace_param)); |
| 212 preamble_->Add(new (Z) IfNode( | 212 preamble_->Add(new (Z) IfNode( |
| 213 token_pos, new (Z) ComparisonNode( | 213 token_pos, new (Z) ComparisonNode( |
| 214 token_pos, Token::kNE, load_error_param, | 214 token_pos, Token::kNE, load_error_param, |
| 215 new (Z) LiteralNode(token_pos, Object::null_instance())), | 215 new (Z) LiteralNode(token_pos, Object::null_instance())), |
| 216 error_ne_null_branch, NULL)); | 216 error_ne_null_branch, NULL)); |
| 217 | 217 |
| 218 LocalVariable* result = AddNewTempVarToPreamble( | 218 result_ = MakeName(new (Z) LoadLocalNode(token_pos, result_param)); |
| 219 new (Z) LoadLocalNode(token_pos, result_param), ST(node->token_pos())); | |
| 220 result_ = new (Z) LoadLocalNode(token_pos, result); | |
| 221 } | 219 } |
| 222 | 220 |
| 223 | 221 |
| 224 // Transforms boolean expressions into a sequence of evaluatons that only lazily | 222 // Transforms boolean expressions into a sequence of evaluatons that only lazily |
| 225 // evaluate subexpressions. | 223 // evaluate subexpressions. |
| 226 // | 224 // |
| 227 // Example: | 225 // Example: |
| 228 // | 226 // |
| 229 // (a || b) only evaluates b if a is false | 227 // (a || b) only evaluates b if a is false |
| 230 // | 228 // |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 } | 507 } |
| 510 | 508 |
| 511 | 509 |
| 512 void AwaitTransformer::VisitThrowNode(ThrowNode* node) { | 510 void AwaitTransformer::VisitThrowNode(ThrowNode* node) { |
| 513 AstNode* new_exception = Transform(node->exception()); | 511 AstNode* new_exception = Transform(node->exception()); |
| 514 result_ = MakeName( | 512 result_ = MakeName( |
| 515 new (Z) ThrowNode(node->token_pos(), new_exception, node->stacktrace())); | 513 new (Z) ThrowNode(node->token_pos(), new_exception, node->stacktrace())); |
| 516 } | 514 } |
| 517 | 515 |
| 518 } // namespace dart | 516 } // namespace dart |
| OLD | NEW |