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 #ifndef VM_AST_H_ | 5 #ifndef VM_AST_H_ |
6 #define VM_AST_H_ | 6 #define VM_AST_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 DISALLOW_IMPLICIT_CONSTRUCTORS(AssignableNode); | 534 DISALLOW_IMPLICIT_CONSTRUCTORS(AssignableNode); |
535 }; | 535 }; |
536 | 536 |
537 | 537 |
538 class ClosureNode : public AstNode { | 538 class ClosureNode : public AstNode { |
539 public: | 539 public: |
540 ClosureNode(TokenPosition token_pos, | 540 ClosureNode(TokenPosition token_pos, |
541 const Function& function, | 541 const Function& function, |
542 AstNode* receiver, // Non-null for implicit instance closures. | 542 AstNode* receiver, // Non-null for implicit instance closures. |
543 LocalScope* scope) // Null for implicit closures or functions | 543 LocalScope* scope) // Null for implicit closures. |
544 // that already have a ContextScope because | |
545 // they were compiled before. | |
546 : AstNode(token_pos), | 544 : AstNode(token_pos), |
547 function_(function), | 545 function_(function), |
548 receiver_(receiver), | 546 receiver_(receiver), |
549 scope_(scope), | 547 scope_(scope), |
550 is_deferred_reference_(false) { | 548 is_deferred_reference_(false) { |
551 ASSERT(function_.IsZoneHandle()); | 549 ASSERT(function_.IsZoneHandle()); |
552 ASSERT((function_.IsNonImplicitClosureFunction() && (receiver_ == NULL)) || | 550 ASSERT((function_.IsNonImplicitClosureFunction() && |
| 551 (receiver_ == NULL) && (scope_ != NULL)) || |
553 (function_.IsImplicitInstanceClosureFunction() && | 552 (function_.IsImplicitInstanceClosureFunction() && |
554 (receiver_ != NULL) && (scope_ == NULL)) || | 553 (receiver_ != NULL) && (scope_ == NULL)) || |
555 (function_.IsImplicitStaticClosureFunction() && | 554 (function_.IsImplicitStaticClosureFunction() && |
556 (receiver_ == NULL) && (scope_ == NULL))); | 555 (receiver_ == NULL) && (scope_ == NULL))); |
557 } | 556 } |
558 | 557 |
559 const Function& function() const { return function_; } | 558 const Function& function() const { return function_; } |
560 AstNode* receiver() const { return receiver_; } | 559 AstNode* receiver() const { return receiver_; } |
561 LocalScope* scope() const { return scope_; } | 560 LocalScope* scope() const { return scope_; } |
562 | 561 |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 const intptr_t try_index_; | 2014 const intptr_t try_index_; |
2016 | 2015 |
2017 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 2016 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
2018 }; | 2017 }; |
2019 | 2018 |
2020 } // namespace dart | 2019 } // namespace dart |
2021 | 2020 |
2022 #undef DECLARE_COMMON_NODE_FUNCTIONS | 2021 #undef DECLARE_COMMON_NODE_FUNCTIONS |
2023 | 2022 |
2024 #endif // VM_AST_H_ | 2023 #endif // VM_AST_H_ |
OLD | NEW |