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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 // The number of entries in the table. | 286 // The number of entries in the table. |
287 intptr_t size_; | 287 intptr_t size_; |
288 | 288 |
289 // An array of sources. | 289 // An array of sources. |
290 Source* sources_; | 290 Source* sources_; |
291 | 291 |
292 DISALLOW_COPY_AND_ASSIGN(SourceTable); | 292 DISALLOW_COPY_AND_ASSIGN(SourceTable); |
293 }; | 293 }; |
294 | 294 |
| 295 |
| 296 class StringIndex { |
| 297 public: |
| 298 StringIndex() : value_(-1) {} |
| 299 explicit StringIndex(int value) : value_(value) {} |
| 300 |
| 301 operator int() const { return value_; } |
| 302 |
| 303 private: |
| 304 int value_; |
| 305 }; |
| 306 |
| 307 |
| 308 class NameIndex { |
| 309 public: |
| 310 NameIndex() : value_(-1) {} |
| 311 explicit NameIndex(int value) : value_(value) {} |
| 312 |
| 313 operator int() const { return value_; } |
| 314 |
| 315 private: |
| 316 int value_; |
| 317 }; |
| 318 |
| 319 |
295 // Forward declare all classes. | 320 // Forward declare all classes. |
296 #define DO(name) class name; | 321 #define DO(name) class name; |
297 KERNEL_ALL_NODES_DO(DO) | 322 KERNEL_ALL_NODES_DO(DO) |
298 KERNEL_VISITORS_DO(DO) | 323 KERNEL_VISITORS_DO(DO) |
299 #undef DO | 324 #undef DO |
300 | 325 |
301 | 326 |
302 #define DEFINE_CASTING_OPERATIONS(klass) \ | 327 #define DEFINE_CASTING_OPERATIONS(klass) \ |
303 virtual bool Is##klass() { return true; } \ | 328 virtual bool Is##klass() { return true; } \ |
304 \ | 329 \ |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 396 |
372 private: | 397 private: |
373 DISALLOW_COPY_AND_ASSIGN(TreeNode); | 398 DISALLOW_COPY_AND_ASSIGN(TreeNode); |
374 }; | 399 }; |
375 | 400 |
376 | 401 |
377 class LinkedNode : public TreeNode { | 402 class LinkedNode : public TreeNode { |
378 public: | 403 public: |
379 virtual ~LinkedNode(); | 404 virtual ~LinkedNode(); |
380 | 405 |
381 intptr_t canonical_name() { return canonical_name_; } | 406 NameIndex canonical_name() { return canonical_name_; } |
382 | 407 |
383 protected: | 408 protected: |
384 LinkedNode() {} | 409 LinkedNode() {} |
385 | 410 |
386 intptr_t canonical_name_; | 411 NameIndex canonical_name_; |
387 | 412 |
388 private: | 413 private: |
389 DISALLOW_COPY_AND_ASSIGN(LinkedNode); | 414 DISALLOW_COPY_AND_ASSIGN(LinkedNode); |
390 }; | 415 }; |
391 | 416 |
392 | 417 |
393 class Library : public LinkedNode { | 418 class Library : public LinkedNode { |
394 public: | 419 public: |
395 Library* ReadFrom(Reader* reader); | 420 Library* ReadFrom(Reader* reader); |
396 | 421 |
397 virtual ~Library(); | 422 virtual ~Library(); |
398 | 423 |
399 DEFINE_CASTING_OPERATIONS(Library); | 424 DEFINE_CASTING_OPERATIONS(Library); |
400 | 425 |
401 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 426 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
402 virtual void VisitChildren(Visitor* visitor); | 427 virtual void VisitChildren(Visitor* visitor); |
403 | 428 |
404 intptr_t import_uri() { return import_uri_index_; } | 429 StringIndex import_uri() { return import_uri_index_; } |
405 intptr_t source_uri_index() { return source_uri_index_; } | 430 intptr_t source_uri_index() { return source_uri_index_; } |
406 intptr_t name() { return name_index_; } | 431 StringIndex name() { return name_index_; } |
407 List<Typedef>& typedefs() { return typedefs_; } | 432 List<Typedef>& typedefs() { return typedefs_; } |
408 List<Class>& classes() { return classes_; } | 433 List<Class>& classes() { return classes_; } |
409 List<Field>& fields() { return fields_; } | 434 List<Field>& fields() { return fields_; } |
410 List<Procedure>& procedures() { return procedures_; } | 435 List<Procedure>& procedures() { return procedures_; } |
411 | 436 |
412 const uint8_t* kernel_data() { return kernel_data_; } | 437 const uint8_t* kernel_data() { return kernel_data_; } |
413 intptr_t kernel_data_size() { return kernel_data_size_; } | 438 intptr_t kernel_data_size() { return kernel_data_size_; } |
414 | 439 |
415 private: | 440 private: |
416 Library() : name_index_(-1), kernel_data_(NULL), kernel_data_size_(-1) {} | 441 Library() : kernel_data_(NULL), kernel_data_size_(-1) {} |
417 | 442 |
418 template <typename T> | 443 template <typename T> |
419 friend class List; | 444 friend class List; |
420 | 445 |
421 intptr_t name_index_; | 446 StringIndex name_index_; |
422 intptr_t import_uri_index_; | 447 StringIndex import_uri_index_; |
423 intptr_t source_uri_index_; | 448 intptr_t source_uri_index_; |
424 List<Typedef> typedefs_; | 449 List<Typedef> typedefs_; |
425 List<Class> classes_; | 450 List<Class> classes_; |
426 List<Field> fields_; | 451 List<Field> fields_; |
427 List<Procedure> procedures_; | 452 List<Procedure> procedures_; |
428 const uint8_t* kernel_data_; | 453 const uint8_t* kernel_data_; |
429 intptr_t kernel_data_size_; | 454 intptr_t kernel_data_size_; |
430 | 455 |
431 DISALLOW_COPY_AND_ASSIGN(Library); | 456 DISALLOW_COPY_AND_ASSIGN(Library); |
432 }; | 457 }; |
433 | 458 |
434 | 459 |
435 class Typedef : public LinkedNode { | 460 class Typedef : public LinkedNode { |
436 public: | 461 public: |
437 Typedef* ReadFrom(Reader* reader); | 462 Typedef* ReadFrom(Reader* reader); |
438 | 463 |
439 virtual ~Typedef(); | 464 virtual ~Typedef(); |
440 | 465 |
441 DEFINE_CASTING_OPERATIONS(Typedef); | 466 DEFINE_CASTING_OPERATIONS(Typedef); |
442 | 467 |
443 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 468 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
444 virtual void VisitChildren(Visitor* visitor); | 469 virtual void VisitChildren(Visitor* visitor); |
445 | 470 |
446 Library* parent() { return parent_; } | 471 Library* parent() { return parent_; } |
447 intptr_t name() { return name_index_; } | 472 StringIndex name() { return name_index_; } |
448 intptr_t source_uri_index() { return source_uri_index_; } | 473 intptr_t source_uri_index() { return source_uri_index_; } |
449 TokenPosition position() { return position_; } | 474 TokenPosition position() { return position_; } |
450 TypeParameterList& type_parameters() { return type_parameters_; } | 475 TypeParameterList& type_parameters() { return type_parameters_; } |
451 DartType* type() { return type_; } | 476 DartType* type() { return type_; } |
452 | 477 |
453 protected: | 478 protected: |
454 Typedef() : position_(TokenPosition::kNoSource) {} | 479 Typedef() : position_(TokenPosition::kNoSource) {} |
455 | 480 |
456 private: | 481 private: |
457 template <typename T> | 482 template <typename T> |
458 friend class List; | 483 friend class List; |
459 | 484 |
| 485 StringIndex name_index_; |
460 Ref<Library> parent_; | 486 Ref<Library> parent_; |
461 intptr_t name_index_; | |
462 intptr_t source_uri_index_; | 487 intptr_t source_uri_index_; |
463 TokenPosition position_; | 488 TokenPosition position_; |
464 TypeParameterList type_parameters_; | 489 TypeParameterList type_parameters_; |
465 Child<DartType> type_; | 490 Child<DartType> type_; |
466 }; | 491 }; |
467 | 492 |
468 | 493 |
469 class Class : public LinkedNode { | 494 class Class : public LinkedNode { |
470 public: | 495 public: |
471 Class* ReadFrom(Reader* reader); | 496 Class* ReadFrom(Reader* reader); |
472 | 497 |
473 virtual ~Class(); | 498 virtual ~Class(); |
474 | 499 |
475 DEFINE_CASTING_OPERATIONS(Class); | 500 DEFINE_CASTING_OPERATIONS(Class); |
476 | 501 |
477 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 502 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
478 virtual void AcceptClassVisitor(ClassVisitor* visitor) = 0; | 503 virtual void AcceptClassVisitor(ClassVisitor* visitor) = 0; |
479 | 504 |
480 Library* parent() { return parent_; } | 505 Library* parent() { return parent_; } |
481 intptr_t name() { return name_index_; } | 506 StringIndex name() { return name_index_; } |
482 intptr_t source_uri_index() { return source_uri_index_; } | 507 intptr_t source_uri_index() { return source_uri_index_; } |
483 bool is_abstract() { return is_abstract_; } | 508 bool is_abstract() { return is_abstract_; } |
484 List<Expression>& annotations() { return annotations_; } | 509 List<Expression>& annotations() { return annotations_; } |
485 TokenPosition position() { return position_; } | 510 TokenPosition position() { return position_; } |
486 | 511 |
487 virtual List<TypeParameter>& type_parameters() = 0; | 512 virtual List<TypeParameter>& type_parameters() = 0; |
488 virtual List<InterfaceType>& implemented_classes() = 0; | 513 virtual List<InterfaceType>& implemented_classes() = 0; |
489 virtual List<Field>& fields() = 0; | 514 virtual List<Field>& fields() = 0; |
490 virtual List<Constructor>& constructors() = 0; | 515 virtual List<Constructor>& constructors() = 0; |
491 virtual List<Procedure>& procedures() = 0; | 516 virtual List<Procedure>& procedures() = 0; |
492 | 517 |
493 protected: | 518 protected: |
494 Class() : is_abstract_(false), position_(TokenPosition::kNoSource) {} | 519 Class() : is_abstract_(false), position_(TokenPosition::kNoSource) {} |
495 | 520 |
496 private: | 521 private: |
497 template <typename T> | 522 template <typename T> |
498 friend class List; | 523 friend class List; |
499 | 524 |
| 525 StringIndex name_index_; |
500 Ref<Library> parent_; | 526 Ref<Library> parent_; |
501 intptr_t name_index_; | |
502 intptr_t source_uri_index_; | 527 intptr_t source_uri_index_; |
503 bool is_abstract_; | 528 bool is_abstract_; |
504 List<Expression> annotations_; | 529 List<Expression> annotations_; |
505 TokenPosition position_; | 530 TokenPosition position_; |
506 | 531 |
507 DISALLOW_COPY_AND_ASSIGN(Class); | 532 DISALLOW_COPY_AND_ASSIGN(Class); |
508 }; | 533 }; |
509 | 534 |
510 | 535 |
511 class NormalClass : public Class { | 536 class NormalClass : public Class { |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 public: | 814 public: |
790 static FieldInitializer* ReadFromImpl(Reader* reader); | 815 static FieldInitializer* ReadFromImpl(Reader* reader); |
791 | 816 |
792 virtual ~FieldInitializer(); | 817 virtual ~FieldInitializer(); |
793 | 818 |
794 DEFINE_CASTING_OPERATIONS(FieldInitializer); | 819 DEFINE_CASTING_OPERATIONS(FieldInitializer); |
795 | 820 |
796 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); | 821 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); |
797 virtual void VisitChildren(Visitor* visitor); | 822 virtual void VisitChildren(Visitor* visitor); |
798 | 823 |
799 intptr_t field() { return field_reference_; } | 824 NameIndex field() { return field_reference_; } |
800 Expression* value() { return value_; } | 825 Expression* value() { return value_; } |
801 | 826 |
802 private: | 827 private: |
803 FieldInitializer() {} | 828 FieldInitializer() {} |
804 | 829 |
805 intptr_t field_reference_; // Field canonical name. | 830 NameIndex field_reference_; // Field canonical name. |
806 Child<Expression> value_; | 831 Child<Expression> value_; |
807 | 832 |
808 DISALLOW_COPY_AND_ASSIGN(FieldInitializer); | 833 DISALLOW_COPY_AND_ASSIGN(FieldInitializer); |
809 }; | 834 }; |
810 | 835 |
811 | 836 |
812 class SuperInitializer : public Initializer { | 837 class SuperInitializer : public Initializer { |
813 public: | 838 public: |
814 static SuperInitializer* ReadFromImpl(Reader* reader); | 839 static SuperInitializer* ReadFromImpl(Reader* reader); |
815 | 840 |
816 virtual ~SuperInitializer(); | 841 virtual ~SuperInitializer(); |
817 | 842 |
818 DEFINE_CASTING_OPERATIONS(SuperInitializer); | 843 DEFINE_CASTING_OPERATIONS(SuperInitializer); |
819 | 844 |
820 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); | 845 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); |
821 virtual void VisitChildren(Visitor* visitor); | 846 virtual void VisitChildren(Visitor* visitor); |
822 | 847 |
823 intptr_t target() { return target_reference_; } | 848 NameIndex target() { return target_reference_; } |
824 Arguments* arguments() { return arguments_; } | 849 Arguments* arguments() { return arguments_; } |
825 | 850 |
826 private: | 851 private: |
827 SuperInitializer() {} | 852 SuperInitializer() {} |
828 | 853 |
829 intptr_t target_reference_; // Constructor canonical name. | 854 NameIndex target_reference_; // Constructor canonical name. |
830 Child<Arguments> arguments_; | 855 Child<Arguments> arguments_; |
831 | 856 |
832 DISALLOW_COPY_AND_ASSIGN(SuperInitializer); | 857 DISALLOW_COPY_AND_ASSIGN(SuperInitializer); |
833 }; | 858 }; |
834 | 859 |
835 | 860 |
836 class RedirectingInitializer : public Initializer { | 861 class RedirectingInitializer : public Initializer { |
837 public: | 862 public: |
838 static RedirectingInitializer* ReadFromImpl(Reader* reader); | 863 static RedirectingInitializer* ReadFromImpl(Reader* reader); |
839 | 864 |
840 virtual ~RedirectingInitializer(); | 865 virtual ~RedirectingInitializer(); |
841 | 866 |
842 DEFINE_CASTING_OPERATIONS(RedirectingInitializer); | 867 DEFINE_CASTING_OPERATIONS(RedirectingInitializer); |
843 | 868 |
844 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); | 869 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); |
845 virtual void VisitChildren(Visitor* visitor); | 870 virtual void VisitChildren(Visitor* visitor); |
846 | 871 |
847 intptr_t target() { return target_reference_; } | 872 NameIndex target() { return target_reference_; } |
848 Arguments* arguments() { return arguments_; } | 873 Arguments* arguments() { return arguments_; } |
849 | 874 |
850 private: | 875 private: |
851 RedirectingInitializer() {} | 876 RedirectingInitializer() {} |
852 | 877 |
853 intptr_t target_reference_; // Constructor canonical name. | 878 NameIndex target_reference_; // Constructor canonical name. |
854 Child<Arguments> arguments_; | 879 Child<Arguments> arguments_; |
855 | 880 |
856 DISALLOW_COPY_AND_ASSIGN(RedirectingInitializer); | 881 DISALLOW_COPY_AND_ASSIGN(RedirectingInitializer); |
857 }; | 882 }; |
858 | 883 |
859 | 884 |
860 class LocalInitializer : public Initializer { | 885 class LocalInitializer : public Initializer { |
861 public: | 886 public: |
862 static LocalInitializer* ReadFromImpl(Reader* reader); | 887 static LocalInitializer* ReadFromImpl(Reader* reader); |
863 | 888 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 | 1057 |
1033 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1058 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1034 virtual void VisitChildren(Visitor* visitor); | 1059 virtual void VisitChildren(Visitor* visitor); |
1035 | 1060 |
1036 Expression* receiver() { return receiver_; } | 1061 Expression* receiver() { return receiver_; } |
1037 Name* name() { return name_; } | 1062 Name* name() { return name_; } |
1038 | 1063 |
1039 private: | 1064 private: |
1040 PropertyGet() {} | 1065 PropertyGet() {} |
1041 | 1066 |
| 1067 NameIndex interface_target_reference_; |
1042 Child<Expression> receiver_; | 1068 Child<Expression> receiver_; |
1043 Child<Name> name_; | 1069 Child<Name> name_; |
1044 intptr_t interface_target_reference_; | |
1045 | 1070 |
1046 DISALLOW_COPY_AND_ASSIGN(PropertyGet); | 1071 DISALLOW_COPY_AND_ASSIGN(PropertyGet); |
1047 }; | 1072 }; |
1048 | 1073 |
1049 | 1074 |
1050 class PropertySet : public Expression { | 1075 class PropertySet : public Expression { |
1051 public: | 1076 public: |
1052 static PropertySet* ReadFrom(Reader* reader); | 1077 static PropertySet* ReadFrom(Reader* reader); |
1053 | 1078 |
1054 virtual ~PropertySet(); | 1079 virtual ~PropertySet(); |
1055 | 1080 |
1056 DEFINE_CASTING_OPERATIONS(PropertySet); | 1081 DEFINE_CASTING_OPERATIONS(PropertySet); |
1057 | 1082 |
1058 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1083 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1059 virtual void VisitChildren(Visitor* visitor); | 1084 virtual void VisitChildren(Visitor* visitor); |
1060 | 1085 |
1061 Expression* receiver() { return receiver_; } | 1086 Expression* receiver() { return receiver_; } |
1062 Name* name() { return name_; } | 1087 Name* name() { return name_; } |
1063 Expression* value() { return value_; } | 1088 Expression* value() { return value_; } |
1064 | 1089 |
1065 private: | 1090 private: |
1066 PropertySet() {} | 1091 PropertySet() {} |
1067 | 1092 |
| 1093 NameIndex interface_target_reference_; |
1068 Child<Expression> receiver_; | 1094 Child<Expression> receiver_; |
1069 Child<Name> name_; | 1095 Child<Name> name_; |
1070 Child<Expression> value_; | 1096 Child<Expression> value_; |
1071 intptr_t interface_target_reference_; | |
1072 | 1097 |
1073 DISALLOW_COPY_AND_ASSIGN(PropertySet); | 1098 DISALLOW_COPY_AND_ASSIGN(PropertySet); |
1074 }; | 1099 }; |
1075 | 1100 |
1076 | 1101 |
1077 class DirectPropertyGet : public Expression { | 1102 class DirectPropertyGet : public Expression { |
1078 public: | 1103 public: |
1079 static DirectPropertyGet* ReadFrom(Reader* reader); | 1104 static DirectPropertyGet* ReadFrom(Reader* reader); |
1080 | 1105 |
1081 virtual ~DirectPropertyGet(); | 1106 virtual ~DirectPropertyGet(); |
1082 | 1107 |
1083 DEFINE_CASTING_OPERATIONS(DirectPropertyGet); | 1108 DEFINE_CASTING_OPERATIONS(DirectPropertyGet); |
1084 | 1109 |
1085 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1110 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1086 virtual void VisitChildren(Visitor* visitor); | 1111 virtual void VisitChildren(Visitor* visitor); |
1087 | 1112 |
1088 Expression* receiver() { return receiver_; } | 1113 Expression* receiver() { return receiver_; } |
1089 intptr_t target() { return target_reference_; } | 1114 NameIndex target() { return target_reference_; } |
1090 | 1115 |
1091 private: | 1116 private: |
1092 DirectPropertyGet() {} | 1117 DirectPropertyGet() {} |
1093 | 1118 |
| 1119 NameIndex target_reference_; // Member canonical name. |
1094 Child<Expression> receiver_; | 1120 Child<Expression> receiver_; |
1095 intptr_t target_reference_; // Member canonical name. | |
1096 | 1121 |
1097 DISALLOW_COPY_AND_ASSIGN(DirectPropertyGet); | 1122 DISALLOW_COPY_AND_ASSIGN(DirectPropertyGet); |
1098 }; | 1123 }; |
1099 | 1124 |
1100 | 1125 |
1101 class DirectPropertySet : public Expression { | 1126 class DirectPropertySet : public Expression { |
1102 public: | 1127 public: |
1103 static DirectPropertySet* ReadFrom(Reader* reader); | 1128 static DirectPropertySet* ReadFrom(Reader* reader); |
1104 | 1129 |
1105 virtual ~DirectPropertySet(); | 1130 virtual ~DirectPropertySet(); |
1106 | 1131 |
1107 DEFINE_CASTING_OPERATIONS(DirectPropertySet); | 1132 DEFINE_CASTING_OPERATIONS(DirectPropertySet); |
1108 | 1133 |
1109 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1134 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1110 virtual void VisitChildren(Visitor* visitor); | 1135 virtual void VisitChildren(Visitor* visitor); |
1111 | 1136 |
| 1137 NameIndex target() { return target_reference_; } |
1112 Expression* receiver() { return receiver_; } | 1138 Expression* receiver() { return receiver_; } |
1113 intptr_t target() { return target_reference_; } | |
1114 Expression* value() { return value_; } | 1139 Expression* value() { return value_; } |
1115 | 1140 |
1116 private: | 1141 private: |
1117 DirectPropertySet() {} | 1142 DirectPropertySet() {} |
1118 | 1143 |
| 1144 NameIndex target_reference_; // Member canonical name. |
1119 Child<Expression> receiver_; | 1145 Child<Expression> receiver_; |
1120 intptr_t target_reference_; // Member canonical name. | |
1121 Child<Expression> value_; | 1146 Child<Expression> value_; |
1122 | 1147 |
1123 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet); | 1148 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet); |
1124 }; | 1149 }; |
1125 | 1150 |
1126 | 1151 |
1127 class StaticGet : public Expression { | 1152 class StaticGet : public Expression { |
1128 public: | 1153 public: |
1129 explicit StaticGet(intptr_t target) : target_reference_(target) {} | 1154 explicit StaticGet(NameIndex target) : target_reference_(target) {} |
1130 | 1155 |
1131 static StaticGet* ReadFrom(Reader* reader); | 1156 static StaticGet* ReadFrom(Reader* reader); |
1132 | 1157 |
1133 virtual ~StaticGet(); | 1158 virtual ~StaticGet(); |
1134 | 1159 |
1135 DEFINE_CASTING_OPERATIONS(StaticGet); | 1160 DEFINE_CASTING_OPERATIONS(StaticGet); |
1136 | 1161 |
1137 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1162 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1138 virtual void VisitChildren(Visitor* visitor); | 1163 virtual void VisitChildren(Visitor* visitor); |
1139 | 1164 |
1140 intptr_t target() { return target_reference_; } | 1165 NameIndex target() { return target_reference_; } |
1141 | 1166 |
1142 private: | 1167 private: |
1143 StaticGet() {} | 1168 StaticGet() {} |
1144 | 1169 |
1145 intptr_t target_reference_; // Member canonical name. | 1170 NameIndex target_reference_; // Member canonical name. |
1146 | 1171 |
1147 DISALLOW_COPY_AND_ASSIGN(StaticGet); | 1172 DISALLOW_COPY_AND_ASSIGN(StaticGet); |
1148 }; | 1173 }; |
1149 | 1174 |
1150 | 1175 |
1151 class StaticSet : public Expression { | 1176 class StaticSet : public Expression { |
1152 public: | 1177 public: |
1153 static StaticSet* ReadFrom(Reader* reader); | 1178 static StaticSet* ReadFrom(Reader* reader); |
1154 | 1179 |
1155 virtual ~StaticSet(); | 1180 virtual ~StaticSet(); |
1156 | 1181 |
1157 DEFINE_CASTING_OPERATIONS(StaticSet); | 1182 DEFINE_CASTING_OPERATIONS(StaticSet); |
1158 | 1183 |
1159 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1184 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1160 virtual void VisitChildren(Visitor* visitor); | 1185 virtual void VisitChildren(Visitor* visitor); |
1161 | 1186 |
1162 intptr_t target() { return target_reference_; } | 1187 NameIndex target() { return target_reference_; } |
1163 Expression* expression() { return expression_; } | 1188 Expression* expression() { return expression_; } |
1164 | 1189 |
1165 private: | 1190 private: |
1166 StaticSet() {} | 1191 StaticSet() {} |
1167 | 1192 |
1168 intptr_t target_reference_; // Member canonical name. | 1193 NameIndex target_reference_; // Member canonical name. |
1169 Child<Expression> expression_; | 1194 Child<Expression> expression_; |
1170 | 1195 |
1171 DISALLOW_COPY_AND_ASSIGN(StaticSet); | 1196 DISALLOW_COPY_AND_ASSIGN(StaticSet); |
1172 }; | 1197 }; |
1173 | 1198 |
1174 | 1199 |
1175 class Arguments : public TreeNode { | 1200 class Arguments : public TreeNode { |
1176 public: | 1201 public: |
1177 static Arguments* ReadFrom(Reader* reader); | 1202 static Arguments* ReadFrom(Reader* reader); |
1178 | 1203 |
(...skipping 18 matching lines...) Expand all Loading... |
1197 List<NamedExpression> named_; | 1222 List<NamedExpression> named_; |
1198 | 1223 |
1199 DISALLOW_COPY_AND_ASSIGN(Arguments); | 1224 DISALLOW_COPY_AND_ASSIGN(Arguments); |
1200 }; | 1225 }; |
1201 | 1226 |
1202 | 1227 |
1203 class NamedExpression : public TreeNode { | 1228 class NamedExpression : public TreeNode { |
1204 public: | 1229 public: |
1205 static NamedExpression* ReadFrom(Reader* reader); | 1230 static NamedExpression* ReadFrom(Reader* reader); |
1206 | 1231 |
1207 NamedExpression(intptr_t name_index, Expression* expr) | 1232 NamedExpression(StringIndex name_index, Expression* expr) |
1208 : name_index_(name_index), expression_(expr) {} | 1233 : name_index_(name_index), expression_(expr) {} |
1209 virtual ~NamedExpression(); | 1234 virtual ~NamedExpression(); |
1210 | 1235 |
1211 DEFINE_CASTING_OPERATIONS(NamedExpression); | 1236 DEFINE_CASTING_OPERATIONS(NamedExpression); |
1212 | 1237 |
1213 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 1238 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
1214 virtual void VisitChildren(Visitor* visitor); | 1239 virtual void VisitChildren(Visitor* visitor); |
1215 | 1240 |
1216 intptr_t name() { return name_index_; } | 1241 StringIndex name() { return name_index_; } |
1217 Expression* expression() { return expression_; } | 1242 Expression* expression() { return expression_; } |
1218 | 1243 |
1219 private: | 1244 private: |
1220 NamedExpression() {} | 1245 NamedExpression() {} |
1221 | 1246 |
1222 intptr_t name_index_; | 1247 StringIndex name_index_; |
1223 Child<Expression> expression_; | 1248 Child<Expression> expression_; |
1224 | 1249 |
1225 DISALLOW_COPY_AND_ASSIGN(NamedExpression); | 1250 DISALLOW_COPY_AND_ASSIGN(NamedExpression); |
1226 }; | 1251 }; |
1227 | 1252 |
1228 | 1253 |
1229 class MethodInvocation : public Expression { | 1254 class MethodInvocation : public Expression { |
1230 public: | 1255 public: |
1231 static MethodInvocation* ReadFrom(Reader* reader); | 1256 static MethodInvocation* ReadFrom(Reader* reader); |
1232 | 1257 |
1233 virtual ~MethodInvocation(); | 1258 virtual ~MethodInvocation(); |
1234 | 1259 |
1235 DEFINE_CASTING_OPERATIONS(MethodInvocation); | 1260 DEFINE_CASTING_OPERATIONS(MethodInvocation); |
1236 | 1261 |
1237 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1262 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1238 virtual void VisitChildren(Visitor* visitor); | 1263 virtual void VisitChildren(Visitor* visitor); |
1239 | 1264 |
1240 Expression* receiver() { return receiver_; } | 1265 Expression* receiver() { return receiver_; } |
1241 Name* name() { return name_; } | 1266 Name* name() { return name_; } |
1242 Arguments* arguments() { return arguments_; } | 1267 Arguments* arguments() { return arguments_; } |
1243 | 1268 |
1244 private: | 1269 private: |
1245 MethodInvocation() {} | 1270 MethodInvocation() {} |
1246 | 1271 |
| 1272 NameIndex interface_target_reference_; |
1247 Child<Expression> receiver_; | 1273 Child<Expression> receiver_; |
1248 Child<Name> name_; | 1274 Child<Name> name_; |
1249 Child<Arguments> arguments_; | 1275 Child<Arguments> arguments_; |
1250 intptr_t interface_target_reference_; | |
1251 | 1276 |
1252 DISALLOW_COPY_AND_ASSIGN(MethodInvocation); | 1277 DISALLOW_COPY_AND_ASSIGN(MethodInvocation); |
1253 }; | 1278 }; |
1254 | 1279 |
1255 | 1280 |
1256 class DirectMethodInvocation : public Expression { | 1281 class DirectMethodInvocation : public Expression { |
1257 public: | 1282 public: |
1258 static DirectMethodInvocation* ReadFrom(Reader* reader); | 1283 static DirectMethodInvocation* ReadFrom(Reader* reader); |
1259 | 1284 |
1260 virtual ~DirectMethodInvocation(); | 1285 virtual ~DirectMethodInvocation(); |
1261 | 1286 |
1262 DEFINE_CASTING_OPERATIONS(DirectMethodInvocation); | 1287 DEFINE_CASTING_OPERATIONS(DirectMethodInvocation); |
1263 | 1288 |
1264 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1289 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1265 virtual void VisitChildren(Visitor* visitor); | 1290 virtual void VisitChildren(Visitor* visitor); |
1266 | 1291 |
1267 Expression* receiver() { return receiver_; } | 1292 Expression* receiver() { return receiver_; } |
1268 intptr_t target() { return target_reference_; } | 1293 NameIndex target() { return target_reference_; } |
1269 Arguments* arguments() { return arguments_; } | 1294 Arguments* arguments() { return arguments_; } |
1270 | 1295 |
1271 private: | 1296 private: |
1272 DirectMethodInvocation() {} | 1297 DirectMethodInvocation() {} |
1273 | 1298 |
| 1299 NameIndex target_reference_; // Procedure canonical name. |
1274 Child<Expression> receiver_; | 1300 Child<Expression> receiver_; |
1275 intptr_t target_reference_; // Procedure canonical name. | |
1276 Child<Arguments> arguments_; | 1301 Child<Arguments> arguments_; |
1277 | 1302 |
1278 DISALLOW_COPY_AND_ASSIGN(DirectMethodInvocation); | 1303 DISALLOW_COPY_AND_ASSIGN(DirectMethodInvocation); |
1279 }; | 1304 }; |
1280 | 1305 |
1281 | 1306 |
1282 class StaticInvocation : public Expression { | 1307 class StaticInvocation : public Expression { |
1283 public: | 1308 public: |
1284 static StaticInvocation* ReadFrom(Reader* reader, bool is_const); | 1309 static StaticInvocation* ReadFrom(Reader* reader, bool is_const); |
1285 ~StaticInvocation(); | 1310 ~StaticInvocation(); |
1286 | 1311 |
1287 DEFINE_CASTING_OPERATIONS(StaticInvocation); | 1312 DEFINE_CASTING_OPERATIONS(StaticInvocation); |
1288 | 1313 |
1289 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1314 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1290 virtual void VisitChildren(Visitor* visitor); | 1315 virtual void VisitChildren(Visitor* visitor); |
1291 | 1316 |
1292 intptr_t procedure() { return procedure_reference_; } | 1317 NameIndex procedure() { return procedure_reference_; } |
1293 Arguments* arguments() { return arguments_; } | 1318 Arguments* arguments() { return arguments_; } |
1294 bool is_const() { return is_const_; } | 1319 bool is_const() { return is_const_; } |
1295 | 1320 |
1296 private: | 1321 private: |
1297 StaticInvocation() {} | 1322 StaticInvocation() {} |
1298 | 1323 |
1299 intptr_t procedure_reference_; // Procedure canonical name. | 1324 NameIndex procedure_reference_; // Procedure canonical name. |
| 1325 bool is_const_; |
1300 Child<Arguments> arguments_; | 1326 Child<Arguments> arguments_; |
1301 bool is_const_; | |
1302 | 1327 |
1303 DISALLOW_COPY_AND_ASSIGN(StaticInvocation); | 1328 DISALLOW_COPY_AND_ASSIGN(StaticInvocation); |
1304 }; | 1329 }; |
1305 | 1330 |
1306 | 1331 |
1307 class ConstructorInvocation : public Expression { | 1332 class ConstructorInvocation : public Expression { |
1308 public: | 1333 public: |
1309 static ConstructorInvocation* ReadFrom(Reader* reader, bool is_const); | 1334 static ConstructorInvocation* ReadFrom(Reader* reader, bool is_const); |
1310 | 1335 |
1311 virtual ~ConstructorInvocation(); | 1336 virtual ~ConstructorInvocation(); |
1312 | 1337 |
1313 DEFINE_CASTING_OPERATIONS(ConstructorInvocation); | 1338 DEFINE_CASTING_OPERATIONS(ConstructorInvocation); |
1314 | 1339 |
1315 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1340 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1316 virtual void VisitChildren(Visitor* visitor); | 1341 virtual void VisitChildren(Visitor* visitor); |
1317 | 1342 |
1318 bool is_const() { return is_const_; } | 1343 bool is_const() { return is_const_; } |
1319 intptr_t target() { return target_reference_; } | 1344 NameIndex target() { return target_reference_; } |
1320 Arguments* arguments() { return arguments_; } | 1345 Arguments* arguments() { return arguments_; } |
1321 | 1346 |
1322 private: | 1347 private: |
1323 ConstructorInvocation() {} | 1348 ConstructorInvocation() {} |
1324 | 1349 |
1325 bool is_const_; | 1350 bool is_const_; |
1326 intptr_t target_reference_; // Constructor canonical name. | 1351 NameIndex target_reference_; // Constructor canonical name. |
1327 Child<Arguments> arguments_; | 1352 Child<Arguments> arguments_; |
1328 | 1353 |
1329 DISALLOW_COPY_AND_ASSIGN(ConstructorInvocation); | 1354 DISALLOW_COPY_AND_ASSIGN(ConstructorInvocation); |
1330 }; | 1355 }; |
1331 | 1356 |
1332 | 1357 |
1333 class Not : public Expression { | 1358 class Not : public Expression { |
1334 public: | 1359 public: |
1335 static Not* ReadFrom(Reader* reader); | 1360 static Not* ReadFrom(Reader* reader); |
1336 | 1361 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1485 virtual void VisitChildren(Visitor* visitor); | 1510 virtual void VisitChildren(Visitor* visitor); |
1486 }; | 1511 }; |
1487 | 1512 |
1488 | 1513 |
1489 class StringLiteral : public BasicLiteral { | 1514 class StringLiteral : public BasicLiteral { |
1490 public: | 1515 public: |
1491 static StringLiteral* ReadFrom(Reader* reader); | 1516 static StringLiteral* ReadFrom(Reader* reader); |
1492 | 1517 |
1493 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1518 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1494 | 1519 |
1495 explicit StringLiteral(intptr_t string_index) : value_index_(string_index) {} | 1520 explicit StringLiteral(StringIndex string_index) |
| 1521 : value_index_(string_index) {} |
1496 virtual ~StringLiteral(); | 1522 virtual ~StringLiteral(); |
1497 | 1523 |
1498 DEFINE_CASTING_OPERATIONS(StringLiteral); | 1524 DEFINE_CASTING_OPERATIONS(StringLiteral); |
1499 | 1525 |
1500 intptr_t value() { return value_index_; } | 1526 StringIndex value() { return value_index_; } |
1501 | 1527 |
1502 protected: | 1528 protected: |
1503 StringLiteral() {} | 1529 StringLiteral() {} |
1504 | 1530 |
1505 intptr_t value_index_; | 1531 StringIndex value_index_; |
1506 | 1532 |
1507 private: | 1533 private: |
1508 DISALLOW_COPY_AND_ASSIGN(StringLiteral); | 1534 DISALLOW_COPY_AND_ASSIGN(StringLiteral); |
1509 }; | 1535 }; |
1510 | 1536 |
1511 | 1537 |
1512 class BigintLiteral : public StringLiteral { | 1538 class BigintLiteral : public StringLiteral { |
1513 public: | 1539 public: |
1514 static BigintLiteral* ReadFrom(Reader* reader); | 1540 static BigintLiteral* ReadFrom(Reader* reader); |
1515 | 1541 |
1516 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1542 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1517 | 1543 |
1518 explicit BigintLiteral(intptr_t string_index) : StringLiteral(string_index) {} | 1544 explicit BigintLiteral(StringIndex string_index) |
| 1545 : StringLiteral(string_index) {} |
1519 virtual ~BigintLiteral(); | 1546 virtual ~BigintLiteral(); |
1520 | 1547 |
1521 DEFINE_CASTING_OPERATIONS(BigintLiteral); | 1548 DEFINE_CASTING_OPERATIONS(BigintLiteral); |
1522 | 1549 |
1523 private: | 1550 private: |
1524 BigintLiteral() {} | 1551 BigintLiteral() {} |
1525 | 1552 |
1526 DISALLOW_COPY_AND_ASSIGN(BigintLiteral); | 1553 DISALLOW_COPY_AND_ASSIGN(BigintLiteral); |
1527 }; | 1554 }; |
1528 | 1555 |
(...skipping 23 matching lines...) Expand all Loading... |
1552 class DoubleLiteral : public BasicLiteral { | 1579 class DoubleLiteral : public BasicLiteral { |
1553 public: | 1580 public: |
1554 static DoubleLiteral* ReadFrom(Reader* reader); | 1581 static DoubleLiteral* ReadFrom(Reader* reader); |
1555 | 1582 |
1556 virtual ~DoubleLiteral(); | 1583 virtual ~DoubleLiteral(); |
1557 | 1584 |
1558 DEFINE_CASTING_OPERATIONS(DoubleLiteral); | 1585 DEFINE_CASTING_OPERATIONS(DoubleLiteral); |
1559 | 1586 |
1560 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1587 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1561 | 1588 |
1562 intptr_t value() { return value_index_; } | 1589 StringIndex value() { return value_index_; } |
1563 | 1590 |
1564 private: | 1591 private: |
1565 DoubleLiteral() {} | 1592 DoubleLiteral() {} |
1566 | 1593 |
1567 intptr_t value_index_; | 1594 StringIndex value_index_; |
1568 | 1595 |
1569 DISALLOW_COPY_AND_ASSIGN(DoubleLiteral); | 1596 DISALLOW_COPY_AND_ASSIGN(DoubleLiteral); |
1570 }; | 1597 }; |
1571 | 1598 |
1572 | 1599 |
1573 class BoolLiteral : public BasicLiteral { | 1600 class BoolLiteral : public BasicLiteral { |
1574 public: | 1601 public: |
1575 static BoolLiteral* ReadFrom(Reader* reader, bool value); | 1602 static BoolLiteral* ReadFrom(Reader* reader, bool value); |
1576 | 1603 |
1577 virtual ~BoolLiteral(); | 1604 virtual ~BoolLiteral(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 public: | 1639 public: |
1613 static SymbolLiteral* ReadFrom(Reader* reader); | 1640 static SymbolLiteral* ReadFrom(Reader* reader); |
1614 | 1641 |
1615 virtual ~SymbolLiteral(); | 1642 virtual ~SymbolLiteral(); |
1616 | 1643 |
1617 DEFINE_CASTING_OPERATIONS(SymbolLiteral); | 1644 DEFINE_CASTING_OPERATIONS(SymbolLiteral); |
1618 | 1645 |
1619 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1646 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1620 virtual void VisitChildren(Visitor* visitor); | 1647 virtual void VisitChildren(Visitor* visitor); |
1621 | 1648 |
1622 intptr_t value() { return value_index_; } | 1649 StringIndex value() { return value_index_; } |
1623 | 1650 |
1624 private: | 1651 private: |
1625 SymbolLiteral() {} | 1652 SymbolLiteral() {} |
1626 | 1653 |
1627 intptr_t value_index_; | 1654 StringIndex value_index_; |
1628 | 1655 |
1629 DISALLOW_COPY_AND_ASSIGN(SymbolLiteral); | 1656 DISALLOW_COPY_AND_ASSIGN(SymbolLiteral); |
1630 }; | 1657 }; |
1631 | 1658 |
1632 | 1659 |
1633 class TypeLiteral : public Expression { | 1660 class TypeLiteral : public Expression { |
1634 public: | 1661 public: |
1635 static TypeLiteral* ReadFrom(Reader* reader); | 1662 static TypeLiteral* ReadFrom(Reader* reader); |
1636 | 1663 |
1637 virtual ~TypeLiteral(); | 1664 virtual ~TypeLiteral(); |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1963 public: | 1990 public: |
1964 static ClosureCreation* ReadFrom(Reader* reader); | 1991 static ClosureCreation* ReadFrom(Reader* reader); |
1965 | 1992 |
1966 virtual ~ClosureCreation(); | 1993 virtual ~ClosureCreation(); |
1967 | 1994 |
1968 DEFINE_CASTING_OPERATIONS(ClosureCreation); | 1995 DEFINE_CASTING_OPERATIONS(ClosureCreation); |
1969 | 1996 |
1970 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1997 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1971 virtual void VisitChildren(Visitor* visitor); | 1998 virtual void VisitChildren(Visitor* visitor); |
1972 | 1999 |
1973 intptr_t top_level_function() { return top_level_function_reference_; } | 2000 NameIndex top_level_function() { return top_level_function_reference_; } |
1974 Expression* context_vector() { return context_vector_; } | 2001 Expression* context_vector() { return context_vector_; } |
1975 FunctionType* function_type() { return function_type_; } | 2002 FunctionType* function_type() { return function_type_; } |
1976 | 2003 |
1977 private: | 2004 private: |
1978 ClosureCreation() {} | 2005 ClosureCreation() {} |
1979 | 2006 |
1980 intptr_t top_level_function_reference_; // Procedure canonical name. | 2007 NameIndex top_level_function_reference_; // Procedure canonical name. |
1981 Child<Expression> context_vector_; | 2008 Child<Expression> context_vector_; |
1982 Child<FunctionType> function_type_; | 2009 Child<FunctionType> function_type_; |
1983 | 2010 |
1984 DISALLOW_COPY_AND_ASSIGN(ClosureCreation); | 2011 DISALLOW_COPY_AND_ASSIGN(ClosureCreation); |
1985 }; | 2012 }; |
1986 | 2013 |
1987 | 2014 |
1988 class Statement : public TreeNode { | 2015 class Statement : public TreeNode { |
1989 public: | 2016 public: |
1990 static Statement* ReadFrom(Reader* reader); | 2017 static Statement* ReadFrom(Reader* reader); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2525 virtual ~VariableDeclaration(); | 2552 virtual ~VariableDeclaration(); |
2526 | 2553 |
2527 DEFINE_CASTING_OPERATIONS(VariableDeclaration); | 2554 DEFINE_CASTING_OPERATIONS(VariableDeclaration); |
2528 | 2555 |
2529 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2556 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
2530 virtual void VisitChildren(Visitor* visitor); | 2557 virtual void VisitChildren(Visitor* visitor); |
2531 | 2558 |
2532 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } | 2559 bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } |
2533 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } | 2560 bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } |
2534 | 2561 |
2535 intptr_t name() { return name_index_; } | 2562 StringIndex name() { return name_index_; } |
2536 DartType* type() { return type_; } | 2563 DartType* type() { return type_; } |
2537 Expression* initializer() { return initializer_; } | 2564 Expression* initializer() { return initializer_; } |
2538 TokenPosition equals_position() { return equals_position_; } | 2565 TokenPosition equals_position() { return equals_position_; } |
2539 TokenPosition end_position() { return end_position_; } | 2566 TokenPosition end_position() { return end_position_; } |
2540 void set_end_position(TokenPosition position) { end_position_ = position; } | 2567 void set_end_position(TokenPosition position) { end_position_ = position; } |
2541 | 2568 |
2542 private: | 2569 private: |
2543 VariableDeclaration() | 2570 VariableDeclaration() |
2544 : equals_position_(TokenPosition::kNoSourcePos), | 2571 : equals_position_(TokenPosition::kNoSourcePos), |
2545 end_position_(TokenPosition::kNoSource) {} | 2572 end_position_(TokenPosition::kNoSource) {} |
2546 | 2573 |
2547 template <typename T> | 2574 template <typename T> |
2548 friend class List; | 2575 friend class List; |
2549 | 2576 |
| 2577 StringIndex name_index_; |
2550 word flags_; | 2578 word flags_; |
2551 intptr_t name_index_; | |
2552 Child<DartType> type_; | 2579 Child<DartType> type_; |
2553 Child<Expression> initializer_; | 2580 Child<Expression> initializer_; |
2554 TokenPosition equals_position_; | 2581 TokenPosition equals_position_; |
2555 TokenPosition end_position_; | 2582 TokenPosition end_position_; |
2556 | 2583 |
2557 DISALLOW_COPY_AND_ASSIGN(VariableDeclaration); | 2584 DISALLOW_COPY_AND_ASSIGN(VariableDeclaration); |
2558 }; | 2585 }; |
2559 | 2586 |
2560 | 2587 |
2561 class FunctionDeclaration : public Statement { | 2588 class FunctionDeclaration : public Statement { |
(...skipping 24 matching lines...) Expand all Loading... |
2586 public: | 2613 public: |
2587 static Name* ReadFrom(Reader* reader); | 2614 static Name* ReadFrom(Reader* reader); |
2588 | 2615 |
2589 virtual ~Name(); | 2616 virtual ~Name(); |
2590 | 2617 |
2591 DEFINE_CASTING_OPERATIONS(Name); | 2618 DEFINE_CASTING_OPERATIONS(Name); |
2592 | 2619 |
2593 virtual void AcceptVisitor(Visitor* visitor); | 2620 virtual void AcceptVisitor(Visitor* visitor); |
2594 virtual void VisitChildren(Visitor* visitor); | 2621 virtual void VisitChildren(Visitor* visitor); |
2595 | 2622 |
2596 intptr_t string_index() { return string_index_; } | 2623 StringIndex string_index() { return string_index_; } |
2597 intptr_t library() { return library_reference_; } | 2624 NameIndex library() { return library_reference_; } |
2598 | 2625 |
2599 private: | 2626 private: |
2600 Name(intptr_t string_index, intptr_t library_reference) | 2627 Name(intptr_t string_index, intptr_t library_reference) |
2601 : string_index_(string_index), | 2628 : string_index_(string_index), |
2602 library_reference_(library_reference) {} // NOLINT | 2629 library_reference_(library_reference) {} // NOLINT |
2603 | 2630 |
2604 intptr_t string_index_; | 2631 StringIndex string_index_; |
2605 intptr_t library_reference_; // Library canonical name. | 2632 NameIndex library_reference_; // Library canonical name. |
2606 | 2633 |
2607 DISALLOW_COPY_AND_ASSIGN(Name); | 2634 DISALLOW_COPY_AND_ASSIGN(Name); |
2608 }; | 2635 }; |
2609 | 2636 |
2610 | 2637 |
2611 class DartType : public Node { | 2638 class DartType : public Node { |
2612 public: | 2639 public: |
2613 static DartType* ReadFrom(Reader* reader); | 2640 static DartType* ReadFrom(Reader* reader); |
2614 | 2641 |
2615 virtual ~DartType(); | 2642 virtual ~DartType(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2679 | 2706 |
2680 DISALLOW_COPY_AND_ASSIGN(VoidType); | 2707 DISALLOW_COPY_AND_ASSIGN(VoidType); |
2681 }; | 2708 }; |
2682 | 2709 |
2683 | 2710 |
2684 class InterfaceType : public DartType { | 2711 class InterfaceType : public DartType { |
2685 public: | 2712 public: |
2686 static InterfaceType* ReadFrom(Reader* reader); | 2713 static InterfaceType* ReadFrom(Reader* reader); |
2687 static InterfaceType* ReadFrom(Reader* reader, bool _without_type_arguments_); | 2714 static InterfaceType* ReadFrom(Reader* reader, bool _without_type_arguments_); |
2688 | 2715 |
2689 explicit InterfaceType(intptr_t class_reference) | 2716 explicit InterfaceType(NameIndex class_reference) |
2690 : class_reference_(class_reference) {} | 2717 : class_reference_(class_reference) {} |
2691 virtual ~InterfaceType(); | 2718 virtual ~InterfaceType(); |
2692 | 2719 |
2693 DEFINE_CASTING_OPERATIONS(InterfaceType); | 2720 DEFINE_CASTING_OPERATIONS(InterfaceType); |
2694 | 2721 |
2695 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); | 2722 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); |
2696 virtual void VisitChildren(Visitor* visitor); | 2723 virtual void VisitChildren(Visitor* visitor); |
2697 | 2724 |
2698 intptr_t klass() { return class_reference_; } | 2725 NameIndex klass() { return class_reference_; } |
2699 List<DartType>& type_arguments() { return type_arguments_; } | 2726 List<DartType>& type_arguments() { return type_arguments_; } |
2700 | 2727 |
2701 private: | 2728 private: |
2702 InterfaceType() {} | 2729 InterfaceType() {} |
2703 | 2730 |
2704 intptr_t class_reference_; // Class canonical name. | 2731 NameIndex class_reference_; // Class canonical name. |
2705 List<DartType> type_arguments_; | 2732 List<DartType> type_arguments_; |
2706 | 2733 |
2707 DISALLOW_COPY_AND_ASSIGN(InterfaceType); | 2734 DISALLOW_COPY_AND_ASSIGN(InterfaceType); |
2708 }; | 2735 }; |
2709 | 2736 |
2710 | 2737 |
2711 class TypedefType : public DartType { | 2738 class TypedefType : public DartType { |
2712 public: | 2739 public: |
2713 static TypedefType* ReadFrom(Reader* reader); | 2740 static TypedefType* ReadFrom(Reader* reader); |
2714 | 2741 |
2715 explicit TypedefType(intptr_t class_reference) | 2742 explicit TypedefType(NameIndex class_reference) |
2716 : typedef_reference_(class_reference) {} | 2743 : typedef_reference_(class_reference) {} |
2717 virtual ~TypedefType(); | 2744 virtual ~TypedefType(); |
2718 | 2745 |
2719 DEFINE_CASTING_OPERATIONS(TypedefType); | 2746 DEFINE_CASTING_OPERATIONS(TypedefType); |
2720 | 2747 |
2721 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); | 2748 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); |
2722 virtual void VisitChildren(Visitor* visitor); | 2749 virtual void VisitChildren(Visitor* visitor); |
2723 | 2750 |
2724 intptr_t typedef_reference() { return typedef_reference_; } | 2751 NameIndex typedef_reference() { return typedef_reference_; } |
2725 List<DartType>& type_arguments() { return type_arguments_; } | 2752 List<DartType>& type_arguments() { return type_arguments_; } |
2726 | 2753 |
2727 private: | 2754 private: |
2728 TypedefType() {} | 2755 TypedefType() {} |
2729 | 2756 |
2730 intptr_t typedef_reference_; // Typedef canonical name. | 2757 NameIndex typedef_reference_; // Typedef canonical name. |
2731 List<DartType> type_arguments_; | 2758 List<DartType> type_arguments_; |
2732 | 2759 |
2733 DISALLOW_COPY_AND_ASSIGN(TypedefType); | 2760 DISALLOW_COPY_AND_ASSIGN(TypedefType); |
2734 }; | 2761 }; |
2735 | 2762 |
2736 | 2763 |
2737 class NamedParameter { | 2764 class NamedParameter { |
2738 public: | 2765 public: |
2739 static NamedParameter* ReadFrom(Reader* reader); | 2766 static NamedParameter* ReadFrom(Reader* reader); |
2740 | 2767 |
2741 NamedParameter(intptr_t name_index, DartType* type) | 2768 NamedParameter(StringIndex name_index, DartType* type) |
2742 : name_index_(name_index), type_(type) {} | 2769 : name_index_(name_index), type_(type) {} |
2743 | 2770 |
2744 intptr_t name() { return name_index_; } | 2771 StringIndex name() { return name_index_; } |
2745 DartType* type() { return type_; } | 2772 DartType* type() { return type_; } |
2746 | 2773 |
2747 private: | 2774 private: |
2748 NamedParameter() : name_index_(-1) {} | 2775 NamedParameter() {} |
2749 | 2776 |
2750 intptr_t name_index_; | 2777 StringIndex name_index_; |
2751 Child<DartType> type_; | 2778 Child<DartType> type_; |
2752 | 2779 |
2753 DISALLOW_COPY_AND_ASSIGN(NamedParameter); | 2780 DISALLOW_COPY_AND_ASSIGN(NamedParameter); |
2754 }; | 2781 }; |
2755 | 2782 |
2756 | 2783 |
2757 class FunctionType : public DartType { | 2784 class FunctionType : public DartType { |
2758 public: | 2785 public: |
2759 static FunctionType* ReadFrom(Reader* reader); | 2786 static FunctionType* ReadFrom(Reader* reader); |
2760 static FunctionType* ReadFrom(Reader* reader, bool _without_type_arguments_); | 2787 static FunctionType* ReadFrom(Reader* reader, bool _without_type_arguments_); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2829 public: | 2856 public: |
2830 TypeParameter* ReadFrom(Reader* reader); | 2857 TypeParameter* ReadFrom(Reader* reader); |
2831 | 2858 |
2832 virtual ~TypeParameter(); | 2859 virtual ~TypeParameter(); |
2833 | 2860 |
2834 DEFINE_CASTING_OPERATIONS(TypeParameter); | 2861 DEFINE_CASTING_OPERATIONS(TypeParameter); |
2835 | 2862 |
2836 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 2863 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
2837 virtual void VisitChildren(Visitor* visitor); | 2864 virtual void VisitChildren(Visitor* visitor); |
2838 | 2865 |
2839 intptr_t name() { return name_index_; } | 2866 StringIndex name() { return name_index_; } |
2840 DartType* bound() { return bound_; } | 2867 DartType* bound() { return bound_; } |
2841 | 2868 |
2842 private: | 2869 private: |
2843 TypeParameter() {} | 2870 TypeParameter() {} |
2844 | 2871 |
2845 template <typename T> | 2872 template <typename T> |
2846 friend class List; | 2873 friend class List; |
2847 friend class TypeParameterList; | 2874 friend class TypeParameterList; |
2848 | 2875 |
2849 intptr_t name_index_; | 2876 StringIndex name_index_; |
2850 Child<DartType> bound_; | 2877 Child<DartType> bound_; |
2851 | 2878 |
2852 DISALLOW_COPY_AND_ASSIGN(TypeParameter); | 2879 DISALLOW_COPY_AND_ASSIGN(TypeParameter); |
2853 }; | 2880 }; |
2854 | 2881 |
2855 | 2882 |
2856 class Program : public TreeNode { | 2883 class Program : public TreeNode { |
2857 public: | 2884 public: |
2858 static Program* ReadFrom(Reader* reader); | 2885 static Program* ReadFrom(Reader* reader); |
2859 | 2886 |
2860 virtual ~Program(); | 2887 virtual ~Program(); |
2861 | 2888 |
2862 DEFINE_CASTING_OPERATIONS(Program); | 2889 DEFINE_CASTING_OPERATIONS(Program); |
2863 | 2890 |
2864 virtual void AcceptTreeVisitor(TreeVisitor* visitor); | 2891 virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
2865 virtual void VisitChildren(Visitor* visitor); | 2892 virtual void VisitChildren(Visitor* visitor); |
2866 | 2893 |
2867 SourceTable& source_table() { return source_table_; } | 2894 SourceTable& source_table() { return source_table_; } |
2868 List<Library>& libraries() { return libraries_; } | 2895 List<Library>& libraries() { return libraries_; } |
2869 intptr_t main_method() { return main_method_reference_; } | 2896 NameIndex main_method() { return main_method_reference_; } |
2870 MallocGrowableArray<MallocGrowableArray<intptr_t>*> valid_token_positions; | 2897 MallocGrowableArray<MallocGrowableArray<intptr_t>*> valid_token_positions; |
2871 MallocGrowableArray<MallocGrowableArray<intptr_t>*> yield_token_positions; | 2898 MallocGrowableArray<MallocGrowableArray<intptr_t>*> yield_token_positions; |
2872 intptr_t string_table_offset() { return string_table_offset_; } | 2899 intptr_t string_table_offset() { return string_table_offset_; } |
2873 intptr_t name_table_offset() { return name_table_offset_; } | 2900 intptr_t name_table_offset() { return name_table_offset_; } |
2874 | 2901 |
2875 private: | 2902 private: |
2876 Program() {} | 2903 Program() {} |
2877 | 2904 |
| 2905 NameIndex main_method_reference_; // Procedure. |
2878 List<Library> libraries_; | 2906 List<Library> libraries_; |
2879 intptr_t main_method_reference_; // Procedure. | |
2880 SourceTable source_table_; | 2907 SourceTable source_table_; |
2881 | 2908 |
2882 // The offset from the start of the binary to the start of the string table. | 2909 // The offset from the start of the binary to the start of the string table. |
2883 intptr_t string_table_offset_; | 2910 intptr_t string_table_offset_; |
2884 | 2911 |
2885 // The offset from the start of the binary to the canonical name table. | 2912 // The offset from the start of the binary to the canonical name table. |
2886 intptr_t name_table_offset_; | 2913 intptr_t name_table_offset_; |
2887 | 2914 |
2888 DISALLOW_COPY_AND_ASSIGN(Program); | 2915 DISALLOW_COPY_AND_ASSIGN(Program); |
2889 }; | 2916 }; |
2890 | 2917 |
2891 | 2918 |
2892 class Reference : public AllStatic { | 2919 class Reference : public AllStatic { |
2893 public: | 2920 public: |
2894 // Read canonical name references. | 2921 // Read canonical name references. |
2895 static intptr_t ReadMemberFrom(Reader* reader, bool allow_null = false); | 2922 static NameIndex ReadMemberFrom(Reader* reader, bool allow_null = false); |
2896 static intptr_t ReadClassFrom(Reader* reader, bool allow_null = false); | 2923 static NameIndex ReadClassFrom(Reader* reader, bool allow_null = false); |
2897 static intptr_t ReadTypedefFrom(Reader* reader); | 2924 static NameIndex ReadTypedefFrom(Reader* reader); |
2898 }; | 2925 }; |
2899 | 2926 |
2900 | 2927 |
2901 class ExpressionVisitor { | 2928 class ExpressionVisitor { |
2902 public: | 2929 public: |
2903 virtual ~ExpressionVisitor() {} | 2930 virtual ~ExpressionVisitor() {} |
2904 | 2931 |
2905 virtual void VisitDefaultExpression(Expression* node) = 0; | 2932 virtual void VisitDefaultExpression(Expression* node) = 0; |
2906 virtual void VisitDefaultBasicLiteral(BasicLiteral* node) { | 2933 virtual void VisitDefaultBasicLiteral(BasicLiteral* node) { |
2907 VisitDefaultExpression(node); | 2934 VisitDefaultExpression(node); |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3289 } // namespace kernel | 3316 } // namespace kernel |
3290 | 3317 |
3291 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3318 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
3292 intptr_t buffer_length); | 3319 intptr_t buffer_length); |
3293 | 3320 |
3294 | 3321 |
3295 } // namespace dart | 3322 } // namespace dart |
3296 | 3323 |
3297 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3324 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
3298 #endif // RUNTIME_VM_KERNEL_H_ | 3325 #endif // RUNTIME_VM_KERNEL_H_ |
OLD | NEW |