Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: runtime/vm/kernel.h

Issue 2853423002: Move the Kernel canonical name table into the VM's heap (Closed)
Patch Set: Merge a bugfix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/kernel.cc » ('j') | runtime/vm/kernel_binary_flowgraph.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 class Typedef; 320 class Typedef;
321 class Class; 321 class Class;
322 class Constructor; 322 class Constructor;
323 class Field; 323 class Field;
324 class Library; 324 class Library;
325 class LinkedNode; 325 class LinkedNode;
326 class Member; 326 class Member;
327 class Procedure; 327 class Procedure;
328 328
329 class CanonicalName {
330 public:
331 ~CanonicalName();
332
333 intptr_t name() { return name_index_; }
334 CanonicalName* parent() { return parent_; }
335 bool is_referenced() { return is_referenced_; }
336 void set_referenced(bool referenced) { is_referenced_ = referenced; }
337
338 CanonicalName* AddChild(intptr_t string_index);
339
340 static CanonicalName* NewRoot();
341
342 private:
343 CanonicalName();
344
345 CanonicalName* parent_;
346 intptr_t name_index_;
347 MallocGrowableArray<CanonicalName*> children_;
348 bool is_referenced_;
349
350 DISALLOW_COPY_AND_ASSIGN(CanonicalName);
351 };
352
353
354 class Node { 329 class Node {
355 public: 330 public:
356 virtual ~Node(); 331 virtual ~Node();
357 332
358 enum NodeType { 333 enum NodeType {
359 #define DO(name) kType##name, 334 #define DO(name) kType##name,
360 KERNEL_ALL_NODES_DO(DO) 335 KERNEL_ALL_NODES_DO(DO)
361 #undef DO 336 #undef DO
362 337
363 kNumTypes 338 kNumTypes
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 371
397 private: 372 private:
398 DISALLOW_COPY_AND_ASSIGN(TreeNode); 373 DISALLOW_COPY_AND_ASSIGN(TreeNode);
399 }; 374 };
400 375
401 376
402 class LinkedNode : public TreeNode { 377 class LinkedNode : public TreeNode {
403 public: 378 public:
404 virtual ~LinkedNode(); 379 virtual ~LinkedNode();
405 380
406 CanonicalName* canonical_name() { return canonical_name_; } 381 intptr_t canonical_name() { return canonical_name_; }
Vyacheslav Egorov (Google) 2017/05/03 06:28:48 With all these different indices I wonder if it wo
407 382
408 protected: 383 protected:
409 LinkedNode() {} 384 LinkedNode() {}
410 385
411 Ref<CanonicalName> canonical_name_; 386 intptr_t canonical_name_;
412 387
413 private: 388 private:
414 friend class CanonicalName;
415
416 DISALLOW_COPY_AND_ASSIGN(LinkedNode); 389 DISALLOW_COPY_AND_ASSIGN(LinkedNode);
417 }; 390 };
418 391
419 392
420 class Library : public LinkedNode { 393 class Library : public LinkedNode {
421 public: 394 public:
422 Library* ReadFrom(Reader* reader); 395 Library* ReadFrom(Reader* reader);
423 396
424 virtual ~Library(); 397 virtual ~Library();
425 398
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 public: 789 public:
817 static FieldInitializer* ReadFromImpl(Reader* reader); 790 static FieldInitializer* ReadFromImpl(Reader* reader);
818 791
819 virtual ~FieldInitializer(); 792 virtual ~FieldInitializer();
820 793
821 DEFINE_CASTING_OPERATIONS(FieldInitializer); 794 DEFINE_CASTING_OPERATIONS(FieldInitializer);
822 795
823 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); 796 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor);
824 virtual void VisitChildren(Visitor* visitor); 797 virtual void VisitChildren(Visitor* visitor);
825 798
826 CanonicalName* field() { return field_reference_; } 799 intptr_t field() { return field_reference_; }
827 Expression* value() { return value_; } 800 Expression* value() { return value_; }
828 801
829 private: 802 private:
830 FieldInitializer() {} 803 FieldInitializer() {}
831 804
832 Ref<CanonicalName> field_reference_; // Field. 805 intptr_t field_reference_; // Field canonical name.
833 Child<Expression> value_; 806 Child<Expression> value_;
834 807
835 DISALLOW_COPY_AND_ASSIGN(FieldInitializer); 808 DISALLOW_COPY_AND_ASSIGN(FieldInitializer);
836 }; 809 };
837 810
838 811
839 class SuperInitializer : public Initializer { 812 class SuperInitializer : public Initializer {
840 public: 813 public:
841 static SuperInitializer* ReadFromImpl(Reader* reader); 814 static SuperInitializer* ReadFromImpl(Reader* reader);
842 815
843 virtual ~SuperInitializer(); 816 virtual ~SuperInitializer();
844 817
845 DEFINE_CASTING_OPERATIONS(SuperInitializer); 818 DEFINE_CASTING_OPERATIONS(SuperInitializer);
846 819
847 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); 820 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor);
848 virtual void VisitChildren(Visitor* visitor); 821 virtual void VisitChildren(Visitor* visitor);
849 822
850 CanonicalName* target() { return target_reference_; } 823 intptr_t target() { return target_reference_; }
851 Arguments* arguments() { return arguments_; } 824 Arguments* arguments() { return arguments_; }
852 825
853 private: 826 private:
854 SuperInitializer() {} 827 SuperInitializer() {}
855 828
856 Ref<CanonicalName> target_reference_; // Constructor. 829 intptr_t target_reference_; // Constructor canonical name.
857 Child<Arguments> arguments_; 830 Child<Arguments> arguments_;
858 831
859 DISALLOW_COPY_AND_ASSIGN(SuperInitializer); 832 DISALLOW_COPY_AND_ASSIGN(SuperInitializer);
860 }; 833 };
861 834
862 835
863 class RedirectingInitializer : public Initializer { 836 class RedirectingInitializer : public Initializer {
864 public: 837 public:
865 static RedirectingInitializer* ReadFromImpl(Reader* reader); 838 static RedirectingInitializer* ReadFromImpl(Reader* reader);
866 839
867 virtual ~RedirectingInitializer(); 840 virtual ~RedirectingInitializer();
868 841
869 DEFINE_CASTING_OPERATIONS(RedirectingInitializer); 842 DEFINE_CASTING_OPERATIONS(RedirectingInitializer);
870 843
871 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor); 844 virtual void AcceptInitializerVisitor(InitializerVisitor* visitor);
872 virtual void VisitChildren(Visitor* visitor); 845 virtual void VisitChildren(Visitor* visitor);
873 846
874 CanonicalName* target() { return target_reference_; } 847 intptr_t target() { return target_reference_; }
875 Arguments* arguments() { return arguments_; } 848 Arguments* arguments() { return arguments_; }
876 849
877 private: 850 private:
878 RedirectingInitializer() {} 851 RedirectingInitializer() {}
879 852
880 Ref<CanonicalName> target_reference_; // Constructor. 853 intptr_t target_reference_; // Constructor canonical name.
881 Child<Arguments> arguments_; 854 Child<Arguments> arguments_;
882 855
883 DISALLOW_COPY_AND_ASSIGN(RedirectingInitializer); 856 DISALLOW_COPY_AND_ASSIGN(RedirectingInitializer);
884 }; 857 };
885 858
886 859
887 class LocalInitializer : public Initializer { 860 class LocalInitializer : public Initializer {
888 public: 861 public:
889 static LocalInitializer* ReadFromImpl(Reader* reader); 862 static LocalInitializer* ReadFromImpl(Reader* reader);
890 863
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 virtual void VisitChildren(Visitor* visitor); 1034 virtual void VisitChildren(Visitor* visitor);
1062 1035
1063 Expression* receiver() { return receiver_; } 1036 Expression* receiver() { return receiver_; }
1064 Name* name() { return name_; } 1037 Name* name() { return name_; }
1065 1038
1066 private: 1039 private:
1067 PropertyGet() {} 1040 PropertyGet() {}
1068 1041
1069 Child<Expression> receiver_; 1042 Child<Expression> receiver_;
1070 Child<Name> name_; 1043 Child<Name> name_;
1071 Ref<CanonicalName> interface_target_reference_; 1044 intptr_t interface_target_reference_;
1072 1045
1073 DISALLOW_COPY_AND_ASSIGN(PropertyGet); 1046 DISALLOW_COPY_AND_ASSIGN(PropertyGet);
1074 }; 1047 };
1075 1048
1076 1049
1077 class PropertySet : public Expression { 1050 class PropertySet : public Expression {
1078 public: 1051 public:
1079 static PropertySet* ReadFrom(Reader* reader); 1052 static PropertySet* ReadFrom(Reader* reader);
1080 1053
1081 virtual ~PropertySet(); 1054 virtual ~PropertySet();
1082 1055
1083 DEFINE_CASTING_OPERATIONS(PropertySet); 1056 DEFINE_CASTING_OPERATIONS(PropertySet);
1084 1057
1085 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); 1058 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1086 virtual void VisitChildren(Visitor* visitor); 1059 virtual void VisitChildren(Visitor* visitor);
1087 1060
1088 Expression* receiver() { return receiver_; } 1061 Expression* receiver() { return receiver_; }
1089 Name* name() { return name_; } 1062 Name* name() { return name_; }
1090 Expression* value() { return value_; } 1063 Expression* value() { return value_; }
1091 1064
1092 private: 1065 private:
1093 PropertySet() {} 1066 PropertySet() {}
1094 1067
1095 Child<Expression> receiver_; 1068 Child<Expression> receiver_;
1096 Child<Name> name_; 1069 Child<Name> name_;
1097 Child<Expression> value_; 1070 Child<Expression> value_;
1098 Ref<CanonicalName> interface_target_reference_; 1071 intptr_t interface_target_reference_;
1099 1072
1100 DISALLOW_COPY_AND_ASSIGN(PropertySet); 1073 DISALLOW_COPY_AND_ASSIGN(PropertySet);
1101 }; 1074 };
1102 1075
1103 1076
1104 class DirectPropertyGet : public Expression { 1077 class DirectPropertyGet : public Expression {
1105 public: 1078 public:
1106 static DirectPropertyGet* ReadFrom(Reader* reader); 1079 static DirectPropertyGet* ReadFrom(Reader* reader);
1107 1080
1108 virtual ~DirectPropertyGet(); 1081 virtual ~DirectPropertyGet();
1109 1082
1110 DEFINE_CASTING_OPERATIONS(DirectPropertyGet); 1083 DEFINE_CASTING_OPERATIONS(DirectPropertyGet);
1111 1084
1112 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); 1085 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1113 virtual void VisitChildren(Visitor* visitor); 1086 virtual void VisitChildren(Visitor* visitor);
1114 1087
1115 Expression* receiver() { return receiver_; } 1088 Expression* receiver() { return receiver_; }
1116 CanonicalName* target() { return target_reference_; } 1089 intptr_t target() { return target_reference_; }
1117 1090
1118 private: 1091 private:
1119 DirectPropertyGet() {} 1092 DirectPropertyGet() {}
1120 1093
1121 Child<Expression> receiver_; 1094 Child<Expression> receiver_;
1122 Ref<CanonicalName> target_reference_; // Member. 1095 intptr_t target_reference_; // Member canonical name.
1123 1096
1124 DISALLOW_COPY_AND_ASSIGN(DirectPropertyGet); 1097 DISALLOW_COPY_AND_ASSIGN(DirectPropertyGet);
1125 }; 1098 };
1126 1099
1127 1100
1128 class DirectPropertySet : public Expression { 1101 class DirectPropertySet : public Expression {
1129 public: 1102 public:
1130 static DirectPropertySet* ReadFrom(Reader* reader); 1103 static DirectPropertySet* ReadFrom(Reader* reader);
1131 1104
1132 virtual ~DirectPropertySet(); 1105 virtual ~DirectPropertySet();
1133 1106
1134 DEFINE_CASTING_OPERATIONS(DirectPropertySet); 1107 DEFINE_CASTING_OPERATIONS(DirectPropertySet);
1135 1108
1136 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); 1109 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1137 virtual void VisitChildren(Visitor* visitor); 1110 virtual void VisitChildren(Visitor* visitor);
1138 1111
1139 Expression* receiver() { return receiver_; } 1112 Expression* receiver() { return receiver_; }
1140 CanonicalName* target() { return target_reference_; } 1113 intptr_t target() { return target_reference_; }
1141 Expression* value() { return value_; } 1114 Expression* value() { return value_; }
1142 1115
1143 private: 1116 private:
1144 DirectPropertySet() {} 1117 DirectPropertySet() {}
1145 1118
1146 Child<Expression> receiver_; 1119 Child<Expression> receiver_;
1147 Ref<CanonicalName> target_reference_; // Member. 1120 intptr_t target_reference_; // Member canonical name.
1148 Child<Expression> value_; 1121 Child<Expression> value_;
1149 1122
1150 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet); 1123 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet);
1151 }; 1124 };
1152 1125
1153 1126
1154 class StaticGet : public Expression { 1127 class StaticGet : public Expression {
1155 public: 1128 public:
1156 explicit StaticGet(CanonicalName* target) : target_reference_(target) {} 1129 explicit StaticGet(intptr_t target) : target_reference_(target) {}
1157 1130
1158 static StaticGet* ReadFrom(Reader* reader); 1131 static StaticGet* ReadFrom(Reader* reader);
1159 1132
1160 virtual ~StaticGet(); 1133 virtual ~StaticGet();
1161 1134
1162 DEFINE_CASTING_OPERATIONS(StaticGet); 1135 DEFINE_CASTING_OPERATIONS(StaticGet);
1163 1136
1164 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); 1137 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1165 virtual void VisitChildren(Visitor* visitor); 1138 virtual void VisitChildren(Visitor* visitor);
1166 1139
1167 CanonicalName* target() { return target_reference_; } 1140 intptr_t target() { return target_reference_; }
1168 1141
1169 private: 1142 private:
1170 StaticGet() {} 1143 StaticGet() {}
1171 1144
1172 Ref<CanonicalName> target_reference_; // Member. 1145 intptr_t target_reference_; // Member canonical name.
1173 1146
1174 DISALLOW_COPY_AND_ASSIGN(StaticGet); 1147 DISALLOW_COPY_AND_ASSIGN(StaticGet);
1175 }; 1148 };
1176 1149
1177 1150
1178 class StaticSet : public Expression { 1151 class StaticSet : public Expression {
1179 public: 1152 public:
1180 static StaticSet* ReadFrom(Reader* reader); 1153 static StaticSet* ReadFrom(Reader* reader);
1181 1154
1182 virtual ~StaticSet(); 1155 virtual ~StaticSet();
1183 1156
1184 DEFINE_CASTING_OPERATIONS(StaticSet); 1157 DEFINE_CASTING_OPERATIONS(StaticSet);
1185 1158
1186 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); 1159 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1187 virtual void VisitChildren(Visitor* visitor); 1160 virtual void VisitChildren(Visitor* visitor);
1188 1161
1189 CanonicalName* target() { return target_reference_; } 1162 intptr_t target() { return target_reference_; }
1190 Expression* expression() { return expression_; } 1163 Expression* expression() { return expression_; }
1191 1164
1192 private: 1165 private:
1193 StaticSet() {} 1166 StaticSet() {}
1194 1167
1195 Ref<CanonicalName> target_reference_; // Member. 1168 intptr_t target_reference_; // Member canonical name.
1196 Child<Expression> expression_; 1169 Child<Expression> expression_;
1197 1170
1198 DISALLOW_COPY_AND_ASSIGN(StaticSet); 1171 DISALLOW_COPY_AND_ASSIGN(StaticSet);
1199 }; 1172 };
1200 1173
1201 1174
1202 class Arguments : public TreeNode { 1175 class Arguments : public TreeNode {
1203 public: 1176 public:
1204 static Arguments* ReadFrom(Reader* reader); 1177 static Arguments* ReadFrom(Reader* reader);
1205 1178
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 Expression* receiver() { return receiver_; } 1240 Expression* receiver() { return receiver_; }
1268 Name* name() { return name_; } 1241 Name* name() { return name_; }
1269 Arguments* arguments() { return arguments_; } 1242 Arguments* arguments() { return arguments_; }
1270 1243
1271 private: 1244 private:
1272 MethodInvocation() {} 1245 MethodInvocation() {}
1273 1246
1274 Child<Expression> receiver_; 1247 Child<Expression> receiver_;
1275 Child<Name> name_; 1248 Child<Name> name_;
1276 Child<Arguments> arguments_; 1249 Child<Arguments> arguments_;
1277 Ref<CanonicalName> interface_target_reference_; 1250 intptr_t interface_target_reference_;
1278 1251
1279 DISALLOW_COPY_AND_ASSIGN(MethodInvocation); 1252 DISALLOW_COPY_AND_ASSIGN(MethodInvocation);
1280 }; 1253 };
1281 1254
1282 1255
1283 class DirectMethodInvocation : public Expression { 1256 class DirectMethodInvocation : public Expression {
1284 public: 1257 public:
1285 static DirectMethodInvocation* ReadFrom(Reader* reader); 1258 static DirectMethodInvocation* ReadFrom(Reader* reader);
1286 1259
1287 virtual ~DirectMethodInvocation(); 1260 virtual ~DirectMethodInvocation();
1288 1261
1289 DEFINE_CASTING_OPERATIONS(DirectMethodInvocation); 1262 DEFINE_CASTING_OPERATIONS(DirectMethodInvocation);
1290 1263
1291 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); 1264 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1292 virtual void VisitChildren(Visitor* visitor); 1265 virtual void VisitChildren(Visitor* visitor);
1293 1266
1294 Expression* receiver() { return receiver_; } 1267 Expression* receiver() { return receiver_; }
1295 CanonicalName* target() { return target_reference_; } 1268 intptr_t target() { return target_reference_; }
1296 Arguments* arguments() { return arguments_; } 1269 Arguments* arguments() { return arguments_; }
1297 1270
1298 private: 1271 private:
1299 DirectMethodInvocation() {} 1272 DirectMethodInvocation() {}
1300 1273
1301 Child<Expression> receiver_; 1274 Child<Expression> receiver_;
1302 Ref<CanonicalName> target_reference_; // Procedure. 1275 intptr_t target_reference_; // Procedure canonical name.
1303 Child<Arguments> arguments_; 1276 Child<Arguments> arguments_;
1304 1277
1305 DISALLOW_COPY_AND_ASSIGN(DirectMethodInvocation); 1278 DISALLOW_COPY_AND_ASSIGN(DirectMethodInvocation);
1306 }; 1279 };
1307 1280
1308 1281
1309 class StaticInvocation : public Expression { 1282 class StaticInvocation : public Expression {
1310 public: 1283 public:
1311 static StaticInvocation* ReadFrom(Reader* reader, bool is_const); 1284 static StaticInvocation* ReadFrom(Reader* reader, bool is_const);
1312 ~StaticInvocation(); 1285 ~StaticInvocation();
1313 1286
1314 DEFINE_CASTING_OPERATIONS(StaticInvocation); 1287 DEFINE_CASTING_OPERATIONS(StaticInvocation);
1315 1288
1316 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); 1289 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1317 virtual void VisitChildren(Visitor* visitor); 1290 virtual void VisitChildren(Visitor* visitor);
1318 1291
1319 CanonicalName* procedure() { return procedure_reference_; } 1292 intptr_t procedure() { return procedure_reference_; }
1320 Arguments* arguments() { return arguments_; } 1293 Arguments* arguments() { return arguments_; }
1321 bool is_const() { return is_const_; } 1294 bool is_const() { return is_const_; }
1322 1295
1323 private: 1296 private:
1324 StaticInvocation() {} 1297 StaticInvocation() {}
1325 1298
1326 Ref<CanonicalName> procedure_reference_; // Procedure. 1299 intptr_t procedure_reference_; // Procedure canonical name.
1327 Child<Arguments> arguments_; 1300 Child<Arguments> arguments_;
1328 bool is_const_; 1301 bool is_const_;
1329 1302
1330 DISALLOW_COPY_AND_ASSIGN(StaticInvocation); 1303 DISALLOW_COPY_AND_ASSIGN(StaticInvocation);
1331 }; 1304 };
1332 1305
1333 1306
1334 class ConstructorInvocation : public Expression { 1307 class ConstructorInvocation : public Expression {
1335 public: 1308 public:
1336 static ConstructorInvocation* ReadFrom(Reader* reader, bool is_const); 1309 static ConstructorInvocation* ReadFrom(Reader* reader, bool is_const);
1337 1310
1338 virtual ~ConstructorInvocation(); 1311 virtual ~ConstructorInvocation();
1339 1312
1340 DEFINE_CASTING_OPERATIONS(ConstructorInvocation); 1313 DEFINE_CASTING_OPERATIONS(ConstructorInvocation);
1341 1314
1342 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); 1315 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1343 virtual void VisitChildren(Visitor* visitor); 1316 virtual void VisitChildren(Visitor* visitor);
1344 1317
1345 bool is_const() { return is_const_; } 1318 bool is_const() { return is_const_; }
1346 CanonicalName* target() { return target_reference_; } 1319 intptr_t target() { return target_reference_; }
1347 Arguments* arguments() { return arguments_; } 1320 Arguments* arguments() { return arguments_; }
1348 1321
1349 private: 1322 private:
1350 ConstructorInvocation() {} 1323 ConstructorInvocation() {}
1351 1324
1352 bool is_const_; 1325 bool is_const_;
1353 Ref<CanonicalName> target_reference_; // Constructor. 1326 intptr_t target_reference_; // Constructor canonical name.
1354 Child<Arguments> arguments_; 1327 Child<Arguments> arguments_;
1355 1328
1356 DISALLOW_COPY_AND_ASSIGN(ConstructorInvocation); 1329 DISALLOW_COPY_AND_ASSIGN(ConstructorInvocation);
1357 }; 1330 };
1358 1331
1359 1332
1360 class Not : public Expression { 1333 class Not : public Expression {
1361 public: 1334 public:
1362 static Not* ReadFrom(Reader* reader); 1335 static Not* ReadFrom(Reader* reader);
1363 1336
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 public: 1963 public:
1991 static ClosureCreation* ReadFrom(Reader* reader); 1964 static ClosureCreation* ReadFrom(Reader* reader);
1992 1965
1993 virtual ~ClosureCreation(); 1966 virtual ~ClosureCreation();
1994 1967
1995 DEFINE_CASTING_OPERATIONS(ClosureCreation); 1968 DEFINE_CASTING_OPERATIONS(ClosureCreation);
1996 1969
1997 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); 1970 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1998 virtual void VisitChildren(Visitor* visitor); 1971 virtual void VisitChildren(Visitor* visitor);
1999 1972
2000 CanonicalName* top_level_function() { return top_level_function_reference_; } 1973 intptr_t top_level_function() { return top_level_function_reference_; }
2001 Expression* context_vector() { return context_vector_; } 1974 Expression* context_vector() { return context_vector_; }
2002 FunctionType* function_type() { return function_type_; } 1975 FunctionType* function_type() { return function_type_; }
2003 1976
2004 private: 1977 private:
2005 ClosureCreation() {} 1978 ClosureCreation() {}
2006 1979
2007 Ref<CanonicalName> top_level_function_reference_; // Procedure. 1980 intptr_t top_level_function_reference_; // Procedure canonical name.
2008 Child<Expression> context_vector_; 1981 Child<Expression> context_vector_;
2009 Child<FunctionType> function_type_; 1982 Child<FunctionType> function_type_;
2010 1983
2011 DISALLOW_COPY_AND_ASSIGN(ClosureCreation); 1984 DISALLOW_COPY_AND_ASSIGN(ClosureCreation);
2012 }; 1985 };
2013 1986
2014 1987
2015 class Statement : public TreeNode { 1988 class Statement : public TreeNode {
2016 public: 1989 public:
2017 static Statement* ReadFrom(Reader* reader); 1990 static Statement* ReadFrom(Reader* reader);
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
2614 static Name* ReadFrom(Reader* reader); 2587 static Name* ReadFrom(Reader* reader);
2615 2588
2616 virtual ~Name(); 2589 virtual ~Name();
2617 2590
2618 DEFINE_CASTING_OPERATIONS(Name); 2591 DEFINE_CASTING_OPERATIONS(Name);
2619 2592
2620 virtual void AcceptVisitor(Visitor* visitor); 2593 virtual void AcceptVisitor(Visitor* visitor);
2621 virtual void VisitChildren(Visitor* visitor); 2594 virtual void VisitChildren(Visitor* visitor);
2622 2595
2623 intptr_t string_index() { return string_index_; } 2596 intptr_t string_index() { return string_index_; }
2624 CanonicalName* library() { return library_reference_; } 2597 intptr_t library() { return library_reference_; }
2625 2598
2626 private: 2599 private:
2627 Name(intptr_t string_index, CanonicalName* library_reference) 2600 Name(intptr_t string_index, intptr_t library_reference)
2628 : string_index_(string_index), 2601 : string_index_(string_index),
2629 library_reference_(library_reference) {} // NOLINT 2602 library_reference_(library_reference) {} // NOLINT
2630 2603
2631 intptr_t string_index_; 2604 intptr_t string_index_;
2632 Ref<CanonicalName> library_reference_; // Library. 2605 intptr_t library_reference_; // Library canonical name.
2633 2606
2634 DISALLOW_COPY_AND_ASSIGN(Name); 2607 DISALLOW_COPY_AND_ASSIGN(Name);
2635 }; 2608 };
2636 2609
2637 2610
2638 class DartType : public Node { 2611 class DartType : public Node {
2639 public: 2612 public:
2640 static DartType* ReadFrom(Reader* reader); 2613 static DartType* ReadFrom(Reader* reader);
2641 2614
2642 virtual ~DartType(); 2615 virtual ~DartType();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
2706 2679
2707 DISALLOW_COPY_AND_ASSIGN(VoidType); 2680 DISALLOW_COPY_AND_ASSIGN(VoidType);
2708 }; 2681 };
2709 2682
2710 2683
2711 class InterfaceType : public DartType { 2684 class InterfaceType : public DartType {
2712 public: 2685 public:
2713 static InterfaceType* ReadFrom(Reader* reader); 2686 static InterfaceType* ReadFrom(Reader* reader);
2714 static InterfaceType* ReadFrom(Reader* reader, bool _without_type_arguments_); 2687 static InterfaceType* ReadFrom(Reader* reader, bool _without_type_arguments_);
2715 2688
2716 explicit InterfaceType(CanonicalName* class_reference) 2689 explicit InterfaceType(intptr_t class_reference)
2717 : class_reference_(class_reference) {} 2690 : class_reference_(class_reference) {}
2718 virtual ~InterfaceType(); 2691 virtual ~InterfaceType();
2719 2692
2720 DEFINE_CASTING_OPERATIONS(InterfaceType); 2693 DEFINE_CASTING_OPERATIONS(InterfaceType);
2721 2694
2722 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); 2695 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2723 virtual void VisitChildren(Visitor* visitor); 2696 virtual void VisitChildren(Visitor* visitor);
2724 2697
2725 CanonicalName* klass() { return class_reference_; } 2698 intptr_t klass() { return class_reference_; }
2726 List<DartType>& type_arguments() { return type_arguments_; } 2699 List<DartType>& type_arguments() { return type_arguments_; }
2727 2700
2728 private: 2701 private:
2729 InterfaceType() {} 2702 InterfaceType() {}
2730 2703
2731 Ref<CanonicalName> class_reference_; // Class. 2704 intptr_t class_reference_; // Class canonical name.
2732 List<DartType> type_arguments_; 2705 List<DartType> type_arguments_;
2733 2706
2734 DISALLOW_COPY_AND_ASSIGN(InterfaceType); 2707 DISALLOW_COPY_AND_ASSIGN(InterfaceType);
2735 }; 2708 };
2736 2709
2737 2710
2738 class TypedefType : public DartType { 2711 class TypedefType : public DartType {
2739 public: 2712 public:
2740 static TypedefType* ReadFrom(Reader* reader); 2713 static TypedefType* ReadFrom(Reader* reader);
2741 2714
2742 explicit TypedefType(CanonicalName* class_reference) 2715 explicit TypedefType(intptr_t class_reference)
2743 : typedef_reference_(class_reference) {} 2716 : typedef_reference_(class_reference) {}
2744 virtual ~TypedefType(); 2717 virtual ~TypedefType();
2745 2718
2746 DEFINE_CASTING_OPERATIONS(TypedefType); 2719 DEFINE_CASTING_OPERATIONS(TypedefType);
2747 2720
2748 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor); 2721 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2749 virtual void VisitChildren(Visitor* visitor); 2722 virtual void VisitChildren(Visitor* visitor);
2750 2723
2751 CanonicalName* typedef_reference() { return typedef_reference_; } 2724 intptr_t typedef_reference() { return typedef_reference_; }
2752 List<DartType>& type_arguments() { return type_arguments_; } 2725 List<DartType>& type_arguments() { return type_arguments_; }
2753 2726
2754 private: 2727 private:
2755 TypedefType() {} 2728 TypedefType() {}
2756 2729
2757 Ref<CanonicalName> typedef_reference_; // Typedef. 2730 intptr_t typedef_reference_; // Typedef canonical name.
2758 List<DartType> type_arguments_; 2731 List<DartType> type_arguments_;
2759 2732
2760 DISALLOW_COPY_AND_ASSIGN(TypedefType); 2733 DISALLOW_COPY_AND_ASSIGN(TypedefType);
2761 }; 2734 };
2762 2735
2763 2736
2764 class NamedParameter { 2737 class NamedParameter {
2765 public: 2738 public:
2766 static NamedParameter* ReadFrom(Reader* reader); 2739 static NamedParameter* ReadFrom(Reader* reader);
2767 2740
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2886 2859
2887 virtual ~Program(); 2860 virtual ~Program();
2888 2861
2889 DEFINE_CASTING_OPERATIONS(Program); 2862 DEFINE_CASTING_OPERATIONS(Program);
2890 2863
2891 virtual void AcceptTreeVisitor(TreeVisitor* visitor); 2864 virtual void AcceptTreeVisitor(TreeVisitor* visitor);
2892 virtual void VisitChildren(Visitor* visitor); 2865 virtual void VisitChildren(Visitor* visitor);
2893 2866
2894 SourceTable& source_table() { return source_table_; } 2867 SourceTable& source_table() { return source_table_; }
2895 List<Library>& libraries() { return libraries_; } 2868 List<Library>& libraries() { return libraries_; }
2896 CanonicalName* main_method() { return main_method_reference_; } 2869 intptr_t main_method() { return main_method_reference_; }
2897 CanonicalName* canonical_name_root() { return canonical_name_root_; }
2898 MallocGrowableArray<MallocGrowableArray<intptr_t>*> valid_token_positions; 2870 MallocGrowableArray<MallocGrowableArray<intptr_t>*> valid_token_positions;
2899 MallocGrowableArray<MallocGrowableArray<intptr_t>*> yield_token_positions; 2871 MallocGrowableArray<MallocGrowableArray<intptr_t>*> yield_token_positions;
2900 intptr_t string_table_offset() { return string_table_offset_; } 2872 intptr_t string_table_offset() { return string_table_offset_; }
2873 intptr_t name_table_offset() { return name_table_offset_; }
2901 2874
2902 private: 2875 private:
2903 Program() {} 2876 Program() {}
2904 2877
2905 Child<CanonicalName> canonical_name_root_;
2906 List<Library> libraries_; 2878 List<Library> libraries_;
2907 Ref<CanonicalName> main_method_reference_; // Procedure. 2879 intptr_t main_method_reference_; // Procedure.
2908 SourceTable source_table_; 2880 SourceTable source_table_;
2909 2881
2910 // The offset from the start of the binary to the start of the string table. 2882 // The offset from the start of the binary to the start of the string table.
2911 intptr_t string_table_offset_; 2883 intptr_t string_table_offset_;
2912 2884
2885 // The offset from the start of the binary to the canonical name table.
2886 intptr_t name_table_offset_;
2887
2913 DISALLOW_COPY_AND_ASSIGN(Program); 2888 DISALLOW_COPY_AND_ASSIGN(Program);
2914 }; 2889 };
2915 2890
2916 2891
2917 class Reference : public AllStatic { 2892 class Reference : public AllStatic {
2918 public: 2893 public:
2919 static CanonicalName* ReadMemberFrom(Reader* reader, bool allow_null = false); 2894 // Read canonical name references.
2920 2895 static intptr_t ReadMemberFrom(Reader* reader, bool allow_null = false);
2921 static CanonicalName* ReadClassFrom(Reader* reader, bool allow_null = false); 2896 static intptr_t ReadClassFrom(Reader* reader, bool allow_null = false);
2922 2897 static intptr_t ReadTypedefFrom(Reader* reader);
2923 static CanonicalName* ReadTypedefFrom(Reader* reader);
2924 }; 2898 };
2925 2899
2926 2900
2927 class ExpressionVisitor { 2901 class ExpressionVisitor {
2928 public: 2902 public:
2929 virtual ~ExpressionVisitor() {} 2903 virtual ~ExpressionVisitor() {}
2930 2904
2931 virtual void VisitDefaultExpression(Expression* node) = 0; 2905 virtual void VisitDefaultExpression(Expression* node) = 0;
2932 virtual void VisitDefaultBasicLiteral(BasicLiteral* node) { 2906 virtual void VisitDefaultBasicLiteral(BasicLiteral* node) {
2933 VisitDefaultExpression(node); 2907 VisitDefaultExpression(node);
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
3315 } // namespace kernel 3289 } // namespace kernel
3316 3290
3317 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, 3291 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
3318 intptr_t buffer_length); 3292 intptr_t buffer_length);
3319 3293
3320 3294
3321 } // namespace dart 3295 } // namespace dart
3322 3296
3323 #endif // !defined(DART_PRECOMPILED_RUNTIME) 3297 #endif // !defined(DART_PRECOMPILED_RUNTIME)
3324 #endif // RUNTIME_VM_KERNEL_H_ 3298 #endif // RUNTIME_VM_KERNEL_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/kernel.cc » ('j') | runtime/vm/kernel_binary_flowgraph.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698