| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 RUNTIME_VM_KERNEL_H_ | 5 #ifndef RUNTIME_VM_KERNEL_H_ |
| 6 #define RUNTIME_VM_KERNEL_H_ | 6 #define RUNTIME_VM_KERNEL_H_ |
| 7 | 7 |
| 8 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 class Field; | 128 class Field; |
| 129 class ParsedFunction; | 129 class ParsedFunction; |
| 130 class Zone; | 130 class Zone; |
| 131 | 131 |
| 132 namespace kernel { | 132 namespace kernel { |
| 133 | 133 |
| 134 | 134 |
| 135 class Reader; | 135 class Reader; |
| 136 class TreeNode; | 136 class TreeNode; |
| 137 class TypeParameter; | 137 class TypeParameter; |
| 138 class Writer; | |
| 139 | 138 |
| 140 // Boxes a value of type `T*` and `delete`s it on destruction. | 139 // Boxes a value of type `T*` and `delete`s it on destruction. |
| 141 template <typename T> | 140 template <typename T> |
| 142 class Child { | 141 class Child { |
| 143 public: | 142 public: |
| 144 Child() : pointer_(NULL) {} | 143 Child() : pointer_(NULL) {} |
| 145 explicit Child(T* value) : pointer_(value) {} | 144 explicit Child(T* value) : pointer_(value) {} |
| 146 | 145 |
| 147 ~Child() { delete pointer_; } | 146 ~Child() { delete pointer_; } |
| 148 | 147 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 191 |
| 193 template <typename IT> | 192 template <typename IT> |
| 194 void ReadFrom(Reader* reader); | 193 void ReadFrom(Reader* reader); |
| 195 | 194 |
| 196 template <typename IT> | 195 template <typename IT> |
| 197 void ReadFrom(Reader* reader, TreeNode* parent); | 196 void ReadFrom(Reader* reader, TreeNode* parent); |
| 198 | 197 |
| 199 template <typename IT> | 198 template <typename IT> |
| 200 void ReadFromStatic(Reader* reader); | 199 void ReadFromStatic(Reader* reader); |
| 201 | 200 |
| 202 void WriteTo(Writer* writer); | |
| 203 | |
| 204 template <typename IT> | |
| 205 void WriteToStatic(Writer* writer); | |
| 206 | |
| 207 // Extends the array to at least be able to hold [length] elements. | 201 // Extends the array to at least be able to hold [length] elements. |
| 208 // | 202 // |
| 209 // Free places will be filled with `NULL` values. | 203 // Free places will be filled with `NULL` values. |
| 210 void EnsureInitialized(int length); | 204 void EnsureInitialized(int length); |
| 211 | 205 |
| 212 // Returns element at [index]. | 206 // Returns element at [index]. |
| 213 // | 207 // |
| 214 // If the array is not big enough, it will be grown via `EnsureInitialized`. | 208 // If the array is not big enough, it will be grown via `EnsureInitialized`. |
| 215 // If the element doesn't exist, it will be created via `new IT()`. | 209 // If the element doesn't exist, it will be created via `new IT()`. |
| 216 template <typename IT> | 210 template <typename IT> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 233 T** array_; | 227 T** array_; |
| 234 int length_; | 228 int length_; |
| 235 | 229 |
| 236 DISALLOW_COPY_AND_ASSIGN(List); | 230 DISALLOW_COPY_AND_ASSIGN(List); |
| 237 }; | 231 }; |
| 238 | 232 |
| 239 | 233 |
| 240 class TypeParameterList : public List<TypeParameter> { | 234 class TypeParameterList : public List<TypeParameter> { |
| 241 public: | 235 public: |
| 242 void ReadFrom(Reader* reader); | 236 void ReadFrom(Reader* reader); |
| 243 void WriteTo(Writer* writer); | |
| 244 }; | 237 }; |
| 245 | 238 |
| 246 | 239 |
| 247 template <typename A, typename B> | 240 template <typename A, typename B> |
| 248 class Tuple { | 241 class Tuple { |
| 249 public: | 242 public: |
| 250 static Tuple<A, B>* ReadFrom(Reader* reader); | 243 static Tuple<A, B>* ReadFrom(Reader* reader); |
| 251 void WriteTo(Writer* writer); | |
| 252 | 244 |
| 253 Tuple(A* a, B* b) : first_(a), second_(b) {} | 245 Tuple(A* a, B* b) : first_(a), second_(b) {} |
| 254 | 246 |
| 255 A* first() { return first_; } | 247 A* first() { return first_; } |
| 256 B* second() { return second_; } | 248 B* second() { return second_; } |
| 257 | 249 |
| 258 private: | 250 private: |
| 259 Tuple() {} | 251 Tuple() {} |
| 260 | 252 |
| 261 Ref<A> first_; | 253 Ref<A> first_; |
| 262 Child<B> second_; | 254 Child<B> second_; |
| 263 | 255 |
| 264 DISALLOW_COPY_AND_ASSIGN(Tuple); | 256 DISALLOW_COPY_AND_ASSIGN(Tuple); |
| 265 }; | 257 }; |
| 266 | 258 |
| 267 | 259 |
| 268 class String { | 260 class String { |
| 269 public: | 261 public: |
| 270 static String* ReadFrom(Reader* reader); | 262 static String* ReadFrom(Reader* reader); |
| 271 static String* ReadFromImpl(Reader* reader); | 263 static String* ReadFromImpl(Reader* reader); |
| 272 void WriteTo(Writer* writer); | |
| 273 void WriteToImpl(Writer* writer); | |
| 274 | 264 |
| 275 String(const uint8_t* utf8, int length) { | 265 String(const uint8_t* utf8, int length) { |
| 276 buffer_ = new uint8_t[length]; | 266 buffer_ = new uint8_t[length]; |
| 277 size_ = length; | 267 size_ = length; |
| 278 memmove(buffer_, utf8, length); | 268 memmove(buffer_, utf8, length); |
| 279 } | 269 } |
| 280 ~String() { delete[] buffer_; } | 270 ~String() { delete[] buffer_; } |
| 281 | 271 |
| 282 uint8_t* buffer() { return buffer_; } | 272 uint8_t* buffer() { return buffer_; } |
| 283 int size() { return size_; } | 273 int size() { return size_; } |
| 284 | 274 |
| 285 bool is_empty() { return size_ == 0; } | 275 bool is_empty() { return size_ == 0; } |
| 286 | 276 |
| 287 private: | 277 private: |
| 288 uint8_t* buffer_; | 278 uint8_t* buffer_; |
| 289 int size_; | 279 int size_; |
| 290 | 280 |
| 291 DISALLOW_COPY_AND_ASSIGN(String); | 281 DISALLOW_COPY_AND_ASSIGN(String); |
| 292 }; | 282 }; |
| 293 | 283 |
| 294 | 284 |
| 295 class StringTable { | 285 class StringTable { |
| 296 public: | 286 public: |
| 297 void ReadFrom(Reader* reader); | 287 void ReadFrom(Reader* reader); |
| 298 void WriteTo(Writer* writer); | |
| 299 | 288 |
| 300 List<String>& strings() { return strings_; } | 289 List<String>& strings() { return strings_; } |
| 301 | 290 |
| 302 private: | 291 private: |
| 303 StringTable() {} | 292 StringTable() {} |
| 304 | 293 |
| 305 friend class Program; | 294 friend class Program; |
| 306 | 295 |
| 307 List<String> strings_; | 296 List<String> strings_; |
| 308 | 297 |
| 309 DISALLOW_COPY_AND_ASSIGN(StringTable); | 298 DISALLOW_COPY_AND_ASSIGN(StringTable); |
| 310 }; | 299 }; |
| 311 | 300 |
| 312 | 301 |
| 313 class SourceTable { | 302 class SourceTable { |
| 314 public: | 303 public: |
| 315 void ReadFrom(Reader* reader); | 304 void ReadFrom(Reader* reader); |
| 316 void WriteTo(Writer* writer); | |
| 317 ~SourceTable() { | 305 ~SourceTable() { |
| 318 for (intptr_t i = 0; i < size_; ++i) { | 306 for (intptr_t i = 0; i < size_; ++i) { |
| 319 delete source_code_[i]; | 307 delete source_code_[i]; |
| 320 delete[] line_starts_[i]; | 308 delete[] line_starts_[i]; |
| 321 } | 309 } |
| 322 delete[] source_code_; | 310 delete[] source_code_; |
| 323 delete[] line_starts_; | 311 delete[] line_starts_; |
| 324 delete[] line_count_; | 312 delete[] line_count_; |
| 325 } | 313 } |
| 326 | 314 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 TreeNode() {} | 396 TreeNode() {} |
| 409 | 397 |
| 410 private: | 398 private: |
| 411 DISALLOW_COPY_AND_ASSIGN(TreeNode); | 399 DISALLOW_COPY_AND_ASSIGN(TreeNode); |
| 412 }; | 400 }; |
| 413 | 401 |
| 414 | 402 |
| 415 class Library : public TreeNode { | 403 class Library : public TreeNode { |
| 416 public: | 404 public: |
| 417 Library* ReadFrom(Reader* reader); | 405 Library* ReadFrom(Reader* reader); |
| 418 void WriteTo(Writer* writer); | |
| 419 | 406 |
| 420 virtual ~Library(); | 407 virtual ~Library(); |
| 421 | 408 |
| 422 DEFINE_CASTING_OPERATIONS(Library); | 409 DEFINE_CASTING_OPERATIONS(Library); |
| 423 | 410 |
| 424 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 411 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 425 virtual void VisitChildren(Visitor* visitor); | 412 virtual void VisitChildren(Visitor* visitor); |
| 426 | 413 |
| 427 String* import_uri() { return import_uri_; } | 414 String* import_uri() { return import_uri_; } |
| 428 intptr_t source_uri_index() { return source_uri_index_; } | 415 intptr_t source_uri_index() { return source_uri_index_; } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 List<Field> fields_; | 453 List<Field> fields_; |
| 467 List<Procedure> procedures_; | 454 List<Procedure> procedures_; |
| 468 | 455 |
| 469 DISALLOW_COPY_AND_ASSIGN(Library); | 456 DISALLOW_COPY_AND_ASSIGN(Library); |
| 470 }; | 457 }; |
| 471 | 458 |
| 472 | 459 |
| 473 class Class : public TreeNode { | 460 class Class : public TreeNode { |
| 474 public: | 461 public: |
| 475 Class* ReadFrom(Reader* reader); | 462 Class* ReadFrom(Reader* reader); |
| 476 void WriteTo(Writer* writer); | |
| 477 | 463 |
| 478 virtual ~Class(); | 464 virtual ~Class(); |
| 479 | 465 |
| 480 DEFINE_CASTING_OPERATIONS(Class); | 466 DEFINE_CASTING_OPERATIONS(Class); |
| 481 | 467 |
| 482 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 468 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 483 virtual void AcceptClassVisitor(ClassVisitor* visitor) = 0; | 469 virtual void AcceptClassVisitor(ClassVisitor* visitor) = 0; |
| 484 virtual void AcceptReferenceVisitor(ClassReferenceVisitor* visitor) = 0; | 470 virtual void AcceptReferenceVisitor(ClassReferenceVisitor* visitor) = 0; |
| 485 | 471 |
| 486 Library* parent() { return parent_; } | 472 Library* parent() { return parent_; } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 510 List<Expression> annotations_; | 496 List<Expression> annotations_; |
| 511 TokenPosition position_; | 497 TokenPosition position_; |
| 512 | 498 |
| 513 DISALLOW_COPY_AND_ASSIGN(Class); | 499 DISALLOW_COPY_AND_ASSIGN(Class); |
| 514 }; | 500 }; |
| 515 | 501 |
| 516 | 502 |
| 517 class NormalClass : public Class { | 503 class NormalClass : public Class { |
| 518 public: | 504 public: |
| 519 NormalClass* ReadFrom(Reader* reader); | 505 NormalClass* ReadFrom(Reader* reader); |
| 520 void WriteTo(Writer* writer); | |
| 521 | 506 |
| 522 virtual ~NormalClass(); | 507 virtual ~NormalClass(); |
| 523 | 508 |
| 524 DEFINE_CASTING_OPERATIONS(NormalClass); | 509 DEFINE_CASTING_OPERATIONS(NormalClass); |
| 525 | 510 |
| 526 virtual void AcceptClassVisitor(ClassVisitor* visitor); | 511 virtual void AcceptClassVisitor(ClassVisitor* visitor); |
| 527 virtual void AcceptReferenceVisitor(ClassReferenceVisitor* visitor); | 512 virtual void AcceptReferenceVisitor(ClassReferenceVisitor* visitor); |
| 528 virtual void VisitChildren(Visitor* visitor); | 513 virtual void VisitChildren(Visitor* visitor); |
| 529 | 514 |
| 530 virtual TypeParameterList& type_parameters() { return type_parameters_; } | 515 virtual TypeParameterList& type_parameters() { return type_parameters_; } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 549 List<Procedure> procedures_; | 534 List<Procedure> procedures_; |
| 550 List<Field> fields_; | 535 List<Field> fields_; |
| 551 | 536 |
| 552 DISALLOW_COPY_AND_ASSIGN(NormalClass); | 537 DISALLOW_COPY_AND_ASSIGN(NormalClass); |
| 553 }; | 538 }; |
| 554 | 539 |
| 555 | 540 |
| 556 class MixinClass : public Class { | 541 class MixinClass : public Class { |
| 557 public: | 542 public: |
| 558 MixinClass* ReadFrom(Reader* reader); | 543 MixinClass* ReadFrom(Reader* reader); |
| 559 void WriteTo(Writer* writer); | |
| 560 | 544 |
| 561 virtual ~MixinClass(); | 545 virtual ~MixinClass(); |
| 562 | 546 |
| 563 DEFINE_CASTING_OPERATIONS(MixinClass); | 547 DEFINE_CASTING_OPERATIONS(MixinClass); |
| 564 | 548 |
| 565 virtual void AcceptClassVisitor(ClassVisitor* visitor); | 549 virtual void AcceptClassVisitor(ClassVisitor* visitor); |
| 566 virtual void AcceptReferenceVisitor(ClassReferenceVisitor* visitor); | 550 virtual void AcceptReferenceVisitor(ClassReferenceVisitor* visitor); |
| 567 virtual void VisitChildren(Visitor* visitor); | 551 virtual void VisitChildren(Visitor* visitor); |
| 568 | 552 |
| 569 virtual TypeParameterList& type_parameters() { return type_parameters_; } | 553 virtual TypeParameterList& type_parameters() { return type_parameters_; } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 617 |
| 634 class Field : public Member { | 618 class Field : public Member { |
| 635 public: | 619 public: |
| 636 enum Flags { | 620 enum Flags { |
| 637 kFlagFinal = 1 << 0, | 621 kFlagFinal = 1 << 0, |
| 638 kFlagConst = 1 << 1, | 622 kFlagConst = 1 << 1, |
| 639 kFlagStatic = 1 << 2, | 623 kFlagStatic = 1 << 2, |
| 640 }; | 624 }; |
| 641 | 625 |
| 642 Field* ReadFrom(Reader* reader); | 626 Field* ReadFrom(Reader* reader); |
| 643 void WriteTo(Writer* writer); | |
| 644 | 627 |
| 645 virtual ~Field(); | 628 virtual ~Field(); |
| 646 | 629 |
| 647 DEFINE_CASTING_OPERATIONS(Field); | 630 DEFINE_CASTING_OPERATIONS(Field); |
| 648 | 631 |
| 649 virtual void AcceptMemberVisitor(MemberVisitor* visitor); | 632 virtual void AcceptMemberVisitor(MemberVisitor* visitor); |
| 650 virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor); | 633 virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor); |
| 651 virtual void VisitChildren(Visitor* visitor); | 634 virtual void VisitChildren(Visitor* visitor); |
| 652 | 635 |
| 653 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } | 636 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 676 | 659 |
| 677 | 660 |
| 678 class Constructor : public Member { | 661 class Constructor : public Member { |
| 679 public: | 662 public: |
| 680 enum Flags { | 663 enum Flags { |
| 681 kFlagConst = 1 << 0, | 664 kFlagConst = 1 << 0, |
| 682 kFlagExternal = 1 << 1, | 665 kFlagExternal = 1 << 1, |
| 683 }; | 666 }; |
| 684 | 667 |
| 685 Constructor* ReadFrom(Reader* reader); | 668 Constructor* ReadFrom(Reader* reader); |
| 686 void WriteTo(Writer* writer); | |
| 687 | 669 |
| 688 virtual ~Constructor(); | 670 virtual ~Constructor(); |
| 689 | 671 |
| 690 DEFINE_CASTING_OPERATIONS(Constructor); | 672 DEFINE_CASTING_OPERATIONS(Constructor); |
| 691 | 673 |
| 692 virtual void AcceptMemberVisitor(MemberVisitor* visitor); | 674 virtual void AcceptMemberVisitor(MemberVisitor* visitor); |
| 693 virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor); | 675 virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor); |
| 694 virtual void VisitChildren(Visitor* visitor); | 676 virtual void VisitChildren(Visitor* visitor); |
| 695 | 677 |
| 696 bool IsExternal() { return (flags_ & kFlagExternal) == kFlagExternal; } | 678 bool IsExternal() { return (flags_ & kFlagExternal) == kFlagExternal; } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 727 kMethod, | 709 kMethod, |
| 728 kGetter, | 710 kGetter, |
| 729 kSetter, | 711 kSetter, |
| 730 kOperator, | 712 kOperator, |
| 731 kFactory, | 713 kFactory, |
| 732 | 714 |
| 733 kIncompleteProcedure = 255 | 715 kIncompleteProcedure = 255 |
| 734 }; | 716 }; |
| 735 | 717 |
| 736 Procedure* ReadFrom(Reader* reader); | 718 Procedure* ReadFrom(Reader* reader); |
| 737 void WriteTo(Writer* writer); | |
| 738 | 719 |
| 739 virtual ~Procedure(); | 720 virtual ~Procedure(); |
| 740 | 721 |
| 741 DEFINE_CASTING_OPERATIONS(Procedure); | 722 DEFINE_CASTING_OPERATIONS(Procedure); |
| 742 | 723 |
| 743 virtual void AcceptMemberVisitor(MemberVisitor* visitor); | 724 virtual void AcceptMemberVisitor(MemberVisitor* visitor); |
| 744 virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor); | 725 virtual void AcceptReferenceVisitor(MemberReferenceVisitor* visitor); |
| 745 virtual void VisitChildren(Visitor* visitor); | 726 virtual void VisitChildren(Visitor* visitor); |
| 746 | 727 |
| 747 ProcedureKind kind() { return kind_; } | 728 ProcedureKind kind() { return kind_; } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 764 intptr_t source_uri_index_; | 745 intptr_t source_uri_index_; |
| 765 Child<FunctionNode> function_; | 746 Child<FunctionNode> function_; |
| 766 | 747 |
| 767 DISALLOW_COPY_AND_ASSIGN(Procedure); | 748 DISALLOW_COPY_AND_ASSIGN(Procedure); |
| 768 }; | 749 }; |
| 769 | 750 |
| 770 | 751 |
| 771 class Initializer : public TreeNode { | 752 class Initializer : public TreeNode { |
| 772 public: | 753 public: |
| 773 static Initializer* ReadFrom(Reader* reader); | 754 static Initializer* ReadFrom(Reader* reader); |
| 774 virtual void WriteTo(Writer* writer) = 0; | |
| 775 | 755 |
| 776 virtual ~Initializer(); | 756 virtual ~Initializer(); |
| 777 | 757 |
| 778 DEFINE_CASTING_OPERATIONS(Initializer); | 758 DEFINE_CASTING_OPERATIONS(Initializer); |
| 779 | 759 |
| 780 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 760 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 781 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor) = 0; | 761 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor) = 0; |
| 782 | 762 |
| 783 protected: | 763 protected: |
| 784 Initializer() {} | 764 Initializer() {} |
| 785 | 765 |
| 786 private: | 766 private: |
| 787 DISALLOW_COPY_AND_ASSIGN(Initializer); | 767 DISALLOW_COPY_AND_ASSIGN(Initializer); |
| 788 }; | 768 }; |
| 789 | 769 |
| 790 | 770 |
| 791 class InvalidInitializer : public Initializer { | 771 class InvalidInitializer : public Initializer { |
| 792 public: | 772 public: |
| 793 static InvalidInitializer* ReadFromImpl(Reader* reader); | 773 static InvalidInitializer* ReadFromImpl(Reader* reader); |
| 794 virtual void WriteTo(Writer* writer); | |
| 795 | 774 |
| 796 virtual ~InvalidInitializer(); | 775 virtual ~InvalidInitializer(); |
| 797 | 776 |
| 798 DEFINE_CASTING_OPERATIONS(InvalidInitializer); | 777 DEFINE_CASTING_OPERATIONS(InvalidInitializer); |
| 799 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); | 778 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); |
| 800 virtual void VisitChildren(Visitor* visitor); | 779 virtual void VisitChildren(Visitor* visitor); |
| 801 | 780 |
| 802 private: | 781 private: |
| 803 InvalidInitializer() {} | 782 InvalidInitializer() {} |
| 804 | 783 |
| 805 DISALLOW_COPY_AND_ASSIGN(InvalidInitializer); | 784 DISALLOW_COPY_AND_ASSIGN(InvalidInitializer); |
| 806 }; | 785 }; |
| 807 | 786 |
| 808 | 787 |
| 809 class FieldInitializer : public Initializer { | 788 class FieldInitializer : public Initializer { |
| 810 public: | 789 public: |
| 811 static FieldInitializer* ReadFromImpl(Reader* reader); | 790 static FieldInitializer* ReadFromImpl(Reader* reader); |
| 812 virtual void WriteTo(Writer* writer); | |
| 813 | 791 |
| 814 virtual ~FieldInitializer(); | 792 virtual ~FieldInitializer(); |
| 815 | 793 |
| 816 DEFINE_CASTING_OPERATIONS(FieldInitializer); | 794 DEFINE_CASTING_OPERATIONS(FieldInitializer); |
| 817 | 795 |
| 818 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); | 796 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); |
| 819 virtual void VisitChildren(Visitor* visitor); | 797 virtual void VisitChildren(Visitor* visitor); |
| 820 | 798 |
| 821 Field* field() { return field_; } | 799 Field* field() { return field_; } |
| 822 Expression* value() { return value_; } | 800 Expression* value() { return value_; } |
| 823 | 801 |
| 824 private: | 802 private: |
| 825 FieldInitializer() {} | 803 FieldInitializer() {} |
| 826 | 804 |
| 827 Ref<Field> field_; | 805 Ref<Field> field_; |
| 828 Child<Expression> value_; | 806 Child<Expression> value_; |
| 829 | 807 |
| 830 DISALLOW_COPY_AND_ASSIGN(FieldInitializer); | 808 DISALLOW_COPY_AND_ASSIGN(FieldInitializer); |
| 831 }; | 809 }; |
| 832 | 810 |
| 833 | 811 |
| 834 class SuperInitializer : public Initializer { | 812 class SuperInitializer : public Initializer { |
| 835 public: | 813 public: |
| 836 static SuperInitializer* ReadFromImpl(Reader* reader); | 814 static SuperInitializer* ReadFromImpl(Reader* reader); |
| 837 virtual void WriteTo(Writer* writer); | |
| 838 | 815 |
| 839 virtual ~SuperInitializer(); | 816 virtual ~SuperInitializer(); |
| 840 | 817 |
| 841 DEFINE_CASTING_OPERATIONS(SuperInitializer); | 818 DEFINE_CASTING_OPERATIONS(SuperInitializer); |
| 842 | 819 |
| 843 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); | 820 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); |
| 844 virtual void VisitChildren(Visitor* visitor); | 821 virtual void VisitChildren(Visitor* visitor); |
| 845 | 822 |
| 846 Constructor* target() { return target_; } | 823 Constructor* target() { return target_; } |
| 847 Arguments* arguments() { return arguments_; } | 824 Arguments* arguments() { return arguments_; } |
| 848 | 825 |
| 849 private: | 826 private: |
| 850 SuperInitializer() {} | 827 SuperInitializer() {} |
| 851 | 828 |
| 852 Ref<Constructor> target_; | 829 Ref<Constructor> target_; |
| 853 Child<Arguments> arguments_; | 830 Child<Arguments> arguments_; |
| 854 | 831 |
| 855 DISALLOW_COPY_AND_ASSIGN(SuperInitializer); | 832 DISALLOW_COPY_AND_ASSIGN(SuperInitializer); |
| 856 }; | 833 }; |
| 857 | 834 |
| 858 | 835 |
| 859 class RedirectingInitializer : public Initializer { | 836 class RedirectingInitializer : public Initializer { |
| 860 public: | 837 public: |
| 861 static RedirectingInitializer* ReadFromImpl(Reader* reader); | 838 static RedirectingInitializer* ReadFromImpl(Reader* reader); |
| 862 virtual void WriteTo(Writer* writer); | |
| 863 | 839 |
| 864 virtual ~RedirectingInitializer(); | 840 virtual ~RedirectingInitializer(); |
| 865 | 841 |
| 866 DEFINE_CASTING_OPERATIONS(RedirectingInitializer); | 842 DEFINE_CASTING_OPERATIONS(RedirectingInitializer); |
| 867 | 843 |
| 868 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); | 844 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); |
| 869 virtual void VisitChildren(Visitor* visitor); | 845 virtual void VisitChildren(Visitor* visitor); |
| 870 | 846 |
| 871 Constructor* target() { return target_; } | 847 Constructor* target() { return target_; } |
| 872 Arguments* arguments() { return arguments_; } | 848 Arguments* arguments() { return arguments_; } |
| 873 | 849 |
| 874 private: | 850 private: |
| 875 RedirectingInitializer() {} | 851 RedirectingInitializer() {} |
| 876 | 852 |
| 877 Ref<Constructor> target_; | 853 Ref<Constructor> target_; |
| 878 Child<Arguments> arguments_; | 854 Child<Arguments> arguments_; |
| 879 | 855 |
| 880 DISALLOW_COPY_AND_ASSIGN(RedirectingInitializer); | 856 DISALLOW_COPY_AND_ASSIGN(RedirectingInitializer); |
| 881 }; | 857 }; |
| 882 | 858 |
| 883 | 859 |
| 884 class LocalInitializer : public Initializer { | 860 class LocalInitializer : public Initializer { |
| 885 public: | 861 public: |
| 886 static LocalInitializer* ReadFromImpl(Reader* reader); | 862 static LocalInitializer* ReadFromImpl(Reader* reader); |
| 887 virtual void WriteTo(Writer* writer); | |
| 888 | 863 |
| 889 virtual ~LocalInitializer(); | 864 virtual ~LocalInitializer(); |
| 890 | 865 |
| 891 DEFINE_CASTING_OPERATIONS(LocalInitializer); | 866 DEFINE_CASTING_OPERATIONS(LocalInitializer); |
| 892 | 867 |
| 893 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); | 868 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); |
| 894 virtual void VisitChildren(Visitor* visitor); | 869 virtual void VisitChildren(Visitor* visitor); |
| 895 | 870 |
| 896 VariableDeclaration* variable() { return variable_; } | 871 VariableDeclaration* variable() { return variable_; } |
| 897 | 872 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 908 public: | 883 public: |
| 909 enum AsyncMarker { | 884 enum AsyncMarker { |
| 910 kSync = 0, | 885 kSync = 0, |
| 911 kSyncStar = 1, | 886 kSyncStar = 1, |
| 912 kAsync = 2, | 887 kAsync = 2, |
| 913 kAsyncStar = 3, | 888 kAsyncStar = 3, |
| 914 kSyncYielding = 4, | 889 kSyncYielding = 4, |
| 915 }; | 890 }; |
| 916 | 891 |
| 917 static FunctionNode* ReadFrom(Reader* reader); | 892 static FunctionNode* ReadFrom(Reader* reader); |
| 918 void WriteTo(Writer* writer); | |
| 919 | 893 |
| 920 virtual ~FunctionNode(); | 894 virtual ~FunctionNode(); |
| 921 | 895 |
| 922 DEFINE_CASTING_OPERATIONS(FunctionNode); | 896 DEFINE_CASTING_OPERATIONS(FunctionNode); |
| 923 | 897 |
| 924 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 898 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 925 virtual void VisitChildren(Visitor* visitor); | 899 virtual void VisitChildren(Visitor* visitor); |
| 926 | 900 |
| 927 AsyncMarker async_marker() { return async_marker_; } | 901 AsyncMarker async_marker() { return async_marker_; } |
| 928 bool debuggable() { return debuggable_; } | 902 bool debuggable() { return debuggable_; } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 955 TokenPosition position_; | 929 TokenPosition position_; |
| 956 TokenPosition end_position_; | 930 TokenPosition end_position_; |
| 957 | 931 |
| 958 DISALLOW_COPY_AND_ASSIGN(FunctionNode); | 932 DISALLOW_COPY_AND_ASSIGN(FunctionNode); |
| 959 }; | 933 }; |
| 960 | 934 |
| 961 | 935 |
| 962 class Expression : public TreeNode { | 936 class Expression : public TreeNode { |
| 963 public: | 937 public: |
| 964 static Expression* ReadFrom(Reader* reader); | 938 static Expression* ReadFrom(Reader* reader); |
| 965 virtual void WriteTo(Writer* writer) = 0; | |
| 966 | 939 |
| 967 virtual ~Expression(); | 940 virtual ~Expression(); |
| 968 | 941 |
| 969 DEFINE_CASTING_OPERATIONS(Expression); | 942 DEFINE_CASTING_OPERATIONS(Expression); |
| 970 | 943 |
| 971 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 944 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 972 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor) = 0; | 945 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor) = 0; |
| 973 TokenPosition position() { return position_; } | 946 TokenPosition position() { return position_; } |
| 974 | 947 |
| 975 protected: | 948 protected: |
| 976 Expression() : position_(TokenPosition::kNoSource) {} | 949 Expression() : position_(TokenPosition::kNoSource) {} |
| 977 TokenPosition position_; | 950 TokenPosition position_; |
| 978 | 951 |
| 979 private: | 952 private: |
| 980 DISALLOW_COPY_AND_ASSIGN(Expression); | 953 DISALLOW_COPY_AND_ASSIGN(Expression); |
| 981 }; | 954 }; |
| 982 | 955 |
| 983 | 956 |
| 984 class InvalidExpression : public Expression { | 957 class InvalidExpression : public Expression { |
| 985 public: | 958 public: |
| 986 static InvalidExpression* ReadFrom(Reader* reader); | 959 static InvalidExpression* ReadFrom(Reader* reader); |
| 987 virtual void WriteTo(Writer* writer); | |
| 988 | 960 |
| 989 virtual ~InvalidExpression(); | 961 virtual ~InvalidExpression(); |
| 990 virtual void VisitChildren(Visitor* visitor); | 962 virtual void VisitChildren(Visitor* visitor); |
| 991 | 963 |
| 992 DEFINE_CASTING_OPERATIONS(InvalidExpression); | 964 DEFINE_CASTING_OPERATIONS(InvalidExpression); |
| 993 | 965 |
| 994 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 966 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 995 | 967 |
| 996 private: | 968 private: |
| 997 InvalidExpression() {} | 969 InvalidExpression() {} |
| 998 | 970 |
| 999 DISALLOW_COPY_AND_ASSIGN(InvalidExpression); | 971 DISALLOW_COPY_AND_ASSIGN(InvalidExpression); |
| 1000 }; | 972 }; |
| 1001 | 973 |
| 1002 | 974 |
| 1003 class VariableGet : public Expression { | 975 class VariableGet : public Expression { |
| 1004 public: | 976 public: |
| 1005 static VariableGet* ReadFrom(Reader* reader); | 977 static VariableGet* ReadFrom(Reader* reader); |
| 1006 static VariableGet* ReadFrom(Reader* reader, uint8_t payload); | 978 static VariableGet* ReadFrom(Reader* reader, uint8_t payload); |
| 1007 virtual void WriteTo(Writer* writer); | |
| 1008 | 979 |
| 1009 virtual ~VariableGet(); | 980 virtual ~VariableGet(); |
| 1010 | 981 |
| 1011 DEFINE_CASTING_OPERATIONS(VariableGet); | 982 DEFINE_CASTING_OPERATIONS(VariableGet); |
| 1012 | 983 |
| 1013 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 984 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1014 virtual void VisitChildren(Visitor* visitor); | 985 virtual void VisitChildren(Visitor* visitor); |
| 1015 | 986 |
| 1016 VariableDeclaration* variable() { return variable_; } | 987 VariableDeclaration* variable() { return variable_; } |
| 1017 | 988 |
| 1018 private: | 989 private: |
| 1019 VariableGet() {} | 990 VariableGet() {} |
| 1020 | 991 |
| 1021 Ref<VariableDeclaration> variable_; | 992 Ref<VariableDeclaration> variable_; |
| 1022 | 993 |
| 1023 DISALLOW_COPY_AND_ASSIGN(VariableGet); | 994 DISALLOW_COPY_AND_ASSIGN(VariableGet); |
| 1024 }; | 995 }; |
| 1025 | 996 |
| 1026 | 997 |
| 1027 class VariableSet : public Expression { | 998 class VariableSet : public Expression { |
| 1028 public: | 999 public: |
| 1029 static VariableSet* ReadFrom(Reader* reader); | 1000 static VariableSet* ReadFrom(Reader* reader); |
| 1030 static VariableSet* ReadFrom(Reader* reader, uint8_t payload); | 1001 static VariableSet* ReadFrom(Reader* reader, uint8_t payload); |
| 1031 virtual void WriteTo(Writer* writer); | |
| 1032 | 1002 |
| 1033 virtual ~VariableSet(); | 1003 virtual ~VariableSet(); |
| 1034 | 1004 |
| 1035 DEFINE_CASTING_OPERATIONS(VariableSet); | 1005 DEFINE_CASTING_OPERATIONS(VariableSet); |
| 1036 | 1006 |
| 1037 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1007 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1038 virtual void VisitChildren(Visitor* visitor); | 1008 virtual void VisitChildren(Visitor* visitor); |
| 1039 | 1009 |
| 1040 VariableDeclaration* variable() { return variable_; } | 1010 VariableDeclaration* variable() { return variable_; } |
| 1041 Expression* expression() { return expression_; } | 1011 Expression* expression() { return expression_; } |
| 1042 | 1012 |
| 1043 private: | 1013 private: |
| 1044 VariableSet() {} | 1014 VariableSet() {} |
| 1045 | 1015 |
| 1046 Ref<VariableDeclaration> variable_; | 1016 Ref<VariableDeclaration> variable_; |
| 1047 Child<Expression> expression_; | 1017 Child<Expression> expression_; |
| 1048 | 1018 |
| 1049 DISALLOW_COPY_AND_ASSIGN(VariableSet); | 1019 DISALLOW_COPY_AND_ASSIGN(VariableSet); |
| 1050 }; | 1020 }; |
| 1051 | 1021 |
| 1052 | 1022 |
| 1053 class PropertyGet : public Expression { | 1023 class PropertyGet : public Expression { |
| 1054 public: | 1024 public: |
| 1055 static PropertyGet* ReadFrom(Reader* reader); | 1025 static PropertyGet* ReadFrom(Reader* reader); |
| 1056 virtual void WriteTo(Writer* writer); | |
| 1057 | 1026 |
| 1058 virtual ~PropertyGet(); | 1027 virtual ~PropertyGet(); |
| 1059 | 1028 |
| 1060 DEFINE_CASTING_OPERATIONS(PropertyGet); | 1029 DEFINE_CASTING_OPERATIONS(PropertyGet); |
| 1061 | 1030 |
| 1062 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1031 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1063 virtual void VisitChildren(Visitor* visitor); | 1032 virtual void VisitChildren(Visitor* visitor); |
| 1064 | 1033 |
| 1065 Expression* receiver() { return receiver_; } | 1034 Expression* receiver() { return receiver_; } |
| 1066 Name* name() { return name_; } | 1035 Name* name() { return name_; } |
| 1067 | 1036 |
| 1068 private: | 1037 private: |
| 1069 PropertyGet() {} | 1038 PropertyGet() {} |
| 1070 | 1039 |
| 1071 Child<Expression> receiver_; | 1040 Child<Expression> receiver_; |
| 1072 Child<Name> name_; | 1041 Child<Name> name_; |
| 1073 Ref<Member> interfaceTarget_; | 1042 Ref<Member> interfaceTarget_; |
| 1074 | 1043 |
| 1075 DISALLOW_COPY_AND_ASSIGN(PropertyGet); | 1044 DISALLOW_COPY_AND_ASSIGN(PropertyGet); |
| 1076 }; | 1045 }; |
| 1077 | 1046 |
| 1078 | 1047 |
| 1079 class PropertySet : public Expression { | 1048 class PropertySet : public Expression { |
| 1080 public: | 1049 public: |
| 1081 static PropertySet* ReadFrom(Reader* reader); | 1050 static PropertySet* ReadFrom(Reader* reader); |
| 1082 virtual void WriteTo(Writer* writer); | |
| 1083 | 1051 |
| 1084 virtual ~PropertySet(); | 1052 virtual ~PropertySet(); |
| 1085 | 1053 |
| 1086 DEFINE_CASTING_OPERATIONS(PropertySet); | 1054 DEFINE_CASTING_OPERATIONS(PropertySet); |
| 1087 | 1055 |
| 1088 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1056 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1089 virtual void VisitChildren(Visitor* visitor); | 1057 virtual void VisitChildren(Visitor* visitor); |
| 1090 | 1058 |
| 1091 Expression* receiver() { return receiver_; } | 1059 Expression* receiver() { return receiver_; } |
| 1092 Name* name() { return name_; } | 1060 Name* name() { return name_; } |
| 1093 Expression* value() { return value_; } | 1061 Expression* value() { return value_; } |
| 1094 | 1062 |
| 1095 private: | 1063 private: |
| 1096 PropertySet() {} | 1064 PropertySet() {} |
| 1097 | 1065 |
| 1098 Child<Expression> receiver_; | 1066 Child<Expression> receiver_; |
| 1099 Child<Name> name_; | 1067 Child<Name> name_; |
| 1100 Child<Expression> value_; | 1068 Child<Expression> value_; |
| 1101 Ref<Member> interfaceTarget_; | 1069 Ref<Member> interfaceTarget_; |
| 1102 | 1070 |
| 1103 DISALLOW_COPY_AND_ASSIGN(PropertySet); | 1071 DISALLOW_COPY_AND_ASSIGN(PropertySet); |
| 1104 }; | 1072 }; |
| 1105 | 1073 |
| 1106 | 1074 |
| 1107 class DirectPropertyGet : public Expression { | 1075 class DirectPropertyGet : public Expression { |
| 1108 public: | 1076 public: |
| 1109 static DirectPropertyGet* ReadFrom(Reader* reader); | 1077 static DirectPropertyGet* ReadFrom(Reader* reader); |
| 1110 virtual void WriteTo(Writer* writer); | |
| 1111 | 1078 |
| 1112 virtual ~DirectPropertyGet(); | 1079 virtual ~DirectPropertyGet(); |
| 1113 | 1080 |
| 1114 DEFINE_CASTING_OPERATIONS(DirectPropertyGet); | 1081 DEFINE_CASTING_OPERATIONS(DirectPropertyGet); |
| 1115 | 1082 |
| 1116 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1083 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1117 virtual void VisitChildren(Visitor* visitor); | 1084 virtual void VisitChildren(Visitor* visitor); |
| 1118 | 1085 |
| 1119 Expression* receiver() { return receiver_; } | 1086 Expression* receiver() { return receiver_; } |
| 1120 Member* target() { return target_; } | 1087 Member* target() { return target_; } |
| 1121 | 1088 |
| 1122 private: | 1089 private: |
| 1123 DirectPropertyGet() {} | 1090 DirectPropertyGet() {} |
| 1124 | 1091 |
| 1125 Child<Expression> receiver_; | 1092 Child<Expression> receiver_; |
| 1126 Ref<Member> target_; | 1093 Ref<Member> target_; |
| 1127 | 1094 |
| 1128 DISALLOW_COPY_AND_ASSIGN(DirectPropertyGet); | 1095 DISALLOW_COPY_AND_ASSIGN(DirectPropertyGet); |
| 1129 }; | 1096 }; |
| 1130 | 1097 |
| 1131 | 1098 |
| 1132 class DirectPropertySet : public Expression { | 1099 class DirectPropertySet : public Expression { |
| 1133 public: | 1100 public: |
| 1134 static DirectPropertySet* ReadFrom(Reader* reader); | 1101 static DirectPropertySet* ReadFrom(Reader* reader); |
| 1135 virtual void WriteTo(Writer* writer); | |
| 1136 | 1102 |
| 1137 virtual ~DirectPropertySet(); | 1103 virtual ~DirectPropertySet(); |
| 1138 | 1104 |
| 1139 DEFINE_CASTING_OPERATIONS(DirectPropertySet); | 1105 DEFINE_CASTING_OPERATIONS(DirectPropertySet); |
| 1140 | 1106 |
| 1141 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1107 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1142 virtual void VisitChildren(Visitor* visitor); | 1108 virtual void VisitChildren(Visitor* visitor); |
| 1143 | 1109 |
| 1144 Expression* receiver() { return receiver_; } | 1110 Expression* receiver() { return receiver_; } |
| 1145 Member* target() { return target_; } | 1111 Member* target() { return target_; } |
| 1146 Expression* value() { return value_; } | 1112 Expression* value() { return value_; } |
| 1147 | 1113 |
| 1148 private: | 1114 private: |
| 1149 DirectPropertySet() {} | 1115 DirectPropertySet() {} |
| 1150 | 1116 |
| 1151 Child<Expression> receiver_; | 1117 Child<Expression> receiver_; |
| 1152 Ref<Member> target_; | 1118 Ref<Member> target_; |
| 1153 Child<Expression> value_; | 1119 Child<Expression> value_; |
| 1154 | 1120 |
| 1155 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet); | 1121 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet); |
| 1156 }; | 1122 }; |
| 1157 | 1123 |
| 1158 | 1124 |
| 1159 class StaticGet : public Expression { | 1125 class StaticGet : public Expression { |
| 1160 public: | 1126 public: |
| 1161 static StaticGet* ReadFrom(Reader* reader); | 1127 static StaticGet* ReadFrom(Reader* reader); |
| 1162 virtual void WriteTo(Writer* writer); | |
| 1163 | 1128 |
| 1164 virtual ~StaticGet(); | 1129 virtual ~StaticGet(); |
| 1165 | 1130 |
| 1166 DEFINE_CASTING_OPERATIONS(StaticGet); | 1131 DEFINE_CASTING_OPERATIONS(StaticGet); |
| 1167 | 1132 |
| 1168 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1133 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1169 virtual void VisitChildren(Visitor* visitor); | 1134 virtual void VisitChildren(Visitor* visitor); |
| 1170 | 1135 |
| 1171 Member* target() { return target_; } | 1136 Member* target() { return target_; } |
| 1172 | 1137 |
| 1173 private: | 1138 private: |
| 1174 StaticGet() {} | 1139 StaticGet() {} |
| 1175 | 1140 |
| 1176 Ref<Member> target_; | 1141 Ref<Member> target_; |
| 1177 | 1142 |
| 1178 DISALLOW_COPY_AND_ASSIGN(StaticGet); | 1143 DISALLOW_COPY_AND_ASSIGN(StaticGet); |
| 1179 }; | 1144 }; |
| 1180 | 1145 |
| 1181 | 1146 |
| 1182 class StaticSet : public Expression { | 1147 class StaticSet : public Expression { |
| 1183 public: | 1148 public: |
| 1184 static StaticSet* ReadFrom(Reader* reader); | 1149 static StaticSet* ReadFrom(Reader* reader); |
| 1185 virtual void WriteTo(Writer* writer); | |
| 1186 | 1150 |
| 1187 virtual ~StaticSet(); | 1151 virtual ~StaticSet(); |
| 1188 | 1152 |
| 1189 DEFINE_CASTING_OPERATIONS(StaticSet); | 1153 DEFINE_CASTING_OPERATIONS(StaticSet); |
| 1190 | 1154 |
| 1191 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1155 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1192 virtual void VisitChildren(Visitor* visitor); | 1156 virtual void VisitChildren(Visitor* visitor); |
| 1193 | 1157 |
| 1194 Member* target() { return target_; } | 1158 Member* target() { return target_; } |
| 1195 Expression* expression() { return expression_; } | 1159 Expression* expression() { return expression_; } |
| 1196 | 1160 |
| 1197 private: | 1161 private: |
| 1198 StaticSet() {} | 1162 StaticSet() {} |
| 1199 | 1163 |
| 1200 Ref<Member> target_; | 1164 Ref<Member> target_; |
| 1201 Child<Expression> expression_; | 1165 Child<Expression> expression_; |
| 1202 | 1166 |
| 1203 DISALLOW_COPY_AND_ASSIGN(StaticSet); | 1167 DISALLOW_COPY_AND_ASSIGN(StaticSet); |
| 1204 }; | 1168 }; |
| 1205 | 1169 |
| 1206 | 1170 |
| 1207 class Arguments : public TreeNode { | 1171 class Arguments : public TreeNode { |
| 1208 public: | 1172 public: |
| 1209 static Arguments* ReadFrom(Reader* reader); | 1173 static Arguments* ReadFrom(Reader* reader); |
| 1210 virtual void WriteTo(Writer* writer); | |
| 1211 | 1174 |
| 1212 virtual ~Arguments(); | 1175 virtual ~Arguments(); |
| 1213 | 1176 |
| 1214 DEFINE_CASTING_OPERATIONS(Arguments); | 1177 DEFINE_CASTING_OPERATIONS(Arguments); |
| 1215 | 1178 |
| 1216 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 1179 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 1217 virtual void VisitChildren(Visitor* visitor); | 1180 virtual void VisitChildren(Visitor* visitor); |
| 1218 | 1181 |
| 1219 List<DartType>& types() { return types_; } | 1182 List<DartType>& types() { return types_; } |
| 1220 List<Expression>& positional() { return positional_; } | 1183 List<Expression>& positional() { return positional_; } |
| 1221 List<NamedExpression>& named() { return named_; } | 1184 List<NamedExpression>& named() { return named_; } |
| 1222 | 1185 |
| 1223 int count() { return positional_.length() + named_.length(); } | 1186 int count() { return positional_.length() + named_.length(); } |
| 1224 | 1187 |
| 1225 private: | 1188 private: |
| 1226 Arguments() {} | 1189 Arguments() {} |
| 1227 | 1190 |
| 1228 List<DartType> types_; | 1191 List<DartType> types_; |
| 1229 List<Expression> positional_; | 1192 List<Expression> positional_; |
| 1230 List<NamedExpression> named_; | 1193 List<NamedExpression> named_; |
| 1231 | 1194 |
| 1232 DISALLOW_COPY_AND_ASSIGN(Arguments); | 1195 DISALLOW_COPY_AND_ASSIGN(Arguments); |
| 1233 }; | 1196 }; |
| 1234 | 1197 |
| 1235 | 1198 |
| 1236 class NamedExpression : public TreeNode { | 1199 class NamedExpression : public TreeNode { |
| 1237 public: | 1200 public: |
| 1238 static NamedExpression* ReadFrom(Reader* reader); | 1201 static NamedExpression* ReadFrom(Reader* reader); |
| 1239 virtual void WriteTo(Writer* writer); | |
| 1240 | 1202 |
| 1241 NamedExpression(String* name, Expression* expr) | 1203 NamedExpression(String* name, Expression* expr) |
| 1242 : name_(name), expression_(expr) {} | 1204 : name_(name), expression_(expr) {} |
| 1243 virtual ~NamedExpression(); | 1205 virtual ~NamedExpression(); |
| 1244 | 1206 |
| 1245 DEFINE_CASTING_OPERATIONS(NamedExpression); | 1207 DEFINE_CASTING_OPERATIONS(NamedExpression); |
| 1246 | 1208 |
| 1247 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 1209 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 1248 virtual void VisitChildren(Visitor* visitor); | 1210 virtual void VisitChildren(Visitor* visitor); |
| 1249 | 1211 |
| 1250 String* name() { return name_; } | 1212 String* name() { return name_; } |
| 1251 Expression* expression() { return expression_; } | 1213 Expression* expression() { return expression_; } |
| 1252 | 1214 |
| 1253 private: | 1215 private: |
| 1254 NamedExpression() {} | 1216 NamedExpression() {} |
| 1255 | 1217 |
| 1256 Ref<String> name_; | 1218 Ref<String> name_; |
| 1257 Child<Expression> expression_; | 1219 Child<Expression> expression_; |
| 1258 | 1220 |
| 1259 DISALLOW_COPY_AND_ASSIGN(NamedExpression); | 1221 DISALLOW_COPY_AND_ASSIGN(NamedExpression); |
| 1260 }; | 1222 }; |
| 1261 | 1223 |
| 1262 | 1224 |
| 1263 class MethodInvocation : public Expression { | 1225 class MethodInvocation : public Expression { |
| 1264 public: | 1226 public: |
| 1265 static MethodInvocation* ReadFrom(Reader* reader); | 1227 static MethodInvocation* ReadFrom(Reader* reader); |
| 1266 virtual void WriteTo(Writer* writer); | |
| 1267 | 1228 |
| 1268 virtual ~MethodInvocation(); | 1229 virtual ~MethodInvocation(); |
| 1269 | 1230 |
| 1270 DEFINE_CASTING_OPERATIONS(MethodInvocation); | 1231 DEFINE_CASTING_OPERATIONS(MethodInvocation); |
| 1271 | 1232 |
| 1272 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1233 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1273 virtual void VisitChildren(Visitor* visitor); | 1234 virtual void VisitChildren(Visitor* visitor); |
| 1274 | 1235 |
| 1275 Expression* receiver() { return receiver_; } | 1236 Expression* receiver() { return receiver_; } |
| 1276 Name* name() { return name_; } | 1237 Name* name() { return name_; } |
| 1277 Arguments* arguments() { return arguments_; } | 1238 Arguments* arguments() { return arguments_; } |
| 1278 | 1239 |
| 1279 private: | 1240 private: |
| 1280 MethodInvocation() {} | 1241 MethodInvocation() {} |
| 1281 | 1242 |
| 1282 Child<Expression> receiver_; | 1243 Child<Expression> receiver_; |
| 1283 Child<Name> name_; | 1244 Child<Name> name_; |
| 1284 Child<Arguments> arguments_; | 1245 Child<Arguments> arguments_; |
| 1285 Ref<Member> interfaceTarget_; | 1246 Ref<Member> interfaceTarget_; |
| 1286 | 1247 |
| 1287 DISALLOW_COPY_AND_ASSIGN(MethodInvocation); | 1248 DISALLOW_COPY_AND_ASSIGN(MethodInvocation); |
| 1288 }; | 1249 }; |
| 1289 | 1250 |
| 1290 | 1251 |
| 1291 class DirectMethodInvocation : public Expression { | 1252 class DirectMethodInvocation : public Expression { |
| 1292 public: | 1253 public: |
| 1293 static DirectMethodInvocation* ReadFrom(Reader* reader); | 1254 static DirectMethodInvocation* ReadFrom(Reader* reader); |
| 1294 virtual void WriteTo(Writer* writer); | |
| 1295 | 1255 |
| 1296 virtual ~DirectMethodInvocation(); | 1256 virtual ~DirectMethodInvocation(); |
| 1297 | 1257 |
| 1298 DEFINE_CASTING_OPERATIONS(DirectMethodInvocation); | 1258 DEFINE_CASTING_OPERATIONS(DirectMethodInvocation); |
| 1299 | 1259 |
| 1300 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1260 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1301 virtual void VisitChildren(Visitor* visitor); | 1261 virtual void VisitChildren(Visitor* visitor); |
| 1302 | 1262 |
| 1303 Expression* receiver() { return receiver_; } | 1263 Expression* receiver() { return receiver_; } |
| 1304 Procedure* target() { return target_; } | 1264 Procedure* target() { return target_; } |
| 1305 Arguments* arguments() { return arguments_; } | 1265 Arguments* arguments() { return arguments_; } |
| 1306 | 1266 |
| 1307 private: | 1267 private: |
| 1308 DirectMethodInvocation() {} | 1268 DirectMethodInvocation() {} |
| 1309 | 1269 |
| 1310 Child<Expression> receiver_; | 1270 Child<Expression> receiver_; |
| 1311 Ref<Procedure> target_; | 1271 Ref<Procedure> target_; |
| 1312 Child<Arguments> arguments_; | 1272 Child<Arguments> arguments_; |
| 1313 | 1273 |
| 1314 DISALLOW_COPY_AND_ASSIGN(DirectMethodInvocation); | 1274 DISALLOW_COPY_AND_ASSIGN(DirectMethodInvocation); |
| 1315 }; | 1275 }; |
| 1316 | 1276 |
| 1317 | 1277 |
| 1318 class StaticInvocation : public Expression { | 1278 class StaticInvocation : public Expression { |
| 1319 public: | 1279 public: |
| 1320 static StaticInvocation* ReadFrom(Reader* reader, bool is_const); | 1280 static StaticInvocation* ReadFrom(Reader* reader, bool is_const); |
| 1321 virtual void WriteTo(Writer* writer); | |
| 1322 ~StaticInvocation(); | 1281 ~StaticInvocation(); |
| 1323 | 1282 |
| 1324 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1283 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1325 virtual void VisitChildren(Visitor* visitor); | 1284 virtual void VisitChildren(Visitor* visitor); |
| 1326 | 1285 |
| 1327 Procedure* procedure() { return procedure_; } | 1286 Procedure* procedure() { return procedure_; } |
| 1328 Arguments* arguments() { return arguments_; } | 1287 Arguments* arguments() { return arguments_; } |
| 1329 bool is_const() { return is_const_; } | 1288 bool is_const() { return is_const_; } |
| 1330 | 1289 |
| 1331 private: | 1290 private: |
| 1332 StaticInvocation() {} | 1291 StaticInvocation() {} |
| 1333 | 1292 |
| 1334 Ref<Procedure> procedure_; | 1293 Ref<Procedure> procedure_; |
| 1335 Child<Arguments> arguments_; | 1294 Child<Arguments> arguments_; |
| 1336 bool is_const_; | 1295 bool is_const_; |
| 1337 | 1296 |
| 1338 DISALLOW_COPY_AND_ASSIGN(StaticInvocation); | 1297 DISALLOW_COPY_AND_ASSIGN(StaticInvocation); |
| 1339 }; | 1298 }; |
| 1340 | 1299 |
| 1341 | 1300 |
| 1342 class ConstructorInvocation : public Expression { | 1301 class ConstructorInvocation : public Expression { |
| 1343 public: | 1302 public: |
| 1344 static ConstructorInvocation* ReadFrom(Reader* reader, bool is_const); | 1303 static ConstructorInvocation* ReadFrom(Reader* reader, bool is_const); |
| 1345 virtual void WriteTo(Writer* writer); | |
| 1346 | 1304 |
| 1347 virtual ~ConstructorInvocation(); | 1305 virtual ~ConstructorInvocation(); |
| 1348 | 1306 |
| 1349 DEFINE_CASTING_OPERATIONS(ConstructorInvocation); | 1307 DEFINE_CASTING_OPERATIONS(ConstructorInvocation); |
| 1350 | 1308 |
| 1351 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1309 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1352 virtual void VisitChildren(Visitor* visitor); | 1310 virtual void VisitChildren(Visitor* visitor); |
| 1353 | 1311 |
| 1354 bool is_const() { return is_const_; } | 1312 bool is_const() { return is_const_; } |
| 1355 Constructor* target() { return target_; } | 1313 Constructor* target() { return target_; } |
| 1356 Arguments* arguments() { return arguments_; } | 1314 Arguments* arguments() { return arguments_; } |
| 1357 | 1315 |
| 1358 private: | 1316 private: |
| 1359 ConstructorInvocation() {} | 1317 ConstructorInvocation() {} |
| 1360 | 1318 |
| 1361 bool is_const_; | 1319 bool is_const_; |
| 1362 Ref<Constructor> target_; | 1320 Ref<Constructor> target_; |
| 1363 Child<Arguments> arguments_; | 1321 Child<Arguments> arguments_; |
| 1364 | 1322 |
| 1365 DISALLOW_COPY_AND_ASSIGN(ConstructorInvocation); | 1323 DISALLOW_COPY_AND_ASSIGN(ConstructorInvocation); |
| 1366 }; | 1324 }; |
| 1367 | 1325 |
| 1368 | 1326 |
| 1369 class Not : public Expression { | 1327 class Not : public Expression { |
| 1370 public: | 1328 public: |
| 1371 static Not* ReadFrom(Reader* reader); | 1329 static Not* ReadFrom(Reader* reader); |
| 1372 virtual void WriteTo(Writer* writer); | |
| 1373 | 1330 |
| 1374 virtual ~Not(); | 1331 virtual ~Not(); |
| 1375 | 1332 |
| 1376 DEFINE_CASTING_OPERATIONS(Not); | 1333 DEFINE_CASTING_OPERATIONS(Not); |
| 1377 | 1334 |
| 1378 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1335 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1379 virtual void VisitChildren(Visitor* visitor); | 1336 virtual void VisitChildren(Visitor* visitor); |
| 1380 | 1337 |
| 1381 Expression* expression() { return expression_; } | 1338 Expression* expression() { return expression_; } |
| 1382 | 1339 |
| 1383 private: | 1340 private: |
| 1384 Not() {} | 1341 Not() {} |
| 1385 | 1342 |
| 1386 Child<Expression> expression_; | 1343 Child<Expression> expression_; |
| 1387 | 1344 |
| 1388 DISALLOW_COPY_AND_ASSIGN(Not); | 1345 DISALLOW_COPY_AND_ASSIGN(Not); |
| 1389 }; | 1346 }; |
| 1390 | 1347 |
| 1391 | 1348 |
| 1392 class LogicalExpression : public Expression { | 1349 class LogicalExpression : public Expression { |
| 1393 public: | 1350 public: |
| 1394 enum Operator { kAnd, kOr }; | 1351 enum Operator { kAnd, kOr }; |
| 1395 | 1352 |
| 1396 static LogicalExpression* ReadFrom(Reader* reader); | 1353 static LogicalExpression* ReadFrom(Reader* reader); |
| 1397 virtual void WriteTo(Writer* writer); | |
| 1398 | 1354 |
| 1399 virtual ~LogicalExpression(); | 1355 virtual ~LogicalExpression(); |
| 1400 | 1356 |
| 1401 DEFINE_CASTING_OPERATIONS(LogicalExpression); | 1357 DEFINE_CASTING_OPERATIONS(LogicalExpression); |
| 1402 | 1358 |
| 1403 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1359 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1404 virtual void VisitChildren(Visitor* visitor); | 1360 virtual void VisitChildren(Visitor* visitor); |
| 1405 | 1361 |
| 1406 Expression* left() { return left_; } | 1362 Expression* left() { return left_; } |
| 1407 Operator op() { return operator_; } | 1363 Operator op() { return operator_; } |
| 1408 Expression* right() { return right_; } | 1364 Expression* right() { return right_; } |
| 1409 | 1365 |
| 1410 private: | 1366 private: |
| 1411 LogicalExpression() {} | 1367 LogicalExpression() {} |
| 1412 | 1368 |
| 1413 Child<Expression> left_; | 1369 Child<Expression> left_; |
| 1414 Operator operator_; | 1370 Operator operator_; |
| 1415 Child<Expression> right_; | 1371 Child<Expression> right_; |
| 1416 | 1372 |
| 1417 DISALLOW_COPY_AND_ASSIGN(LogicalExpression); | 1373 DISALLOW_COPY_AND_ASSIGN(LogicalExpression); |
| 1418 }; | 1374 }; |
| 1419 | 1375 |
| 1420 | 1376 |
| 1421 class ConditionalExpression : public Expression { | 1377 class ConditionalExpression : public Expression { |
| 1422 public: | 1378 public: |
| 1423 static ConditionalExpression* ReadFrom(Reader* reader); | 1379 static ConditionalExpression* ReadFrom(Reader* reader); |
| 1424 virtual void WriteTo(Writer* writer); | |
| 1425 | 1380 |
| 1426 virtual ~ConditionalExpression(); | 1381 virtual ~ConditionalExpression(); |
| 1427 | 1382 |
| 1428 DEFINE_CASTING_OPERATIONS(ConditionalExpression); | 1383 DEFINE_CASTING_OPERATIONS(ConditionalExpression); |
| 1429 | 1384 |
| 1430 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1385 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1431 virtual void VisitChildren(Visitor* visitor); | 1386 virtual void VisitChildren(Visitor* visitor); |
| 1432 | 1387 |
| 1433 Expression* condition() { return condition_; } | 1388 Expression* condition() { return condition_; } |
| 1434 Expression* then() { return then_; } | 1389 Expression* then() { return then_; } |
| 1435 Expression* otherwise() { return otherwise_; } | 1390 Expression* otherwise() { return otherwise_; } |
| 1436 | 1391 |
| 1437 private: | 1392 private: |
| 1438 ConditionalExpression() {} | 1393 ConditionalExpression() {} |
| 1439 | 1394 |
| 1440 Child<Expression> condition_; | 1395 Child<Expression> condition_; |
| 1441 Child<Expression> then_; | 1396 Child<Expression> then_; |
| 1442 Child<Expression> otherwise_; | 1397 Child<Expression> otherwise_; |
| 1443 | 1398 |
| 1444 DISALLOW_COPY_AND_ASSIGN(ConditionalExpression); | 1399 DISALLOW_COPY_AND_ASSIGN(ConditionalExpression); |
| 1445 }; | 1400 }; |
| 1446 | 1401 |
| 1447 | 1402 |
| 1448 class StringConcatenation : public Expression { | 1403 class StringConcatenation : public Expression { |
| 1449 public: | 1404 public: |
| 1450 static StringConcatenation* ReadFrom(Reader* reader); | 1405 static StringConcatenation* ReadFrom(Reader* reader); |
| 1451 virtual void WriteTo(Writer* writer); | |
| 1452 | 1406 |
| 1453 virtual ~StringConcatenation(); | 1407 virtual ~StringConcatenation(); |
| 1454 | 1408 |
| 1455 DEFINE_CASTING_OPERATIONS(StringConcatenation); | 1409 DEFINE_CASTING_OPERATIONS(StringConcatenation); |
| 1456 | 1410 |
| 1457 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1411 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1458 virtual void VisitChildren(Visitor* visitor); | 1412 virtual void VisitChildren(Visitor* visitor); |
| 1459 | 1413 |
| 1460 List<Expression>& expressions() { return expressions_; } | 1414 List<Expression>& expressions() { return expressions_; } |
| 1461 | 1415 |
| 1462 private: | 1416 private: |
| 1463 StringConcatenation() {} | 1417 StringConcatenation() {} |
| 1464 | 1418 |
| 1465 List<Expression> expressions_; | 1419 List<Expression> expressions_; |
| 1466 | 1420 |
| 1467 DISALLOW_COPY_AND_ASSIGN(StringConcatenation); | 1421 DISALLOW_COPY_AND_ASSIGN(StringConcatenation); |
| 1468 }; | 1422 }; |
| 1469 | 1423 |
| 1470 | 1424 |
| 1471 class IsExpression : public Expression { | 1425 class IsExpression : public Expression { |
| 1472 public: | 1426 public: |
| 1473 static IsExpression* ReadFrom(Reader* reader); | 1427 static IsExpression* ReadFrom(Reader* reader); |
| 1474 virtual void WriteTo(Writer* writer); | |
| 1475 | 1428 |
| 1476 virtual ~IsExpression(); | 1429 virtual ~IsExpression(); |
| 1477 | 1430 |
| 1478 DEFINE_CASTING_OPERATIONS(IsExpression); | 1431 DEFINE_CASTING_OPERATIONS(IsExpression); |
| 1479 | 1432 |
| 1480 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1433 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1481 virtual void VisitChildren(Visitor* visitor); | 1434 virtual void VisitChildren(Visitor* visitor); |
| 1482 | 1435 |
| 1483 Expression* operand() { return operand_; } | 1436 Expression* operand() { return operand_; } |
| 1484 DartType* type() { return type_; } | 1437 DartType* type() { return type_; } |
| 1485 | 1438 |
| 1486 private: | 1439 private: |
| 1487 IsExpression() {} | 1440 IsExpression() {} |
| 1488 | 1441 |
| 1489 Child<Expression> operand_; | 1442 Child<Expression> operand_; |
| 1490 Child<DartType> type_; | 1443 Child<DartType> type_; |
| 1491 | 1444 |
| 1492 DISALLOW_COPY_AND_ASSIGN(IsExpression); | 1445 DISALLOW_COPY_AND_ASSIGN(IsExpression); |
| 1493 }; | 1446 }; |
| 1494 | 1447 |
| 1495 | 1448 |
| 1496 class AsExpression : public Expression { | 1449 class AsExpression : public Expression { |
| 1497 public: | 1450 public: |
| 1498 static AsExpression* ReadFrom(Reader* reader); | 1451 static AsExpression* ReadFrom(Reader* reader); |
| 1499 virtual void WriteTo(Writer* writer); | |
| 1500 | 1452 |
| 1501 virtual ~AsExpression(); | 1453 virtual ~AsExpression(); |
| 1502 | 1454 |
| 1503 DEFINE_CASTING_OPERATIONS(AsExpression); | 1455 DEFINE_CASTING_OPERATIONS(AsExpression); |
| 1504 | 1456 |
| 1505 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1457 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1506 virtual void VisitChildren(Visitor* visitor); | 1458 virtual void VisitChildren(Visitor* visitor); |
| 1507 | 1459 |
| 1508 Expression* operand() { return operand_; } | 1460 Expression* operand() { return operand_; } |
| 1509 DartType* type() { return type_; } | 1461 DartType* type() { return type_; } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1524 | 1476 |
| 1525 DEFINE_CASTING_OPERATIONS(BasicLiteral); | 1477 DEFINE_CASTING_OPERATIONS(BasicLiteral); |
| 1526 | 1478 |
| 1527 virtual void VisitChildren(Visitor* visitor); | 1479 virtual void VisitChildren(Visitor* visitor); |
| 1528 }; | 1480 }; |
| 1529 | 1481 |
| 1530 | 1482 |
| 1531 class StringLiteral : public BasicLiteral { | 1483 class StringLiteral : public BasicLiteral { |
| 1532 public: | 1484 public: |
| 1533 static StringLiteral* ReadFrom(Reader* reader); | 1485 static StringLiteral* ReadFrom(Reader* reader); |
| 1534 virtual void WriteTo(Writer* writer); | |
| 1535 | 1486 |
| 1536 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1487 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1537 | 1488 |
| 1538 explicit StringLiteral(String* string) : value_(string) {} | 1489 explicit StringLiteral(String* string) : value_(string) {} |
| 1539 virtual ~StringLiteral(); | 1490 virtual ~StringLiteral(); |
| 1540 | 1491 |
| 1541 DEFINE_CASTING_OPERATIONS(StringLiteral); | 1492 DEFINE_CASTING_OPERATIONS(StringLiteral); |
| 1542 | 1493 |
| 1543 String* value() { return value_; } | 1494 String* value() { return value_; } |
| 1544 | 1495 |
| 1545 protected: | 1496 protected: |
| 1546 StringLiteral() {} | 1497 StringLiteral() {} |
| 1547 | 1498 |
| 1548 Ref<String> value_; | 1499 Ref<String> value_; |
| 1549 | 1500 |
| 1550 private: | 1501 private: |
| 1551 DISALLOW_COPY_AND_ASSIGN(StringLiteral); | 1502 DISALLOW_COPY_AND_ASSIGN(StringLiteral); |
| 1552 }; | 1503 }; |
| 1553 | 1504 |
| 1554 | 1505 |
| 1555 class BigintLiteral : public StringLiteral { | 1506 class BigintLiteral : public StringLiteral { |
| 1556 public: | 1507 public: |
| 1557 static BigintLiteral* ReadFrom(Reader* reader); | 1508 static BigintLiteral* ReadFrom(Reader* reader); |
| 1558 virtual void WriteTo(Writer* writer); | |
| 1559 | 1509 |
| 1560 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1510 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1561 | 1511 |
| 1562 explicit BigintLiteral(String* string) : StringLiteral(string) {} | 1512 explicit BigintLiteral(String* string) : StringLiteral(string) {} |
| 1563 virtual ~BigintLiteral(); | 1513 virtual ~BigintLiteral(); |
| 1564 | 1514 |
| 1565 DEFINE_CASTING_OPERATIONS(BigintLiteral); | 1515 DEFINE_CASTING_OPERATIONS(BigintLiteral); |
| 1566 | 1516 |
| 1567 private: | 1517 private: |
| 1568 BigintLiteral() {} | 1518 BigintLiteral() {} |
| 1569 | 1519 |
| 1570 DISALLOW_COPY_AND_ASSIGN(BigintLiteral); | 1520 DISALLOW_COPY_AND_ASSIGN(BigintLiteral); |
| 1571 }; | 1521 }; |
| 1572 | 1522 |
| 1573 | 1523 |
| 1574 class IntLiteral : public BasicLiteral { | 1524 class IntLiteral : public BasicLiteral { |
| 1575 public: | 1525 public: |
| 1576 static IntLiteral* ReadFrom(Reader* reader, bool is_negative); | 1526 static IntLiteral* ReadFrom(Reader* reader, bool is_negative); |
| 1577 static IntLiteral* ReadFrom(Reader* reader, uint8_t payload); | 1527 static IntLiteral* ReadFrom(Reader* reader, uint8_t payload); |
| 1578 virtual void WriteTo(Writer* writer); | |
| 1579 | 1528 |
| 1580 virtual ~IntLiteral(); | 1529 virtual ~IntLiteral(); |
| 1581 | 1530 |
| 1582 DEFINE_CASTING_OPERATIONS(IntLiteral); | 1531 DEFINE_CASTING_OPERATIONS(IntLiteral); |
| 1583 | 1532 |
| 1584 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1533 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1585 | 1534 |
| 1586 int64_t value() { return value_; } | 1535 int64_t value() { return value_; } |
| 1587 | 1536 |
| 1588 private: | 1537 private: |
| 1589 IntLiteral() {} | 1538 IntLiteral() {} |
| 1590 | 1539 |
| 1591 int64_t value_; | 1540 int64_t value_; |
| 1592 | 1541 |
| 1593 DISALLOW_COPY_AND_ASSIGN(IntLiteral); | 1542 DISALLOW_COPY_AND_ASSIGN(IntLiteral); |
| 1594 }; | 1543 }; |
| 1595 | 1544 |
| 1596 | 1545 |
| 1597 class DoubleLiteral : public BasicLiteral { | 1546 class DoubleLiteral : public BasicLiteral { |
| 1598 public: | 1547 public: |
| 1599 static DoubleLiteral* ReadFrom(Reader* reader); | 1548 static DoubleLiteral* ReadFrom(Reader* reader); |
| 1600 virtual void WriteTo(Writer* writer); | |
| 1601 | 1549 |
| 1602 virtual ~DoubleLiteral(); | 1550 virtual ~DoubleLiteral(); |
| 1603 | 1551 |
| 1604 DEFINE_CASTING_OPERATIONS(DoubleLiteral); | 1552 DEFINE_CASTING_OPERATIONS(DoubleLiteral); |
| 1605 | 1553 |
| 1606 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1554 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1607 | 1555 |
| 1608 String* value() { return value_; } | 1556 String* value() { return value_; } |
| 1609 | 1557 |
| 1610 private: | 1558 private: |
| 1611 DoubleLiteral() {} | 1559 DoubleLiteral() {} |
| 1612 | 1560 |
| 1613 Ref<String> value_; | 1561 Ref<String> value_; |
| 1614 | 1562 |
| 1615 DISALLOW_COPY_AND_ASSIGN(DoubleLiteral); | 1563 DISALLOW_COPY_AND_ASSIGN(DoubleLiteral); |
| 1616 }; | 1564 }; |
| 1617 | 1565 |
| 1618 | 1566 |
| 1619 class BoolLiteral : public BasicLiteral { | 1567 class BoolLiteral : public BasicLiteral { |
| 1620 public: | 1568 public: |
| 1621 static BoolLiteral* ReadFrom(Reader* reader, bool value); | 1569 static BoolLiteral* ReadFrom(Reader* reader, bool value); |
| 1622 virtual void WriteTo(Writer* writer); | |
| 1623 | 1570 |
| 1624 virtual ~BoolLiteral(); | 1571 virtual ~BoolLiteral(); |
| 1625 | 1572 |
| 1626 DEFINE_CASTING_OPERATIONS(BoolLiteral); | 1573 DEFINE_CASTING_OPERATIONS(BoolLiteral); |
| 1627 | 1574 |
| 1628 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1575 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1629 | 1576 |
| 1630 bool value() { return value_; } | 1577 bool value() { return value_; } |
| 1631 | 1578 |
| 1632 private: | 1579 private: |
| 1633 BoolLiteral() {} | 1580 BoolLiteral() {} |
| 1634 | 1581 |
| 1635 bool value_; | 1582 bool value_; |
| 1636 | 1583 |
| 1637 DISALLOW_COPY_AND_ASSIGN(BoolLiteral); | 1584 DISALLOW_COPY_AND_ASSIGN(BoolLiteral); |
| 1638 }; | 1585 }; |
| 1639 | 1586 |
| 1640 | 1587 |
| 1641 class NullLiteral : public BasicLiteral { | 1588 class NullLiteral : public BasicLiteral { |
| 1642 public: | 1589 public: |
| 1643 static NullLiteral* ReadFrom(Reader* reader); | 1590 static NullLiteral* ReadFrom(Reader* reader); |
| 1644 virtual void WriteTo(Writer* writer); | |
| 1645 | 1591 |
| 1646 virtual ~NullLiteral(); | 1592 virtual ~NullLiteral(); |
| 1647 | 1593 |
| 1648 DEFINE_CASTING_OPERATIONS(NullLiteral); | 1594 DEFINE_CASTING_OPERATIONS(NullLiteral); |
| 1649 | 1595 |
| 1650 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1596 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1651 | 1597 |
| 1652 private: | 1598 private: |
| 1653 NullLiteral() {} | 1599 NullLiteral() {} |
| 1654 | 1600 |
| 1655 DISALLOW_COPY_AND_ASSIGN(NullLiteral); | 1601 DISALLOW_COPY_AND_ASSIGN(NullLiteral); |
| 1656 }; | 1602 }; |
| 1657 | 1603 |
| 1658 | 1604 |
| 1659 class SymbolLiteral : public Expression { | 1605 class SymbolLiteral : public Expression { |
| 1660 public: | 1606 public: |
| 1661 static SymbolLiteral* ReadFrom(Reader* reader); | 1607 static SymbolLiteral* ReadFrom(Reader* reader); |
| 1662 virtual void WriteTo(Writer* writer); | |
| 1663 | 1608 |
| 1664 virtual ~SymbolLiteral(); | 1609 virtual ~SymbolLiteral(); |
| 1665 | 1610 |
| 1666 DEFINE_CASTING_OPERATIONS(SymbolLiteral); | 1611 DEFINE_CASTING_OPERATIONS(SymbolLiteral); |
| 1667 | 1612 |
| 1668 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1613 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1669 virtual void VisitChildren(Visitor* visitor); | 1614 virtual void VisitChildren(Visitor* visitor); |
| 1670 | 1615 |
| 1671 String* value() { return value_; } | 1616 String* value() { return value_; } |
| 1672 | 1617 |
| 1673 private: | 1618 private: |
| 1674 SymbolLiteral() {} | 1619 SymbolLiteral() {} |
| 1675 | 1620 |
| 1676 Ref<String> value_; | 1621 Ref<String> value_; |
| 1677 | 1622 |
| 1678 DISALLOW_COPY_AND_ASSIGN(SymbolLiteral); | 1623 DISALLOW_COPY_AND_ASSIGN(SymbolLiteral); |
| 1679 }; | 1624 }; |
| 1680 | 1625 |
| 1681 | 1626 |
| 1682 class TypeLiteral : public Expression { | 1627 class TypeLiteral : public Expression { |
| 1683 public: | 1628 public: |
| 1684 static TypeLiteral* ReadFrom(Reader* reader); | 1629 static TypeLiteral* ReadFrom(Reader* reader); |
| 1685 virtual void WriteTo(Writer* writer); | |
| 1686 | 1630 |
| 1687 virtual ~TypeLiteral(); | 1631 virtual ~TypeLiteral(); |
| 1688 | 1632 |
| 1689 DEFINE_CASTING_OPERATIONS(TypeLiteral); | 1633 DEFINE_CASTING_OPERATIONS(TypeLiteral); |
| 1690 | 1634 |
| 1691 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1635 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1692 virtual void VisitChildren(Visitor* visitor); | 1636 virtual void VisitChildren(Visitor* visitor); |
| 1693 | 1637 |
| 1694 DartType* type() { return type_; } | 1638 DartType* type() { return type_; } |
| 1695 | 1639 |
| 1696 private: | 1640 private: |
| 1697 TypeLiteral() {} | 1641 TypeLiteral() {} |
| 1698 | 1642 |
| 1699 Child<DartType> type_; | 1643 Child<DartType> type_; |
| 1700 | 1644 |
| 1701 DISALLOW_COPY_AND_ASSIGN(TypeLiteral); | 1645 DISALLOW_COPY_AND_ASSIGN(TypeLiteral); |
| 1702 }; | 1646 }; |
| 1703 | 1647 |
| 1704 | 1648 |
| 1705 class ThisExpression : public Expression { | 1649 class ThisExpression : public Expression { |
| 1706 public: | 1650 public: |
| 1707 static ThisExpression* ReadFrom(Reader* reader); | 1651 static ThisExpression* ReadFrom(Reader* reader); |
| 1708 virtual void WriteTo(Writer* writer); | |
| 1709 | 1652 |
| 1710 virtual ~ThisExpression(); | 1653 virtual ~ThisExpression(); |
| 1711 | 1654 |
| 1712 DEFINE_CASTING_OPERATIONS(ThisExpression); | 1655 DEFINE_CASTING_OPERATIONS(ThisExpression); |
| 1713 | 1656 |
| 1714 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1657 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1715 virtual void VisitChildren(Visitor* visitor); | 1658 virtual void VisitChildren(Visitor* visitor); |
| 1716 | 1659 |
| 1717 private: | 1660 private: |
| 1718 ThisExpression() {} | 1661 ThisExpression() {} |
| 1719 | 1662 |
| 1720 DISALLOW_COPY_AND_ASSIGN(ThisExpression); | 1663 DISALLOW_COPY_AND_ASSIGN(ThisExpression); |
| 1721 }; | 1664 }; |
| 1722 | 1665 |
| 1723 | 1666 |
| 1724 class Rethrow : public Expression { | 1667 class Rethrow : public Expression { |
| 1725 public: | 1668 public: |
| 1726 static Rethrow* ReadFrom(Reader* reader); | 1669 static Rethrow* ReadFrom(Reader* reader); |
| 1727 virtual void WriteTo(Writer* writer); | |
| 1728 | 1670 |
| 1729 virtual ~Rethrow(); | 1671 virtual ~Rethrow(); |
| 1730 | 1672 |
| 1731 DEFINE_CASTING_OPERATIONS(Rethrow); | 1673 DEFINE_CASTING_OPERATIONS(Rethrow); |
| 1732 | 1674 |
| 1733 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1675 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1734 virtual void VisitChildren(Visitor* visitor); | 1676 virtual void VisitChildren(Visitor* visitor); |
| 1735 | 1677 |
| 1736 private: | 1678 private: |
| 1737 Rethrow() {} | 1679 Rethrow() {} |
| 1738 | 1680 |
| 1739 DISALLOW_COPY_AND_ASSIGN(Rethrow); | 1681 DISALLOW_COPY_AND_ASSIGN(Rethrow); |
| 1740 }; | 1682 }; |
| 1741 | 1683 |
| 1742 | 1684 |
| 1743 class Throw : public Expression { | 1685 class Throw : public Expression { |
| 1744 public: | 1686 public: |
| 1745 static Throw* ReadFrom(Reader* reader); | 1687 static Throw* ReadFrom(Reader* reader); |
| 1746 virtual void WriteTo(Writer* writer); | |
| 1747 | 1688 |
| 1748 virtual ~Throw(); | 1689 virtual ~Throw(); |
| 1749 | 1690 |
| 1750 DEFINE_CASTING_OPERATIONS(Throw); | 1691 DEFINE_CASTING_OPERATIONS(Throw); |
| 1751 | 1692 |
| 1752 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1693 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1753 virtual void VisitChildren(Visitor* visitor); | 1694 virtual void VisitChildren(Visitor* visitor); |
| 1754 | 1695 |
| 1755 Expression* expression() { return expression_; } | 1696 Expression* expression() { return expression_; } |
| 1756 | 1697 |
| 1757 private: | 1698 private: |
| 1758 Throw() {} | 1699 Throw() {} |
| 1759 | 1700 |
| 1760 Child<Expression> expression_; | 1701 Child<Expression> expression_; |
| 1761 | 1702 |
| 1762 DISALLOW_COPY_AND_ASSIGN(Throw); | 1703 DISALLOW_COPY_AND_ASSIGN(Throw); |
| 1763 }; | 1704 }; |
| 1764 | 1705 |
| 1765 | 1706 |
| 1766 class ListLiteral : public Expression { | 1707 class ListLiteral : public Expression { |
| 1767 public: | 1708 public: |
| 1768 static ListLiteral* ReadFrom(Reader* reader, bool is_const); | 1709 static ListLiteral* ReadFrom(Reader* reader, bool is_const); |
| 1769 virtual void WriteTo(Writer* writer); | |
| 1770 | 1710 |
| 1771 virtual ~ListLiteral(); | 1711 virtual ~ListLiteral(); |
| 1772 | 1712 |
| 1773 DEFINE_CASTING_OPERATIONS(ListLiteral); | 1713 DEFINE_CASTING_OPERATIONS(ListLiteral); |
| 1774 | 1714 |
| 1775 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1715 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1776 virtual void VisitChildren(Visitor* visitor); | 1716 virtual void VisitChildren(Visitor* visitor); |
| 1777 | 1717 |
| 1778 bool is_const() { return is_const_; } | 1718 bool is_const() { return is_const_; } |
| 1779 DartType* type() { return type_; } | 1719 DartType* type() { return type_; } |
| 1780 List<Expression>& expressions() { return expressions_; } | 1720 List<Expression>& expressions() { return expressions_; } |
| 1781 | 1721 |
| 1782 private: | 1722 private: |
| 1783 ListLiteral() {} | 1723 ListLiteral() {} |
| 1784 | 1724 |
| 1785 bool is_const_; | 1725 bool is_const_; |
| 1786 Child<DartType> type_; | 1726 Child<DartType> type_; |
| 1787 List<Expression> expressions_; | 1727 List<Expression> expressions_; |
| 1788 | 1728 |
| 1789 DISALLOW_COPY_AND_ASSIGN(ListLiteral); | 1729 DISALLOW_COPY_AND_ASSIGN(ListLiteral); |
| 1790 }; | 1730 }; |
| 1791 | 1731 |
| 1792 | 1732 |
| 1793 class MapLiteral : public Expression { | 1733 class MapLiteral : public Expression { |
| 1794 public: | 1734 public: |
| 1795 static MapLiteral* ReadFrom(Reader* reader, bool is_const); | 1735 static MapLiteral* ReadFrom(Reader* reader, bool is_const); |
| 1796 virtual void WriteTo(Writer* writer); | |
| 1797 | 1736 |
| 1798 virtual ~MapLiteral(); | 1737 virtual ~MapLiteral(); |
| 1799 | 1738 |
| 1800 DEFINE_CASTING_OPERATIONS(MapLiteral); | 1739 DEFINE_CASTING_OPERATIONS(MapLiteral); |
| 1801 | 1740 |
| 1802 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1741 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1803 virtual void VisitChildren(Visitor* visitor); | 1742 virtual void VisitChildren(Visitor* visitor); |
| 1804 | 1743 |
| 1805 bool is_const() { return is_const_; } | 1744 bool is_const() { return is_const_; } |
| 1806 DartType* key_type() { return key_type_; } | 1745 DartType* key_type() { return key_type_; } |
| 1807 DartType* value_type() { return value_type_; } | 1746 DartType* value_type() { return value_type_; } |
| 1808 List<MapEntry>& entries() { return entries_; } | 1747 List<MapEntry>& entries() { return entries_; } |
| 1809 | 1748 |
| 1810 private: | 1749 private: |
| 1811 MapLiteral() {} | 1750 MapLiteral() {} |
| 1812 | 1751 |
| 1813 bool is_const_; | 1752 bool is_const_; |
| 1814 Child<DartType> key_type_; | 1753 Child<DartType> key_type_; |
| 1815 Child<DartType> value_type_; | 1754 Child<DartType> value_type_; |
| 1816 List<MapEntry> entries_; | 1755 List<MapEntry> entries_; |
| 1817 | 1756 |
| 1818 DISALLOW_COPY_AND_ASSIGN(MapLiteral); | 1757 DISALLOW_COPY_AND_ASSIGN(MapLiteral); |
| 1819 }; | 1758 }; |
| 1820 | 1759 |
| 1821 | 1760 |
| 1822 class MapEntry : public TreeNode { | 1761 class MapEntry : public TreeNode { |
| 1823 public: | 1762 public: |
| 1824 static MapEntry* ReadFrom(Reader* reader); | 1763 static MapEntry* ReadFrom(Reader* reader); |
| 1825 virtual void WriteTo(Writer* writer); | |
| 1826 | 1764 |
| 1827 virtual ~MapEntry(); | 1765 virtual ~MapEntry(); |
| 1828 | 1766 |
| 1829 DEFINE_CASTING_OPERATIONS(MapEntry); | 1767 DEFINE_CASTING_OPERATIONS(MapEntry); |
| 1830 | 1768 |
| 1831 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 1769 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 1832 virtual void VisitChildren(Visitor* visitor); | 1770 virtual void VisitChildren(Visitor* visitor); |
| 1833 | 1771 |
| 1834 Expression* key() { return key_; } | 1772 Expression* key() { return key_; } |
| 1835 Expression* value() { return value_; } | 1773 Expression* value() { return value_; } |
| 1836 | 1774 |
| 1837 private: | 1775 private: |
| 1838 MapEntry() {} | 1776 MapEntry() {} |
| 1839 | 1777 |
| 1840 template <typename T> | 1778 template <typename T> |
| 1841 friend class List; | 1779 friend class List; |
| 1842 | 1780 |
| 1843 Child<Expression> key_; | 1781 Child<Expression> key_; |
| 1844 Child<Expression> value_; | 1782 Child<Expression> value_; |
| 1845 | 1783 |
| 1846 DISALLOW_COPY_AND_ASSIGN(MapEntry); | 1784 DISALLOW_COPY_AND_ASSIGN(MapEntry); |
| 1847 }; | 1785 }; |
| 1848 | 1786 |
| 1849 | 1787 |
| 1850 class AwaitExpression : public Expression { | 1788 class AwaitExpression : public Expression { |
| 1851 public: | 1789 public: |
| 1852 static AwaitExpression* ReadFrom(Reader* reader); | 1790 static AwaitExpression* ReadFrom(Reader* reader); |
| 1853 virtual void WriteTo(Writer* writer); | |
| 1854 | 1791 |
| 1855 virtual ~AwaitExpression(); | 1792 virtual ~AwaitExpression(); |
| 1856 | 1793 |
| 1857 DEFINE_CASTING_OPERATIONS(AwaitExpression); | 1794 DEFINE_CASTING_OPERATIONS(AwaitExpression); |
| 1858 | 1795 |
| 1859 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1796 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1860 virtual void VisitChildren(Visitor* visitor); | 1797 virtual void VisitChildren(Visitor* visitor); |
| 1861 | 1798 |
| 1862 Expression* operand() { return operand_; } | 1799 Expression* operand() { return operand_; } |
| 1863 | 1800 |
| 1864 private: | 1801 private: |
| 1865 AwaitExpression() {} | 1802 AwaitExpression() {} |
| 1866 | 1803 |
| 1867 Child<Expression> operand_; | 1804 Child<Expression> operand_; |
| 1868 | 1805 |
| 1869 DISALLOW_COPY_AND_ASSIGN(AwaitExpression); | 1806 DISALLOW_COPY_AND_ASSIGN(AwaitExpression); |
| 1870 }; | 1807 }; |
| 1871 | 1808 |
| 1872 | 1809 |
| 1873 class FunctionExpression : public Expression { | 1810 class FunctionExpression : public Expression { |
| 1874 public: | 1811 public: |
| 1875 static FunctionExpression* ReadFrom(Reader* reader); | 1812 static FunctionExpression* ReadFrom(Reader* reader); |
| 1876 virtual void WriteTo(Writer* writer); | |
| 1877 | 1813 |
| 1878 virtual ~FunctionExpression(); | 1814 virtual ~FunctionExpression(); |
| 1879 | 1815 |
| 1880 DEFINE_CASTING_OPERATIONS(FunctionExpression); | 1816 DEFINE_CASTING_OPERATIONS(FunctionExpression); |
| 1881 | 1817 |
| 1882 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1818 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1883 virtual void VisitChildren(Visitor* visitor); | 1819 virtual void VisitChildren(Visitor* visitor); |
| 1884 | 1820 |
| 1885 FunctionNode* function() { return function_; } | 1821 FunctionNode* function() { return function_; } |
| 1886 | 1822 |
| 1887 private: | 1823 private: |
| 1888 FunctionExpression() {} | 1824 FunctionExpression() {} |
| 1889 | 1825 |
| 1890 Child<FunctionNode> function_; | 1826 Child<FunctionNode> function_; |
| 1891 | 1827 |
| 1892 DISALLOW_COPY_AND_ASSIGN(FunctionExpression); | 1828 DISALLOW_COPY_AND_ASSIGN(FunctionExpression); |
| 1893 }; | 1829 }; |
| 1894 | 1830 |
| 1895 | 1831 |
| 1896 class Let : public Expression { | 1832 class Let : public Expression { |
| 1897 public: | 1833 public: |
| 1898 static Let* ReadFrom(Reader* reader); | 1834 static Let* ReadFrom(Reader* reader); |
| 1899 virtual void WriteTo(Writer* writer); | |
| 1900 | 1835 |
| 1901 virtual ~Let(); | 1836 virtual ~Let(); |
| 1902 | 1837 |
| 1903 DEFINE_CASTING_OPERATIONS(Let); | 1838 DEFINE_CASTING_OPERATIONS(Let); |
| 1904 | 1839 |
| 1905 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1840 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
| 1906 virtual void VisitChildren(Visitor* visitor); | 1841 virtual void VisitChildren(Visitor* visitor); |
| 1907 | 1842 |
| 1908 VariableDeclaration* variable() { return variable_; } | 1843 VariableDeclaration* variable() { return variable_; } |
| 1909 Expression* body() { return body_; } | 1844 Expression* body() { return body_; } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1920 TokenPosition position_; | 1855 TokenPosition position_; |
| 1921 TokenPosition end_position_; | 1856 TokenPosition end_position_; |
| 1922 | 1857 |
| 1923 DISALLOW_COPY_AND_ASSIGN(Let); | 1858 DISALLOW_COPY_AND_ASSIGN(Let); |
| 1924 }; | 1859 }; |
| 1925 | 1860 |
| 1926 | 1861 |
| 1927 class Statement : public TreeNode { | 1862 class Statement : public TreeNode { |
| 1928 public: | 1863 public: |
| 1929 static Statement* ReadFrom(Reader* reader); | 1864 static Statement* ReadFrom(Reader* reader); |
| 1930 virtual void WriteTo(Writer* writer) = 0; | |
| 1931 | 1865 |
| 1932 virtual ~Statement(); | 1866 virtual ~Statement(); |
| 1933 | 1867 |
| 1934 DEFINE_CASTING_OPERATIONS(Statement); | 1868 DEFINE_CASTING_OPERATIONS(Statement); |
| 1935 | 1869 |
| 1936 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 1870 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 1937 virtual void AcceptStatementVisitor(StatementVisitor* visitor) = 0; | 1871 virtual void AcceptStatementVisitor(StatementVisitor* visitor) = 0; |
| 1938 TokenPosition position() { return position_; } | 1872 TokenPosition position() { return position_; } |
| 1939 | 1873 |
| 1940 protected: | 1874 protected: |
| 1941 Statement() : position_(TokenPosition::kNoSource) {} | 1875 Statement() : position_(TokenPosition::kNoSource) {} |
| 1942 TokenPosition position_; | 1876 TokenPosition position_; |
| 1943 | 1877 |
| 1944 private: | 1878 private: |
| 1945 DISALLOW_COPY_AND_ASSIGN(Statement); | 1879 DISALLOW_COPY_AND_ASSIGN(Statement); |
| 1946 }; | 1880 }; |
| 1947 | 1881 |
| 1948 | 1882 |
| 1949 class InvalidStatement : public Statement { | 1883 class InvalidStatement : public Statement { |
| 1950 public: | 1884 public: |
| 1951 static InvalidStatement* ReadFrom(Reader* reader); | 1885 static InvalidStatement* ReadFrom(Reader* reader); |
| 1952 virtual void WriteTo(Writer* writer); | |
| 1953 | 1886 |
| 1954 virtual ~InvalidStatement(); | 1887 virtual ~InvalidStatement(); |
| 1955 | 1888 |
| 1956 DEFINE_CASTING_OPERATIONS(InvalidStatement); | 1889 DEFINE_CASTING_OPERATIONS(InvalidStatement); |
| 1957 | 1890 |
| 1958 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 1891 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 1959 virtual void VisitChildren(Visitor* visitor); | 1892 virtual void VisitChildren(Visitor* visitor); |
| 1960 | 1893 |
| 1961 private: | 1894 private: |
| 1962 InvalidStatement() {} | 1895 InvalidStatement() {} |
| 1963 | 1896 |
| 1964 DISALLOW_COPY_AND_ASSIGN(InvalidStatement); | 1897 DISALLOW_COPY_AND_ASSIGN(InvalidStatement); |
| 1965 }; | 1898 }; |
| 1966 | 1899 |
| 1967 | 1900 |
| 1968 class ExpressionStatement : public Statement { | 1901 class ExpressionStatement : public Statement { |
| 1969 public: | 1902 public: |
| 1970 static ExpressionStatement* ReadFrom(Reader* reader); | 1903 static ExpressionStatement* ReadFrom(Reader* reader); |
| 1971 virtual void WriteTo(Writer* writer); | |
| 1972 | 1904 |
| 1973 explicit ExpressionStatement(Expression* exp) : expression_(exp) {} | 1905 explicit ExpressionStatement(Expression* exp) : expression_(exp) {} |
| 1974 virtual ~ExpressionStatement(); | 1906 virtual ~ExpressionStatement(); |
| 1975 | 1907 |
| 1976 DEFINE_CASTING_OPERATIONS(ExpressionStatement); | 1908 DEFINE_CASTING_OPERATIONS(ExpressionStatement); |
| 1977 | 1909 |
| 1978 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 1910 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 1979 virtual void VisitChildren(Visitor* visitor); | 1911 virtual void VisitChildren(Visitor* visitor); |
| 1980 | 1912 |
| 1981 Expression* expression() { return expression_; } | 1913 Expression* expression() { return expression_; } |
| 1982 | 1914 |
| 1983 private: | 1915 private: |
| 1984 ExpressionStatement() {} | 1916 ExpressionStatement() {} |
| 1985 | 1917 |
| 1986 Child<Expression> expression_; | 1918 Child<Expression> expression_; |
| 1987 | 1919 |
| 1988 DISALLOW_COPY_AND_ASSIGN(ExpressionStatement); | 1920 DISALLOW_COPY_AND_ASSIGN(ExpressionStatement); |
| 1989 }; | 1921 }; |
| 1990 | 1922 |
| 1991 | 1923 |
| 1992 class Block : public Statement { | 1924 class Block : public Statement { |
| 1993 public: | 1925 public: |
| 1994 static Block* ReadFromImpl(Reader* reader); | 1926 static Block* ReadFromImpl(Reader* reader); |
| 1995 virtual void WriteTo(Writer* writer); | |
| 1996 void WriteToImpl(Writer* writer); | |
| 1997 | 1927 |
| 1998 virtual ~Block(); | 1928 virtual ~Block(); |
| 1999 | 1929 |
| 2000 DEFINE_CASTING_OPERATIONS(Block); | 1930 DEFINE_CASTING_OPERATIONS(Block); |
| 2001 | 1931 |
| 2002 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 1932 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2003 virtual void VisitChildren(Visitor* visitor); | 1933 virtual void VisitChildren(Visitor* visitor); |
| 2004 | 1934 |
| 2005 List<Statement>& statements() { return statements_; } | 1935 List<Statement>& statements() { return statements_; } |
| 2006 | 1936 |
| 2007 private: | 1937 private: |
| 2008 Block() {} | 1938 Block() {} |
| 2009 | 1939 |
| 2010 List<Statement> statements_; | 1940 List<Statement> statements_; |
| 2011 | 1941 |
| 2012 DISALLOW_COPY_AND_ASSIGN(Block); | 1942 DISALLOW_COPY_AND_ASSIGN(Block); |
| 2013 }; | 1943 }; |
| 2014 | 1944 |
| 2015 | 1945 |
| 2016 class EmptyStatement : public Statement { | 1946 class EmptyStatement : public Statement { |
| 2017 public: | 1947 public: |
| 2018 static EmptyStatement* ReadFrom(Reader* reader); | 1948 static EmptyStatement* ReadFrom(Reader* reader); |
| 2019 virtual void WriteTo(Writer* writer); | |
| 2020 | 1949 |
| 2021 virtual ~EmptyStatement(); | 1950 virtual ~EmptyStatement(); |
| 2022 | 1951 |
| 2023 DEFINE_CASTING_OPERATIONS(EmptyStatement); | 1952 DEFINE_CASTING_OPERATIONS(EmptyStatement); |
| 2024 | 1953 |
| 2025 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 1954 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2026 virtual void VisitChildren(Visitor* visitor); | 1955 virtual void VisitChildren(Visitor* visitor); |
| 2027 | 1956 |
| 2028 private: | 1957 private: |
| 2029 EmptyStatement() {} | 1958 EmptyStatement() {} |
| 2030 | 1959 |
| 2031 DISALLOW_COPY_AND_ASSIGN(EmptyStatement); | 1960 DISALLOW_COPY_AND_ASSIGN(EmptyStatement); |
| 2032 }; | 1961 }; |
| 2033 | 1962 |
| 2034 | 1963 |
| 2035 class AssertStatement : public Statement { | 1964 class AssertStatement : public Statement { |
| 2036 public: | 1965 public: |
| 2037 static AssertStatement* ReadFrom(Reader* reader); | 1966 static AssertStatement* ReadFrom(Reader* reader); |
| 2038 virtual void WriteTo(Writer* writer); | |
| 2039 | 1967 |
| 2040 virtual ~AssertStatement(); | 1968 virtual ~AssertStatement(); |
| 2041 | 1969 |
| 2042 DEFINE_CASTING_OPERATIONS(AssertStatement); | 1970 DEFINE_CASTING_OPERATIONS(AssertStatement); |
| 2043 | 1971 |
| 2044 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 1972 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2045 virtual void VisitChildren(Visitor* visitor); | 1973 virtual void VisitChildren(Visitor* visitor); |
| 2046 | 1974 |
| 2047 Expression* condition() { return condition_; } | 1975 Expression* condition() { return condition_; } |
| 2048 Expression* message() { return message_; } | 1976 Expression* message() { return message_; } |
| 2049 | 1977 |
| 2050 private: | 1978 private: |
| 2051 AssertStatement() {} | 1979 AssertStatement() {} |
| 2052 | 1980 |
| 2053 Child<Expression> condition_; | 1981 Child<Expression> condition_; |
| 2054 Child<Expression> message_; | 1982 Child<Expression> message_; |
| 2055 | 1983 |
| 2056 DISALLOW_COPY_AND_ASSIGN(AssertStatement); | 1984 DISALLOW_COPY_AND_ASSIGN(AssertStatement); |
| 2057 }; | 1985 }; |
| 2058 | 1986 |
| 2059 | 1987 |
| 2060 class LabeledStatement : public Statement { | 1988 class LabeledStatement : public Statement { |
| 2061 public: | 1989 public: |
| 2062 static LabeledStatement* ReadFrom(Reader* reader); | 1990 static LabeledStatement* ReadFrom(Reader* reader); |
| 2063 virtual void WriteTo(Writer* writer); | |
| 2064 | 1991 |
| 2065 virtual ~LabeledStatement(); | 1992 virtual ~LabeledStatement(); |
| 2066 | 1993 |
| 2067 DEFINE_CASTING_OPERATIONS(LabeledStatement); | 1994 DEFINE_CASTING_OPERATIONS(LabeledStatement); |
| 2068 | 1995 |
| 2069 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 1996 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2070 virtual void VisitChildren(Visitor* visitor); | 1997 virtual void VisitChildren(Visitor* visitor); |
| 2071 | 1998 |
| 2072 Statement* body() { return body_; } | 1999 Statement* body() { return body_; } |
| 2073 | 2000 |
| 2074 private: | 2001 private: |
| 2075 LabeledStatement() {} | 2002 LabeledStatement() {} |
| 2076 | 2003 |
| 2077 Child<Statement> body_; | 2004 Child<Statement> body_; |
| 2078 | 2005 |
| 2079 DISALLOW_COPY_AND_ASSIGN(LabeledStatement); | 2006 DISALLOW_COPY_AND_ASSIGN(LabeledStatement); |
| 2080 }; | 2007 }; |
| 2081 | 2008 |
| 2082 | 2009 |
| 2083 class BreakStatement : public Statement { | 2010 class BreakStatement : public Statement { |
| 2084 public: | 2011 public: |
| 2085 static BreakStatement* ReadFrom(Reader* reader); | 2012 static BreakStatement* ReadFrom(Reader* reader); |
| 2086 virtual void WriteTo(Writer* writer); | |
| 2087 | 2013 |
| 2088 virtual ~BreakStatement(); | 2014 virtual ~BreakStatement(); |
| 2089 | 2015 |
| 2090 DEFINE_CASTING_OPERATIONS(BreakStatement); | 2016 DEFINE_CASTING_OPERATIONS(BreakStatement); |
| 2091 | 2017 |
| 2092 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2018 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2093 virtual void VisitChildren(Visitor* visitor); | 2019 virtual void VisitChildren(Visitor* visitor); |
| 2094 | 2020 |
| 2095 LabeledStatement* target() { return target_; } | 2021 LabeledStatement* target() { return target_; } |
| 2096 | 2022 |
| 2097 private: | 2023 private: |
| 2098 BreakStatement() {} | 2024 BreakStatement() {} |
| 2099 | 2025 |
| 2100 Ref<LabeledStatement> target_; | 2026 Ref<LabeledStatement> target_; |
| 2101 | 2027 |
| 2102 DISALLOW_COPY_AND_ASSIGN(BreakStatement); | 2028 DISALLOW_COPY_AND_ASSIGN(BreakStatement); |
| 2103 }; | 2029 }; |
| 2104 | 2030 |
| 2105 | 2031 |
| 2106 class WhileStatement : public Statement { | 2032 class WhileStatement : public Statement { |
| 2107 public: | 2033 public: |
| 2108 static WhileStatement* ReadFrom(Reader* reader); | 2034 static WhileStatement* ReadFrom(Reader* reader); |
| 2109 virtual void WriteTo(Writer* writer); | |
| 2110 | 2035 |
| 2111 virtual ~WhileStatement(); | 2036 virtual ~WhileStatement(); |
| 2112 | 2037 |
| 2113 DEFINE_CASTING_OPERATIONS(WhileStatement); | 2038 DEFINE_CASTING_OPERATIONS(WhileStatement); |
| 2114 | 2039 |
| 2115 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2040 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2116 virtual void VisitChildren(Visitor* visitor); | 2041 virtual void VisitChildren(Visitor* visitor); |
| 2117 | 2042 |
| 2118 Expression* condition() { return condition_; } | 2043 Expression* condition() { return condition_; } |
| 2119 Statement* body() { return body_; } | 2044 Statement* body() { return body_; } |
| 2120 | 2045 |
| 2121 private: | 2046 private: |
| 2122 WhileStatement() {} | 2047 WhileStatement() {} |
| 2123 | 2048 |
| 2124 Child<Expression> condition_; | 2049 Child<Expression> condition_; |
| 2125 Child<Statement> body_; | 2050 Child<Statement> body_; |
| 2126 | 2051 |
| 2127 DISALLOW_COPY_AND_ASSIGN(WhileStatement); | 2052 DISALLOW_COPY_AND_ASSIGN(WhileStatement); |
| 2128 }; | 2053 }; |
| 2129 | 2054 |
| 2130 | 2055 |
| 2131 class DoStatement : public Statement { | 2056 class DoStatement : public Statement { |
| 2132 public: | 2057 public: |
| 2133 static DoStatement* ReadFrom(Reader* reader); | 2058 static DoStatement* ReadFrom(Reader* reader); |
| 2134 virtual void WriteTo(Writer* writer); | |
| 2135 | 2059 |
| 2136 virtual ~DoStatement(); | 2060 virtual ~DoStatement(); |
| 2137 | 2061 |
| 2138 DEFINE_CASTING_OPERATIONS(DoStatement); | 2062 DEFINE_CASTING_OPERATIONS(DoStatement); |
| 2139 | 2063 |
| 2140 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2064 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2141 virtual void VisitChildren(Visitor* visitor); | 2065 virtual void VisitChildren(Visitor* visitor); |
| 2142 | 2066 |
| 2143 Expression* condition() { return condition_; } | 2067 Expression* condition() { return condition_; } |
| 2144 Statement* body() { return body_; } | 2068 Statement* body() { return body_; } |
| 2145 | 2069 |
| 2146 private: | 2070 private: |
| 2147 DoStatement() {} | 2071 DoStatement() {} |
| 2148 | 2072 |
| 2149 Child<Expression> condition_; | 2073 Child<Expression> condition_; |
| 2150 Child<Statement> body_; | 2074 Child<Statement> body_; |
| 2151 | 2075 |
| 2152 DISALLOW_COPY_AND_ASSIGN(DoStatement); | 2076 DISALLOW_COPY_AND_ASSIGN(DoStatement); |
| 2153 }; | 2077 }; |
| 2154 | 2078 |
| 2155 | 2079 |
| 2156 class ForStatement : public Statement { | 2080 class ForStatement : public Statement { |
| 2157 public: | 2081 public: |
| 2158 static ForStatement* ReadFrom(Reader* reader); | 2082 static ForStatement* ReadFrom(Reader* reader); |
| 2159 virtual void WriteTo(Writer* writer); | |
| 2160 | 2083 |
| 2161 virtual ~ForStatement(); | 2084 virtual ~ForStatement(); |
| 2162 | 2085 |
| 2163 DEFINE_CASTING_OPERATIONS(ForStatement); | 2086 DEFINE_CASTING_OPERATIONS(ForStatement); |
| 2164 | 2087 |
| 2165 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2088 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2166 virtual void VisitChildren(Visitor* visitor); | 2089 virtual void VisitChildren(Visitor* visitor); |
| 2167 | 2090 |
| 2168 List<VariableDeclaration>& variables() { return variables_; } | 2091 List<VariableDeclaration>& variables() { return variables_; } |
| 2169 Expression* condition() { return condition_; } | 2092 Expression* condition() { return condition_; } |
| 2170 List<Expression>& updates() { return updates_; } | 2093 List<Expression>& updates() { return updates_; } |
| 2171 Statement* body() { return body_; } | 2094 Statement* body() { return body_; } |
| 2172 | 2095 |
| 2173 private: | 2096 private: |
| 2174 ForStatement() {} | 2097 ForStatement() {} |
| 2175 | 2098 |
| 2176 List<VariableDeclaration> variables_; | 2099 List<VariableDeclaration> variables_; |
| 2177 Child<Expression> condition_; | 2100 Child<Expression> condition_; |
| 2178 List<Expression> updates_; | 2101 List<Expression> updates_; |
| 2179 Child<Statement> body_; | 2102 Child<Statement> body_; |
| 2180 | 2103 |
| 2181 DISALLOW_COPY_AND_ASSIGN(ForStatement); | 2104 DISALLOW_COPY_AND_ASSIGN(ForStatement); |
| 2182 }; | 2105 }; |
| 2183 | 2106 |
| 2184 | 2107 |
| 2185 class ForInStatement : public Statement { | 2108 class ForInStatement : public Statement { |
| 2186 public: | 2109 public: |
| 2187 static ForInStatement* ReadFrom(Reader* reader, bool is_async); | 2110 static ForInStatement* ReadFrom(Reader* reader, bool is_async); |
| 2188 virtual void WriteTo(Writer* writer); | |
| 2189 | 2111 |
| 2190 virtual ~ForInStatement(); | 2112 virtual ~ForInStatement(); |
| 2191 | 2113 |
| 2192 DEFINE_CASTING_OPERATIONS(ForInStatement); | 2114 DEFINE_CASTING_OPERATIONS(ForInStatement); |
| 2193 | 2115 |
| 2194 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2116 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2195 virtual void VisitChildren(Visitor* visitor); | 2117 virtual void VisitChildren(Visitor* visitor); |
| 2196 | 2118 |
| 2197 VariableDeclaration* variable() { return variable_; } | 2119 VariableDeclaration* variable() { return variable_; } |
| 2198 Expression* iterable() { return iterable_; } | 2120 Expression* iterable() { return iterable_; } |
| 2199 Statement* body() { return body_; } | 2121 Statement* body() { return body_; } |
| 2200 bool is_async() { return is_async_; } | 2122 bool is_async() { return is_async_; } |
| 2201 | 2123 |
| 2202 private: | 2124 private: |
| 2203 ForInStatement() {} | 2125 ForInStatement() {} |
| 2204 | 2126 |
| 2205 Child<VariableDeclaration> variable_; | 2127 Child<VariableDeclaration> variable_; |
| 2206 Child<Expression> iterable_; | 2128 Child<Expression> iterable_; |
| 2207 Child<Statement> body_; | 2129 Child<Statement> body_; |
| 2208 bool is_async_; | 2130 bool is_async_; |
| 2209 | 2131 |
| 2210 DISALLOW_COPY_AND_ASSIGN(ForInStatement); | 2132 DISALLOW_COPY_AND_ASSIGN(ForInStatement); |
| 2211 }; | 2133 }; |
| 2212 | 2134 |
| 2213 | 2135 |
| 2214 class SwitchStatement : public Statement { | 2136 class SwitchStatement : public Statement { |
| 2215 public: | 2137 public: |
| 2216 static SwitchStatement* ReadFrom(Reader* reader); | 2138 static SwitchStatement* ReadFrom(Reader* reader); |
| 2217 virtual void WriteTo(Writer* writer); | |
| 2218 | 2139 |
| 2219 virtual ~SwitchStatement(); | 2140 virtual ~SwitchStatement(); |
| 2220 | 2141 |
| 2221 DEFINE_CASTING_OPERATIONS(SwitchStatement); | 2142 DEFINE_CASTING_OPERATIONS(SwitchStatement); |
| 2222 | 2143 |
| 2223 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2144 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2224 virtual void VisitChildren(Visitor* visitor); | 2145 virtual void VisitChildren(Visitor* visitor); |
| 2225 | 2146 |
| 2226 Expression* condition() { return condition_; } | 2147 Expression* condition() { return condition_; } |
| 2227 List<SwitchCase>& cases() { return cases_; } | 2148 List<SwitchCase>& cases() { return cases_; } |
| 2228 | 2149 |
| 2229 private: | 2150 private: |
| 2230 SwitchStatement() {} | 2151 SwitchStatement() {} |
| 2231 | 2152 |
| 2232 Child<Expression> condition_; | 2153 Child<Expression> condition_; |
| 2233 List<SwitchCase> cases_; | 2154 List<SwitchCase> cases_; |
| 2234 | 2155 |
| 2235 DISALLOW_COPY_AND_ASSIGN(SwitchStatement); | 2156 DISALLOW_COPY_AND_ASSIGN(SwitchStatement); |
| 2236 }; | 2157 }; |
| 2237 | 2158 |
| 2238 | 2159 |
| 2239 class SwitchCase : public TreeNode { | 2160 class SwitchCase : public TreeNode { |
| 2240 public: | 2161 public: |
| 2241 SwitchCase* ReadFrom(Reader* reader); | 2162 SwitchCase* ReadFrom(Reader* reader); |
| 2242 void WriteTo(Writer* writer); | |
| 2243 | 2163 |
| 2244 virtual ~SwitchCase(); | 2164 virtual ~SwitchCase(); |
| 2245 | 2165 |
| 2246 DEFINE_CASTING_OPERATIONS(SwitchCase); | 2166 DEFINE_CASTING_OPERATIONS(SwitchCase); |
| 2247 | 2167 |
| 2248 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 2168 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 2249 virtual void VisitChildren(Visitor* visitor); | 2169 virtual void VisitChildren(Visitor* visitor); |
| 2250 | 2170 |
| 2251 List<Expression>& expressions() { return expressions_; } | 2171 List<Expression>& expressions() { return expressions_; } |
| 2252 bool is_default() { return is_default_; } | 2172 bool is_default() { return is_default_; } |
| 2253 Statement* body() { return body_; } | 2173 Statement* body() { return body_; } |
| 2254 | 2174 |
| 2255 private: | 2175 private: |
| 2256 SwitchCase() {} | 2176 SwitchCase() {} |
| 2257 | 2177 |
| 2258 template <typename T> | 2178 template <typename T> |
| 2259 friend class List; | 2179 friend class List; |
| 2260 | 2180 |
| 2261 List<Expression> expressions_; | 2181 List<Expression> expressions_; |
| 2262 bool is_default_; | 2182 bool is_default_; |
| 2263 Child<Statement> body_; | 2183 Child<Statement> body_; |
| 2264 | 2184 |
| 2265 DISALLOW_COPY_AND_ASSIGN(SwitchCase); | 2185 DISALLOW_COPY_AND_ASSIGN(SwitchCase); |
| 2266 }; | 2186 }; |
| 2267 | 2187 |
| 2268 | 2188 |
| 2269 class ContinueSwitchStatement : public Statement { | 2189 class ContinueSwitchStatement : public Statement { |
| 2270 public: | 2190 public: |
| 2271 static ContinueSwitchStatement* ReadFrom(Reader* reader); | 2191 static ContinueSwitchStatement* ReadFrom(Reader* reader); |
| 2272 virtual void WriteTo(Writer* writer); | |
| 2273 | 2192 |
| 2274 virtual ~ContinueSwitchStatement(); | 2193 virtual ~ContinueSwitchStatement(); |
| 2275 | 2194 |
| 2276 DEFINE_CASTING_OPERATIONS(ContinueSwitchStatement); | 2195 DEFINE_CASTING_OPERATIONS(ContinueSwitchStatement); |
| 2277 | 2196 |
| 2278 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2197 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2279 virtual void VisitChildren(Visitor* visitor); | 2198 virtual void VisitChildren(Visitor* visitor); |
| 2280 | 2199 |
| 2281 SwitchCase* target() { return target_; } | 2200 SwitchCase* target() { return target_; } |
| 2282 | 2201 |
| 2283 private: | 2202 private: |
| 2284 ContinueSwitchStatement() {} | 2203 ContinueSwitchStatement() {} |
| 2285 | 2204 |
| 2286 Ref<SwitchCase> target_; | 2205 Ref<SwitchCase> target_; |
| 2287 | 2206 |
| 2288 DISALLOW_COPY_AND_ASSIGN(ContinueSwitchStatement); | 2207 DISALLOW_COPY_AND_ASSIGN(ContinueSwitchStatement); |
| 2289 }; | 2208 }; |
| 2290 | 2209 |
| 2291 | 2210 |
| 2292 class IfStatement : public Statement { | 2211 class IfStatement : public Statement { |
| 2293 public: | 2212 public: |
| 2294 static IfStatement* ReadFrom(Reader* reader); | 2213 static IfStatement* ReadFrom(Reader* reader); |
| 2295 virtual void WriteTo(Writer* writer); | |
| 2296 | 2214 |
| 2297 virtual ~IfStatement(); | 2215 virtual ~IfStatement(); |
| 2298 | 2216 |
| 2299 DEFINE_CASTING_OPERATIONS(IfStatement); | 2217 DEFINE_CASTING_OPERATIONS(IfStatement); |
| 2300 | 2218 |
| 2301 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2219 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2302 virtual void VisitChildren(Visitor* visitor); | 2220 virtual void VisitChildren(Visitor* visitor); |
| 2303 | 2221 |
| 2304 Expression* condition() { return condition_; } | 2222 Expression* condition() { return condition_; } |
| 2305 Statement* then() { return then_; } | 2223 Statement* then() { return then_; } |
| 2306 Statement* otherwise() { return otherwise_; } | 2224 Statement* otherwise() { return otherwise_; } |
| 2307 | 2225 |
| 2308 private: | 2226 private: |
| 2309 IfStatement() {} | 2227 IfStatement() {} |
| 2310 | 2228 |
| 2311 Child<Expression> condition_; | 2229 Child<Expression> condition_; |
| 2312 Child<Statement> then_; | 2230 Child<Statement> then_; |
| 2313 Child<Statement> otherwise_; | 2231 Child<Statement> otherwise_; |
| 2314 | 2232 |
| 2315 DISALLOW_COPY_AND_ASSIGN(IfStatement); | 2233 DISALLOW_COPY_AND_ASSIGN(IfStatement); |
| 2316 }; | 2234 }; |
| 2317 | 2235 |
| 2318 | 2236 |
| 2319 class ReturnStatement : public Statement { | 2237 class ReturnStatement : public Statement { |
| 2320 public: | 2238 public: |
| 2321 static ReturnStatement* ReadFrom(Reader* reader); | 2239 static ReturnStatement* ReadFrom(Reader* reader); |
| 2322 virtual void WriteTo(Writer* writer); | |
| 2323 | 2240 |
| 2324 virtual ~ReturnStatement(); | 2241 virtual ~ReturnStatement(); |
| 2325 | 2242 |
| 2326 DEFINE_CASTING_OPERATIONS(ReturnStatement); | 2243 DEFINE_CASTING_OPERATIONS(ReturnStatement); |
| 2327 | 2244 |
| 2328 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2245 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2329 virtual void VisitChildren(Visitor* visitor); | 2246 virtual void VisitChildren(Visitor* visitor); |
| 2330 | 2247 |
| 2331 Expression* expression() { return expression_; } | 2248 Expression* expression() { return expression_; } |
| 2332 | 2249 |
| 2333 private: | 2250 private: |
| 2334 ReturnStatement() {} | 2251 ReturnStatement() {} |
| 2335 | 2252 |
| 2336 Child<Expression> expression_; | 2253 Child<Expression> expression_; |
| 2337 | 2254 |
| 2338 DISALLOW_COPY_AND_ASSIGN(ReturnStatement); | 2255 DISALLOW_COPY_AND_ASSIGN(ReturnStatement); |
| 2339 }; | 2256 }; |
| 2340 | 2257 |
| 2341 | 2258 |
| 2342 class TryCatch : public Statement { | 2259 class TryCatch : public Statement { |
| 2343 public: | 2260 public: |
| 2344 static TryCatch* ReadFrom(Reader* reader); | 2261 static TryCatch* ReadFrom(Reader* reader); |
| 2345 virtual void WriteTo(Writer* writer); | |
| 2346 | 2262 |
| 2347 virtual ~TryCatch(); | 2263 virtual ~TryCatch(); |
| 2348 | 2264 |
| 2349 DEFINE_CASTING_OPERATIONS(TryCatch); | 2265 DEFINE_CASTING_OPERATIONS(TryCatch); |
| 2350 | 2266 |
| 2351 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2267 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2352 virtual void VisitChildren(Visitor* visitor); | 2268 virtual void VisitChildren(Visitor* visitor); |
| 2353 | 2269 |
| 2354 Statement* body() { return body_; } | 2270 Statement* body() { return body_; } |
| 2355 List<Catch>& catches() { return catches_; } | 2271 List<Catch>& catches() { return catches_; } |
| 2356 | 2272 |
| 2357 private: | 2273 private: |
| 2358 TryCatch() {} | 2274 TryCatch() {} |
| 2359 | 2275 |
| 2360 Child<Statement> body_; | 2276 Child<Statement> body_; |
| 2361 List<Catch> catches_; | 2277 List<Catch> catches_; |
| 2362 | 2278 |
| 2363 DISALLOW_COPY_AND_ASSIGN(TryCatch); | 2279 DISALLOW_COPY_AND_ASSIGN(TryCatch); |
| 2364 }; | 2280 }; |
| 2365 | 2281 |
| 2366 | 2282 |
| 2367 class Catch : public TreeNode { | 2283 class Catch : public TreeNode { |
| 2368 public: | 2284 public: |
| 2369 static Catch* ReadFrom(Reader* reader); | 2285 static Catch* ReadFrom(Reader* reader); |
| 2370 void WriteTo(Writer* writer); | |
| 2371 | 2286 |
| 2372 virtual ~Catch(); | 2287 virtual ~Catch(); |
| 2373 | 2288 |
| 2374 DEFINE_CASTING_OPERATIONS(Catch); | 2289 DEFINE_CASTING_OPERATIONS(Catch); |
| 2375 | 2290 |
| 2376 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 2291 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 2377 virtual void VisitChildren(Visitor* visitor); | 2292 virtual void VisitChildren(Visitor* visitor); |
| 2378 | 2293 |
| 2379 DartType* guard() { return guard_; } | 2294 DartType* guard() { return guard_; } |
| 2380 VariableDeclaration* exception() { return exception_; } | 2295 VariableDeclaration* exception() { return exception_; } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2392 Child<VariableDeclaration> stack_trace_; | 2307 Child<VariableDeclaration> stack_trace_; |
| 2393 Child<Statement> body_; | 2308 Child<Statement> body_; |
| 2394 | 2309 |
| 2395 DISALLOW_COPY_AND_ASSIGN(Catch); | 2310 DISALLOW_COPY_AND_ASSIGN(Catch); |
| 2396 }; | 2311 }; |
| 2397 | 2312 |
| 2398 | 2313 |
| 2399 class TryFinally : public Statement { | 2314 class TryFinally : public Statement { |
| 2400 public: | 2315 public: |
| 2401 static TryFinally* ReadFrom(Reader* reader); | 2316 static TryFinally* ReadFrom(Reader* reader); |
| 2402 virtual void WriteTo(Writer* writer); | |
| 2403 | 2317 |
| 2404 virtual ~TryFinally(); | 2318 virtual ~TryFinally(); |
| 2405 | 2319 |
| 2406 DEFINE_CASTING_OPERATIONS(TryFinally); | 2320 DEFINE_CASTING_OPERATIONS(TryFinally); |
| 2407 | 2321 |
| 2408 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2322 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2409 virtual void VisitChildren(Visitor* visitor); | 2323 virtual void VisitChildren(Visitor* visitor); |
| 2410 | 2324 |
| 2411 Statement* body() { return body_; } | 2325 Statement* body() { return body_; } |
| 2412 Statement* finalizer() { return finalizer_; } | 2326 Statement* finalizer() { return finalizer_; } |
| 2413 | 2327 |
| 2414 private: | 2328 private: |
| 2415 TryFinally() {} | 2329 TryFinally() {} |
| 2416 | 2330 |
| 2417 Child<Statement> body_; | 2331 Child<Statement> body_; |
| 2418 Child<Statement> finalizer_; | 2332 Child<Statement> finalizer_; |
| 2419 | 2333 |
| 2420 DISALLOW_COPY_AND_ASSIGN(TryFinally); | 2334 DISALLOW_COPY_AND_ASSIGN(TryFinally); |
| 2421 }; | 2335 }; |
| 2422 | 2336 |
| 2423 | 2337 |
| 2424 class YieldStatement : public Statement { | 2338 class YieldStatement : public Statement { |
| 2425 public: | 2339 public: |
| 2426 enum { | 2340 enum { |
| 2427 kFlagYieldStar = 1 << 0, | 2341 kFlagYieldStar = 1 << 0, |
| 2428 kFlagNative = 1 << 1, | 2342 kFlagNative = 1 << 1, |
| 2429 }; | 2343 }; |
| 2430 static YieldStatement* ReadFrom(Reader* reader); | 2344 static YieldStatement* ReadFrom(Reader* reader); |
| 2431 virtual void WriteTo(Writer* writer); | |
| 2432 | 2345 |
| 2433 virtual ~YieldStatement(); | 2346 virtual ~YieldStatement(); |
| 2434 | 2347 |
| 2435 DEFINE_CASTING_OPERATIONS(YieldStatement); | 2348 DEFINE_CASTING_OPERATIONS(YieldStatement); |
| 2436 | 2349 |
| 2437 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2350 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2438 virtual void VisitChildren(Visitor* visitor); | 2351 virtual void VisitChildren(Visitor* visitor); |
| 2439 | 2352 |
| 2440 bool is_yield_start() { return (flags_ & kFlagYieldStar) == kFlagYieldStar; } | 2353 bool is_yield_start() { return (flags_ & kFlagYieldStar) == kFlagYieldStar; } |
| 2441 bool is_native() { return (flags_ & kFlagNative) == kFlagNative; } | 2354 bool is_native() { return (flags_ & kFlagNative) == kFlagNative; } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2453 | 2366 |
| 2454 class VariableDeclaration : public Statement { | 2367 class VariableDeclaration : public Statement { |
| 2455 public: | 2368 public: |
| 2456 enum Flags { | 2369 enum Flags { |
| 2457 kFlagFinal = 1 << 0, | 2370 kFlagFinal = 1 << 0, |
| 2458 kFlagConst = 1 << 1, | 2371 kFlagConst = 1 << 1, |
| 2459 }; | 2372 }; |
| 2460 | 2373 |
| 2461 static VariableDeclaration* ReadFrom(Reader* reader); | 2374 static VariableDeclaration* ReadFrom(Reader* reader); |
| 2462 static VariableDeclaration* ReadFromImpl(Reader* reader); | 2375 static VariableDeclaration* ReadFromImpl(Reader* reader); |
| 2463 virtual void WriteTo(Writer* writer); | |
| 2464 void WriteToImpl(Writer* writer); | |
| 2465 | 2376 |
| 2466 virtual ~VariableDeclaration(); | 2377 virtual ~VariableDeclaration(); |
| 2467 | 2378 |
| 2468 DEFINE_CASTING_OPERATIONS(VariableDeclaration); | 2379 DEFINE_CASTING_OPERATIONS(VariableDeclaration); |
| 2469 | 2380 |
| 2470 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2381 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2471 virtual void VisitChildren(Visitor* visitor); | 2382 virtual void VisitChildren(Visitor* visitor); |
| 2472 | 2383 |
| 2473 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } | 2384 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } |
| 2474 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } | 2385 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2490 Child<InferredValue> inferred_value_; | 2401 Child<InferredValue> inferred_value_; |
| 2491 Child<Expression> initializer_; | 2402 Child<Expression> initializer_; |
| 2492 | 2403 |
| 2493 DISALLOW_COPY_AND_ASSIGN(VariableDeclaration); | 2404 DISALLOW_COPY_AND_ASSIGN(VariableDeclaration); |
| 2494 }; | 2405 }; |
| 2495 | 2406 |
| 2496 | 2407 |
| 2497 class FunctionDeclaration : public Statement { | 2408 class FunctionDeclaration : public Statement { |
| 2498 public: | 2409 public: |
| 2499 static FunctionDeclaration* ReadFrom(Reader* reader); | 2410 static FunctionDeclaration* ReadFrom(Reader* reader); |
| 2500 virtual void WriteTo(Writer* writer); | |
| 2501 | 2411 |
| 2502 virtual ~FunctionDeclaration(); | 2412 virtual ~FunctionDeclaration(); |
| 2503 | 2413 |
| 2504 DEFINE_CASTING_OPERATIONS(FunctionDeclaration); | 2414 DEFINE_CASTING_OPERATIONS(FunctionDeclaration); |
| 2505 | 2415 |
| 2506 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2416 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
| 2507 virtual void VisitChildren(Visitor* visitor); | 2417 virtual void VisitChildren(Visitor* visitor); |
| 2508 | 2418 |
| 2509 VariableDeclaration* variable() { return variable_; } | 2419 VariableDeclaration* variable() { return variable_; } |
| 2510 FunctionNode* function() { return function_; } | 2420 FunctionNode* function() { return function_; } |
| 2511 | 2421 |
| 2512 private: | 2422 private: |
| 2513 FunctionDeclaration() {} | 2423 FunctionDeclaration() {} |
| 2514 | 2424 |
| 2515 Child<VariableDeclaration> variable_; | 2425 Child<VariableDeclaration> variable_; |
| 2516 Child<FunctionNode> function_; | 2426 Child<FunctionNode> function_; |
| 2517 | 2427 |
| 2518 DISALLOW_COPY_AND_ASSIGN(FunctionDeclaration); | 2428 DISALLOW_COPY_AND_ASSIGN(FunctionDeclaration); |
| 2519 }; | 2429 }; |
| 2520 | 2430 |
| 2521 | 2431 |
| 2522 class Name : public Node { | 2432 class Name : public Node { |
| 2523 public: | 2433 public: |
| 2524 static Name* ReadFrom(Reader* reader); | 2434 static Name* ReadFrom(Reader* reader); |
| 2525 void WriteTo(Writer* writer); | |
| 2526 | 2435 |
| 2527 virtual ~Name(); | 2436 virtual ~Name(); |
| 2528 | 2437 |
| 2529 DEFINE_CASTING_OPERATIONS(Name); | 2438 DEFINE_CASTING_OPERATIONS(Name); |
| 2530 | 2439 |
| 2531 virtual void AcceptVisitor(Visitor* visitor); | 2440 virtual void AcceptVisitor(Visitor* visitor); |
| 2532 virtual void VisitChildren(Visitor* visitor); | 2441 virtual void VisitChildren(Visitor* visitor); |
| 2533 | 2442 |
| 2534 String* string() { return string_; } | 2443 String* string() { return string_; } |
| 2535 Library* library() { return library_; } | 2444 Library* library() { return library_; } |
| 2536 | 2445 |
| 2537 private: | 2446 private: |
| 2538 Name(String* string, Library* library) : string_(string), library_(library) {} | 2447 Name(String* string, Library* library) |
| 2448 : string_(string), library_(library) {} // NOLINT |
| 2539 | 2449 |
| 2540 Ref<String> string_; | 2450 Ref<String> string_; |
| 2541 Ref<Library> library_; | 2451 Ref<Library> library_; |
| 2542 | 2452 |
| 2543 DISALLOW_COPY_AND_ASSIGN(Name); | 2453 DISALLOW_COPY_AND_ASSIGN(Name); |
| 2544 }; | 2454 }; |
| 2545 | 2455 |
| 2546 | 2456 |
| 2547 class InferredValue : public Node { | 2457 class InferredValue : public Node { |
| 2548 public: | 2458 public: |
| 2549 static const uint8_t kNull = 1 << 0; | 2459 static const uint8_t kNull = 1 << 0; |
| 2550 static const uint8_t kInteger = 1 << 1; | 2460 static const uint8_t kInteger = 1 << 1; |
| 2551 static const uint8_t kDouble = 1 << 2; | 2461 static const uint8_t kDouble = 1 << 2; |
| 2552 static const uint8_t kString = 1 << 3; | 2462 static const uint8_t kString = 1 << 3; |
| 2553 static const uint8_t kOther = 1 << 4; | 2463 static const uint8_t kOther = 1 << 4; |
| 2554 | 2464 |
| 2555 enum BaseClassKind { | 2465 enum BaseClassKind { |
| 2556 kNone, | 2466 kNone, |
| 2557 kExact, | 2467 kExact, |
| 2558 kSubclass, | 2468 kSubclass, |
| 2559 kSubtype, | 2469 kSubtype, |
| 2560 }; | 2470 }; |
| 2561 | 2471 |
| 2562 static InferredValue* ReadFrom(Reader* reader); | 2472 static InferredValue* ReadFrom(Reader* reader); |
| 2563 void WriteTo(Writer* writer); | |
| 2564 | 2473 |
| 2565 virtual ~InferredValue(); | 2474 virtual ~InferredValue(); |
| 2566 | 2475 |
| 2567 DEFINE_CASTING_OPERATIONS(InferredValue); | 2476 DEFINE_CASTING_OPERATIONS(InferredValue); |
| 2568 | 2477 |
| 2569 virtual void AcceptVisitor(Visitor* visitor); | 2478 virtual void AcceptVisitor(Visitor* visitor); |
| 2570 virtual void VisitChildren(Visitor* visitor); | 2479 virtual void VisitChildren(Visitor* visitor); |
| 2571 | 2480 |
| 2572 bool IsInterfaceType() { return kind_ == kSubtype; } | 2481 bool IsInterfaceType() { return kind_ == kSubtype; } |
| 2573 bool IsExactClass() { return kind_ == kExact; } | 2482 bool IsExactClass() { return kind_ == kExact; } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2594 BaseClassKind kind_; | 2503 BaseClassKind kind_; |
| 2595 uint8_t value_bits_; | 2504 uint8_t value_bits_; |
| 2596 | 2505 |
| 2597 DISALLOW_COPY_AND_ASSIGN(InferredValue); | 2506 DISALLOW_COPY_AND_ASSIGN(InferredValue); |
| 2598 }; | 2507 }; |
| 2599 | 2508 |
| 2600 | 2509 |
| 2601 class DartType : public Node { | 2510 class DartType : public Node { |
| 2602 public: | 2511 public: |
| 2603 static DartType* ReadFrom(Reader* reader); | 2512 static DartType* ReadFrom(Reader* reader); |
| 2604 virtual void WriteTo(Writer* writer) = 0; | |
| 2605 | 2513 |
| 2606 virtual ~DartType(); | 2514 virtual ~DartType(); |
| 2607 | 2515 |
| 2608 DEFINE_CASTING_OPERATIONS(DartType); | 2516 DEFINE_CASTING_OPERATIONS(DartType); |
| 2609 | 2517 |
| 2610 virtual void AcceptVisitor(Visitor* visitor); | 2518 virtual void AcceptVisitor(Visitor* visitor); |
| 2611 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor) = 0; | 2519 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor) = 0; |
| 2612 | 2520 |
| 2613 protected: | 2521 protected: |
| 2614 DartType() {} | 2522 DartType() {} |
| 2615 | 2523 |
| 2616 private: | 2524 private: |
| 2617 DISALLOW_COPY_AND_ASSIGN(DartType); | 2525 DISALLOW_COPY_AND_ASSIGN(DartType); |
| 2618 }; | 2526 }; |
| 2619 | 2527 |
| 2620 | 2528 |
| 2621 class InvalidType : public DartType { | 2529 class InvalidType : public DartType { |
| 2622 public: | 2530 public: |
| 2623 static InvalidType* ReadFrom(Reader* reader); | 2531 static InvalidType* ReadFrom(Reader* reader); |
| 2624 void WriteTo(Writer* writer); | |
| 2625 | 2532 |
| 2626 virtual ~InvalidType(); | 2533 virtual ~InvalidType(); |
| 2627 | 2534 |
| 2628 DEFINE_CASTING_OPERATIONS(InvalidType); | 2535 DEFINE_CASTING_OPERATIONS(InvalidType); |
| 2629 | 2536 |
| 2630 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); | 2537 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); |
| 2631 virtual void VisitChildren(Visitor* visitor); | 2538 virtual void VisitChildren(Visitor* visitor); |
| 2632 | 2539 |
| 2633 private: | 2540 private: |
| 2634 InvalidType() {} | 2541 InvalidType() {} |
| 2635 | 2542 |
| 2636 DISALLOW_COPY_AND_ASSIGN(InvalidType); | 2543 DISALLOW_COPY_AND_ASSIGN(InvalidType); |
| 2637 }; | 2544 }; |
| 2638 | 2545 |
| 2639 | 2546 |
| 2640 class DynamicType : public DartType { | 2547 class DynamicType : public DartType { |
| 2641 public: | 2548 public: |
| 2642 static DynamicType* ReadFrom(Reader* reader); | 2549 static DynamicType* ReadFrom(Reader* reader); |
| 2643 void WriteTo(Writer* writer); | |
| 2644 | 2550 |
| 2645 virtual ~DynamicType(); | 2551 virtual ~DynamicType(); |
| 2646 | 2552 |
| 2647 DEFINE_CASTING_OPERATIONS(DynamicType); | 2553 DEFINE_CASTING_OPERATIONS(DynamicType); |
| 2648 | 2554 |
| 2649 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); | 2555 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); |
| 2650 virtual void VisitChildren(Visitor* visitor); | 2556 virtual void VisitChildren(Visitor* visitor); |
| 2651 | 2557 |
| 2652 private: | 2558 private: |
| 2653 DynamicType() {} | 2559 DynamicType() {} |
| 2654 | 2560 |
| 2655 DISALLOW_COPY_AND_ASSIGN(DynamicType); | 2561 DISALLOW_COPY_AND_ASSIGN(DynamicType); |
| 2656 }; | 2562 }; |
| 2657 | 2563 |
| 2658 | 2564 |
| 2659 class VoidType : public DartType { | 2565 class VoidType : public DartType { |
| 2660 public: | 2566 public: |
| 2661 static VoidType* ReadFrom(Reader* reader); | 2567 static VoidType* ReadFrom(Reader* reader); |
| 2662 void WriteTo(Writer* writer); | |
| 2663 | 2568 |
| 2664 virtual ~VoidType(); | 2569 virtual ~VoidType(); |
| 2665 | 2570 |
| 2666 DEFINE_CASTING_OPERATIONS(VoidType); | 2571 DEFINE_CASTING_OPERATIONS(VoidType); |
| 2667 | 2572 |
| 2668 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); | 2573 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); |
| 2669 virtual void VisitChildren(Visitor* visitor); | 2574 virtual void VisitChildren(Visitor* visitor); |
| 2670 | 2575 |
| 2671 private: | 2576 private: |
| 2672 VoidType() {} | 2577 VoidType() {} |
| 2673 | 2578 |
| 2674 DISALLOW_COPY_AND_ASSIGN(VoidType); | 2579 DISALLOW_COPY_AND_ASSIGN(VoidType); |
| 2675 }; | 2580 }; |
| 2676 | 2581 |
| 2677 | 2582 |
| 2678 class InterfaceType : public DartType { | 2583 class InterfaceType : public DartType { |
| 2679 public: | 2584 public: |
| 2680 static InterfaceType* ReadFrom(Reader* reader); | 2585 static InterfaceType* ReadFrom(Reader* reader); |
| 2681 static InterfaceType* ReadFrom(Reader* reader, bool _without_type_arguments_); | 2586 static InterfaceType* ReadFrom(Reader* reader, bool _without_type_arguments_); |
| 2682 void WriteTo(Writer* writer); | |
| 2683 | 2587 |
| 2684 explicit InterfaceType(Class* klass) : klass_(klass) {} | 2588 explicit InterfaceType(Class* klass) : klass_(klass) {} |
| 2685 virtual ~InterfaceType(); | 2589 virtual ~InterfaceType(); |
| 2686 | 2590 |
| 2687 DEFINE_CASTING_OPERATIONS(InterfaceType); | 2591 DEFINE_CASTING_OPERATIONS(InterfaceType); |
| 2688 | 2592 |
| 2689 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); | 2593 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); |
| 2690 virtual void VisitChildren(Visitor* visitor); | 2594 virtual void VisitChildren(Visitor* visitor); |
| 2691 | 2595 |
| 2692 Class* klass() { return klass_; } | 2596 Class* klass() { return klass_; } |
| 2693 List<DartType>& type_arguments() { return type_arguments_; } | 2597 List<DartType>& type_arguments() { return type_arguments_; } |
| 2694 | 2598 |
| 2695 private: | 2599 private: |
| 2696 InterfaceType() {} | 2600 InterfaceType() {} |
| 2697 | 2601 |
| 2698 Ref<Class> klass_; | 2602 Ref<Class> klass_; |
| 2699 List<DartType> type_arguments_; | 2603 List<DartType> type_arguments_; |
| 2700 | 2604 |
| 2701 DISALLOW_COPY_AND_ASSIGN(InterfaceType); | 2605 DISALLOW_COPY_AND_ASSIGN(InterfaceType); |
| 2702 }; | 2606 }; |
| 2703 | 2607 |
| 2704 | 2608 |
| 2705 class FunctionType : public DartType { | 2609 class FunctionType : public DartType { |
| 2706 public: | 2610 public: |
| 2707 static FunctionType* ReadFrom(Reader* reader); | 2611 static FunctionType* ReadFrom(Reader* reader); |
| 2708 static FunctionType* ReadFrom(Reader* reader, bool _without_type_arguments_); | 2612 static FunctionType* ReadFrom(Reader* reader, bool _without_type_arguments_); |
| 2709 void WriteTo(Writer* writer); | |
| 2710 | 2613 |
| 2711 virtual ~FunctionType(); | 2614 virtual ~FunctionType(); |
| 2712 | 2615 |
| 2713 DEFINE_CASTING_OPERATIONS(FunctionType); | 2616 DEFINE_CASTING_OPERATIONS(FunctionType); |
| 2714 | 2617 |
| 2715 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); | 2618 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); |
| 2716 virtual void VisitChildren(Visitor* visitor); | 2619 virtual void VisitChildren(Visitor* visitor); |
| 2717 | 2620 |
| 2718 TypeParameterList& type_parameters() { return type_parameters_; } | 2621 TypeParameterList& type_parameters() { return type_parameters_; } |
| 2719 int required_parameter_count() { return required_parameter_count_; } | 2622 int required_parameter_count() { return required_parameter_count_; } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2732 List<Tuple<String, DartType> > named_parameters_; | 2635 List<Tuple<String, DartType> > named_parameters_; |
| 2733 Child<DartType> return_type_; | 2636 Child<DartType> return_type_; |
| 2734 | 2637 |
| 2735 DISALLOW_COPY_AND_ASSIGN(FunctionType); | 2638 DISALLOW_COPY_AND_ASSIGN(FunctionType); |
| 2736 }; | 2639 }; |
| 2737 | 2640 |
| 2738 | 2641 |
| 2739 class TypeParameterType : public DartType { | 2642 class TypeParameterType : public DartType { |
| 2740 public: | 2643 public: |
| 2741 static TypeParameterType* ReadFrom(Reader* reader); | 2644 static TypeParameterType* ReadFrom(Reader* reader); |
| 2742 void WriteTo(Writer* writer); | |
| 2743 | 2645 |
| 2744 virtual ~TypeParameterType(); | 2646 virtual ~TypeParameterType(); |
| 2745 | 2647 |
| 2746 DEFINE_CASTING_OPERATIONS(TypeParameterType); | 2648 DEFINE_CASTING_OPERATIONS(TypeParameterType); |
| 2747 | 2649 |
| 2748 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); | 2650 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); |
| 2749 virtual void VisitChildren(Visitor* visitor); | 2651 virtual void VisitChildren(Visitor* visitor); |
| 2750 | 2652 |
| 2751 TypeParameter* parameter() { return parameter_; } | 2653 TypeParameter* parameter() { return parameter_; } |
| 2752 | 2654 |
| 2753 private: | 2655 private: |
| 2754 TypeParameterType() {} | 2656 TypeParameterType() {} |
| 2755 | 2657 |
| 2756 Ref<TypeParameter> parameter_; | 2658 Ref<TypeParameter> parameter_; |
| 2757 | 2659 |
| 2758 DISALLOW_COPY_AND_ASSIGN(TypeParameterType); | 2660 DISALLOW_COPY_AND_ASSIGN(TypeParameterType); |
| 2759 }; | 2661 }; |
| 2760 | 2662 |
| 2761 | 2663 |
| 2762 class TypeParameter : public TreeNode { | 2664 class TypeParameter : public TreeNode { |
| 2763 public: | 2665 public: |
| 2764 TypeParameter* ReadFrom(Reader* reader); | 2666 TypeParameter* ReadFrom(Reader* reader); |
| 2765 void WriteTo(Writer* writer); | |
| 2766 | 2667 |
| 2767 virtual ~TypeParameter(); | 2668 virtual ~TypeParameter(); |
| 2768 | 2669 |
| 2769 DEFINE_CASTING_OPERATIONS(TypeParameter); | 2670 DEFINE_CASTING_OPERATIONS(TypeParameter); |
| 2770 | 2671 |
| 2771 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 2672 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 2772 virtual void VisitChildren(Visitor* visitor); | 2673 virtual void VisitChildren(Visitor* visitor); |
| 2773 | 2674 |
| 2774 String* name() { return name_; } | 2675 String* name() { return name_; } |
| 2775 DartType* bound() { return bound_; } | 2676 DartType* bound() { return bound_; } |
| 2776 | 2677 |
| 2777 private: | 2678 private: |
| 2778 TypeParameter() {} | 2679 TypeParameter() {} |
| 2779 | 2680 |
| 2780 template <typename T> | 2681 template <typename T> |
| 2781 friend class List; | 2682 friend class List; |
| 2782 friend class TypeParameterList; | 2683 friend class TypeParameterList; |
| 2783 | 2684 |
| 2784 Ref<String> name_; | 2685 Ref<String> name_; |
| 2785 Child<DartType> bound_; | 2686 Child<DartType> bound_; |
| 2786 | 2687 |
| 2787 DISALLOW_COPY_AND_ASSIGN(TypeParameter); | 2688 DISALLOW_COPY_AND_ASSIGN(TypeParameter); |
| 2788 }; | 2689 }; |
| 2789 | 2690 |
| 2790 | 2691 |
| 2791 class Program : public TreeNode { | 2692 class Program : public TreeNode { |
| 2792 public: | 2693 public: |
| 2793 static Program* ReadFrom(Reader* reader); | 2694 static Program* ReadFrom(Reader* reader); |
| 2794 void WriteTo(Writer* writer); | |
| 2795 | 2695 |
| 2796 virtual ~Program(); | 2696 virtual ~Program(); |
| 2797 | 2697 |
| 2798 DEFINE_CASTING_OPERATIONS(Program); | 2698 DEFINE_CASTING_OPERATIONS(Program); |
| 2799 | 2699 |
| 2800 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 2700 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
| 2801 virtual void VisitChildren(Visitor* visitor); | 2701 virtual void VisitChildren(Visitor* visitor); |
| 2802 | 2702 |
| 2803 StringTable& string_table() { return string_table_; } | 2703 StringTable& string_table() { return string_table_; } |
| 2804 StringTable& source_uri_table() { return source_uri_table_; } | 2704 StringTable& source_uri_table() { return source_uri_table_; } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2815 StringTable source_uri_table_; | 2715 StringTable source_uri_table_; |
| 2816 SourceTable source_table_; | 2716 SourceTable source_table_; |
| 2817 | 2717 |
| 2818 DISALLOW_COPY_AND_ASSIGN(Program); | 2718 DISALLOW_COPY_AND_ASSIGN(Program); |
| 2819 }; | 2719 }; |
| 2820 | 2720 |
| 2821 | 2721 |
| 2822 class Reference : public AllStatic { | 2722 class Reference : public AllStatic { |
| 2823 public: | 2723 public: |
| 2824 static Member* ReadMemberFrom(Reader* reader, bool allow_null = false); | 2724 static Member* ReadMemberFrom(Reader* reader, bool allow_null = false); |
| 2825 static void WriteMemberTo(Writer* writer, | |
| 2826 Member* member, | |
| 2827 bool allow_null = false); | |
| 2828 | 2725 |
| 2829 static Class* ReadClassFrom(Reader* reader, bool allow_null = false); | 2726 static Class* ReadClassFrom(Reader* reader, bool allow_null = false); |
| 2830 static void WriteClassTo(Writer* writer, | |
| 2831 Class* klass, | |
| 2832 bool allow_null = false); | |
| 2833 | 2727 |
| 2834 static String* ReadStringFrom(Reader* reader); | 2728 static String* ReadStringFrom(Reader* reader); |
| 2835 static void WriteStringTo(Writer* writer, String* string); // NOLINT | |
| 2836 }; | 2729 }; |
| 2837 | 2730 |
| 2838 | 2731 |
| 2839 class ExpressionVisitor { | 2732 class ExpressionVisitor { |
| 2840 public: | 2733 public: |
| 2841 virtual ~ExpressionVisitor() {} | 2734 virtual ~ExpressionVisitor() {} |
| 2842 | 2735 |
| 2843 virtual void VisitDefaultExpression(Expression* node) = 0; | 2736 virtual void VisitDefaultExpression(Expression* node) = 0; |
| 2844 virtual void VisitDefaultBasicLiteral(BasicLiteral* node) { | 2737 virtual void VisitDefaultBasicLiteral(BasicLiteral* node) { |
| 2845 VisitDefaultExpression(node); | 2738 VisitDefaultExpression(node); |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3243 } | 3136 } |
| 3244 | 3137 |
| 3245 ParsedFunction* ParseStaticFieldInitializer(Zone* zone, | 3138 ParsedFunction* ParseStaticFieldInitializer(Zone* zone, |
| 3246 const dart::Field& field); | 3139 const dart::Field& field); |
| 3247 | 3140 |
| 3248 } // namespace kernel | 3141 } // namespace kernel |
| 3249 | 3142 |
| 3250 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3143 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
| 3251 intptr_t buffer_length); | 3144 intptr_t buffer_length); |
| 3252 | 3145 |
| 3253 class ByteWriter { | |
| 3254 public: | |
| 3255 virtual ~ByteWriter(); | |
| 3256 | |
| 3257 virtual void WriteByte(uint8_t byte) = 0; | |
| 3258 | |
| 3259 virtual void WriteBytes(uint8_t* buffer, int count) = 0; | |
| 3260 }; | |
| 3261 | |
| 3262 | |
| 3263 void WritePrecompiledKernel(ByteWriter* out, kernel::Program* program); | |
| 3264 | 3146 |
| 3265 | 3147 |
| 3266 } // namespace dart | 3148 } // namespace dart |
| 3267 | 3149 |
| 3268 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3150 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 3269 #endif // RUNTIME_VM_KERNEL_H_ | 3151 #endif // RUNTIME_VM_KERNEL_H_ |
| OLD | NEW |