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

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

Issue 2931813002: [kernel] Stream kernel_reader (Closed)
Patch Set: Feedback Created 3 years, 6 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 | « runtime/vm/bootstrap_nocore.cc ('k') | runtime/vm/kernel.cc » ('j') | no next file with comments »
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 M(FunctionDeclaration) \ 113 M(FunctionDeclaration) \
114 M(TypeParameter) \ 114 M(TypeParameter) \
115 M(Program) 115 M(Program)
116 116
117 #define KERNEL_ALL_NODES_DO(M) \ 117 #define KERNEL_ALL_NODES_DO(M) \
118 M(Node) \ 118 M(Node) \
119 KERNEL_NODES_DO(M) \ 119 KERNEL_NODES_DO(M) \
120 M(TreeNode) \ 120 M(TreeNode) \
121 KERNEL_TREE_NODES_DO(M) 121 KERNEL_TREE_NODES_DO(M)
122 122
123 #define KERNEL_VISITORS_DO(M) \
124 M(ExpressionVisitor) \
125 M(DartTypeVisitor) \
126
127 namespace dart { 123 namespace dart {
128 124
129 class Field; 125 class Field;
130 class ParsedFunction; 126 class ParsedFunction;
131 class Zone; 127 class Zone;
132 128
133 namespace kernel { 129 namespace kernel {
134 130
135 131
136 class Reader; 132 class Reader;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 operator int() const { return value_; } 345 operator int() const { return value_; }
350 346
351 private: 347 private:
352 int value_; 348 int value_;
353 }; 349 };
354 350
355 351
356 // Forward declare all classes. 352 // Forward declare all classes.
357 #define DO(name) class name; 353 #define DO(name) class name;
358 KERNEL_ALL_NODES_DO(DO) 354 KERNEL_ALL_NODES_DO(DO)
359 KERNEL_VISITORS_DO(DO)
360 #undef DO 355 #undef DO
361 356
362 357
363 #define DEFINE_CASTING_OPERATIONS(klass) \ 358 #define DEFINE_CASTING_OPERATIONS(klass) \
364 virtual bool Is##klass() { return true; } \ 359 virtual bool Is##klass() { return true; } \
365 \ 360 \
366 static klass* Cast(Node* node) { \ 361 static klass* Cast(Node* node) { \
367 ASSERT(node == NULL || node->Is##klass()); \ 362 ASSERT(node == NULL || node->Is##klass()); \
368 return static_cast<klass*>(node); \ 363 return static_cast<klass*>(node); \
369 } \ 364 } \
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 960
966 961
967 class Expression : public TreeNode { 962 class Expression : public TreeNode {
968 public: 963 public:
969 static Expression* ReadFrom(Reader* reader); 964 static Expression* ReadFrom(Reader* reader);
970 965
971 virtual ~Expression(); 966 virtual ~Expression();
972 967
973 DEFINE_CASTING_OPERATIONS(Expression); 968 DEFINE_CASTING_OPERATIONS(Expression);
974 969
975 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor) = 0;
976 TokenPosition position() { return position_; } 970 TokenPosition position() { return position_; }
977 void set_position(TokenPosition position) { position_ = position; } 971 void set_position(TokenPosition position) { position_ = position; }
978 972
979 protected: 973 protected:
980 Expression() : position_(TokenPosition::kNoSource) {} 974 Expression() : position_(TokenPosition::kNoSource) {}
981 TokenPosition position_; 975 TokenPosition position_;
982 976
983 private: 977 private:
984 DISALLOW_COPY_AND_ASSIGN(Expression); 978 DISALLOW_COPY_AND_ASSIGN(Expression);
985 }; 979 };
986 980
987 981
988 class InvalidExpression : public Expression { 982 class InvalidExpression : public Expression {
989 public: 983 public:
990 static InvalidExpression* ReadFrom(Reader* reader); 984 static InvalidExpression* ReadFrom(Reader* reader);
991 985
992 virtual ~InvalidExpression(); 986 virtual ~InvalidExpression();
993 987
994 DEFINE_CASTING_OPERATIONS(InvalidExpression); 988 DEFINE_CASTING_OPERATIONS(InvalidExpression);
995 989
996 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
997
998 private: 990 private:
999 InvalidExpression() {} 991 InvalidExpression() {}
1000 992
1001 DISALLOW_COPY_AND_ASSIGN(InvalidExpression); 993 DISALLOW_COPY_AND_ASSIGN(InvalidExpression);
1002 }; 994 };
1003 995
1004 996
1005 class VariableGet : public Expression { 997 class VariableGet : public Expression {
1006 public: 998 public:
1007 static VariableGet* ReadFrom(Reader* reader); 999 static VariableGet* ReadFrom(Reader* reader);
1008 static VariableGet* ReadFrom(Reader* reader, uint8_t payload); 1000 static VariableGet* ReadFrom(Reader* reader, uint8_t payload);
1009 1001
1010 virtual ~VariableGet(); 1002 virtual ~VariableGet();
1011 1003
1012 DEFINE_CASTING_OPERATIONS(VariableGet); 1004 DEFINE_CASTING_OPERATIONS(VariableGet);
1013 1005
1014 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1015
1016 VariableDeclaration* variable() { return variable_; } 1006 VariableDeclaration* variable() { return variable_; }
1017 1007
1018 private: 1008 private:
1019 VariableGet() {} 1009 VariableGet() {}
1020 1010
1021 Ref<VariableDeclaration> variable_; 1011 Ref<VariableDeclaration> variable_;
1022 intptr_t variable_kernel_offset_; 1012 intptr_t variable_kernel_offset_;
1023 1013
1024 DISALLOW_COPY_AND_ASSIGN(VariableGet); 1014 DISALLOW_COPY_AND_ASSIGN(VariableGet);
1025 }; 1015 };
1026 1016
1027 1017
1028 class VariableSet : public Expression { 1018 class VariableSet : public Expression {
1029 public: 1019 public:
1030 static VariableSet* ReadFrom(Reader* reader); 1020 static VariableSet* ReadFrom(Reader* reader);
1031 static VariableSet* ReadFrom(Reader* reader, uint8_t payload); 1021 static VariableSet* ReadFrom(Reader* reader, uint8_t payload);
1032 1022
1033 virtual ~VariableSet(); 1023 virtual ~VariableSet();
1034 1024
1035 DEFINE_CASTING_OPERATIONS(VariableSet); 1025 DEFINE_CASTING_OPERATIONS(VariableSet);
1036 1026
1037 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1038
1039 VariableDeclaration* variable() { return variable_; } 1027 VariableDeclaration* variable() { return variable_; }
1040 Expression* expression() { return expression_; } 1028 Expression* expression() { return expression_; }
1041 1029
1042 private: 1030 private:
1043 VariableSet() {} 1031 VariableSet() {}
1044 1032
1045 Ref<VariableDeclaration> variable_; 1033 Ref<VariableDeclaration> variable_;
1046 intptr_t variable_kernel_offset_; 1034 intptr_t variable_kernel_offset_;
1047 Child<Expression> expression_; 1035 Child<Expression> expression_;
1048 1036
1049 DISALLOW_COPY_AND_ASSIGN(VariableSet); 1037 DISALLOW_COPY_AND_ASSIGN(VariableSet);
1050 }; 1038 };
1051 1039
1052 1040
1053 class PropertyGet : public Expression { 1041 class PropertyGet : public Expression {
1054 public: 1042 public:
1055 static PropertyGet* ReadFrom(Reader* reader); 1043 static PropertyGet* ReadFrom(Reader* reader);
1056 1044
1057 virtual ~PropertyGet(); 1045 virtual ~PropertyGet();
1058 1046
1059 DEFINE_CASTING_OPERATIONS(PropertyGet); 1047 DEFINE_CASTING_OPERATIONS(PropertyGet);
1060 1048
1061 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1062
1063 Expression* receiver() { return receiver_; } 1049 Expression* receiver() { return receiver_; }
1064 Name* name() { return name_; } 1050 Name* name() { return name_; }
1065 1051
1066 private: 1052 private:
1067 PropertyGet() {} 1053 PropertyGet() {}
1068 1054
1069 NameIndex interface_target_reference_; 1055 NameIndex interface_target_reference_;
1070 Child<Expression> receiver_; 1056 Child<Expression> receiver_;
1071 Child<Name> name_; 1057 Child<Name> name_;
1072 1058
1073 DISALLOW_COPY_AND_ASSIGN(PropertyGet); 1059 DISALLOW_COPY_AND_ASSIGN(PropertyGet);
1074 }; 1060 };
1075 1061
1076 1062
1077 class PropertySet : public Expression { 1063 class PropertySet : public Expression {
1078 public: 1064 public:
1079 static PropertySet* ReadFrom(Reader* reader); 1065 static PropertySet* ReadFrom(Reader* reader);
1080 1066
1081 virtual ~PropertySet(); 1067 virtual ~PropertySet();
1082 1068
1083 DEFINE_CASTING_OPERATIONS(PropertySet); 1069 DEFINE_CASTING_OPERATIONS(PropertySet);
1084 1070
1085 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1086
1087 Expression* receiver() { return receiver_; } 1071 Expression* receiver() { return receiver_; }
1088 Name* name() { return name_; } 1072 Name* name() { return name_; }
1089 Expression* value() { return value_; } 1073 Expression* value() { return value_; }
1090 1074
1091 private: 1075 private:
1092 PropertySet() {} 1076 PropertySet() {}
1093 1077
1094 NameIndex interface_target_reference_; 1078 NameIndex interface_target_reference_;
1095 Child<Expression> receiver_; 1079 Child<Expression> receiver_;
1096 Child<Name> name_; 1080 Child<Name> name_;
1097 Child<Expression> value_; 1081 Child<Expression> value_;
1098 1082
1099 DISALLOW_COPY_AND_ASSIGN(PropertySet); 1083 DISALLOW_COPY_AND_ASSIGN(PropertySet);
1100 }; 1084 };
1101 1085
1102 1086
1103 class DirectPropertyGet : public Expression { 1087 class DirectPropertyGet : public Expression {
1104 public: 1088 public:
1105 static DirectPropertyGet* ReadFrom(Reader* reader); 1089 static DirectPropertyGet* ReadFrom(Reader* reader);
1106 1090
1107 virtual ~DirectPropertyGet(); 1091 virtual ~DirectPropertyGet();
1108 1092
1109 DEFINE_CASTING_OPERATIONS(DirectPropertyGet); 1093 DEFINE_CASTING_OPERATIONS(DirectPropertyGet);
1110 1094
1111 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1112
1113 Expression* receiver() { return receiver_; } 1095 Expression* receiver() { return receiver_; }
1114 NameIndex target() { return target_reference_; } 1096 NameIndex target() { return target_reference_; }
1115 1097
1116 private: 1098 private:
1117 DirectPropertyGet() {} 1099 DirectPropertyGet() {}
1118 1100
1119 NameIndex target_reference_; // Member canonical name. 1101 NameIndex target_reference_; // Member canonical name.
1120 Child<Expression> receiver_; 1102 Child<Expression> receiver_;
1121 1103
1122 DISALLOW_COPY_AND_ASSIGN(DirectPropertyGet); 1104 DISALLOW_COPY_AND_ASSIGN(DirectPropertyGet);
1123 }; 1105 };
1124 1106
1125 1107
1126 class DirectPropertySet : public Expression { 1108 class DirectPropertySet : public Expression {
1127 public: 1109 public:
1128 static DirectPropertySet* ReadFrom(Reader* reader); 1110 static DirectPropertySet* ReadFrom(Reader* reader);
1129 1111
1130 virtual ~DirectPropertySet(); 1112 virtual ~DirectPropertySet();
1131 1113
1132 DEFINE_CASTING_OPERATIONS(DirectPropertySet); 1114 DEFINE_CASTING_OPERATIONS(DirectPropertySet);
1133 1115
1134 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1135
1136 NameIndex target() { return target_reference_; } 1116 NameIndex target() { return target_reference_; }
1137 Expression* receiver() { return receiver_; } 1117 Expression* receiver() { return receiver_; }
1138 Expression* value() { return value_; } 1118 Expression* value() { return value_; }
1139 1119
1140 private: 1120 private:
1141 DirectPropertySet() {} 1121 DirectPropertySet() {}
1142 1122
1143 NameIndex target_reference_; // Member canonical name. 1123 NameIndex target_reference_; // Member canonical name.
1144 Child<Expression> receiver_; 1124 Child<Expression> receiver_;
1145 Child<Expression> value_; 1125 Child<Expression> value_;
1146 1126
1147 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet); 1127 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet);
1148 }; 1128 };
1149 1129
1150 1130
1151 class StaticGet : public Expression { 1131 class StaticGet : public Expression {
1152 public: 1132 public:
1153 static StaticGet* ReadFrom(Reader* reader); 1133 static StaticGet* ReadFrom(Reader* reader);
1154 1134
1155 virtual ~StaticGet(); 1135 virtual ~StaticGet();
1156 1136
1157 DEFINE_CASTING_OPERATIONS(StaticGet); 1137 DEFINE_CASTING_OPERATIONS(StaticGet);
1158 1138
1159 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1160
1161 NameIndex target() { return target_reference_; } 1139 NameIndex target() { return target_reference_; }
1162 1140
1163 private: 1141 private:
1164 StaticGet() {} 1142 StaticGet() {}
1165 1143
1166 NameIndex target_reference_; // Member canonical name. 1144 NameIndex target_reference_; // Member canonical name.
1167 1145
1168 DISALLOW_COPY_AND_ASSIGN(StaticGet); 1146 DISALLOW_COPY_AND_ASSIGN(StaticGet);
1169 }; 1147 };
1170 1148
1171 1149
1172 class StaticSet : public Expression { 1150 class StaticSet : public Expression {
1173 public: 1151 public:
1174 static StaticSet* ReadFrom(Reader* reader); 1152 static StaticSet* ReadFrom(Reader* reader);
1175 1153
1176 virtual ~StaticSet(); 1154 virtual ~StaticSet();
1177 1155
1178 DEFINE_CASTING_OPERATIONS(StaticSet); 1156 DEFINE_CASTING_OPERATIONS(StaticSet);
1179 1157
1180 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1181
1182 NameIndex target() { return target_reference_; } 1158 NameIndex target() { return target_reference_; }
1183 Expression* expression() { return expression_; } 1159 Expression* expression() { return expression_; }
1184 1160
1185 private: 1161 private:
1186 StaticSet() {} 1162 StaticSet() {}
1187 1163
1188 NameIndex target_reference_; // Member canonical name. 1164 NameIndex target_reference_; // Member canonical name.
1189 Child<Expression> expression_; 1165 Child<Expression> expression_;
1190 1166
1191 DISALLOW_COPY_AND_ASSIGN(StaticSet); 1167 DISALLOW_COPY_AND_ASSIGN(StaticSet);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 1219
1244 1220
1245 class MethodInvocation : public Expression { 1221 class MethodInvocation : public Expression {
1246 public: 1222 public:
1247 static MethodInvocation* ReadFrom(Reader* reader); 1223 static MethodInvocation* ReadFrom(Reader* reader);
1248 1224
1249 virtual ~MethodInvocation(); 1225 virtual ~MethodInvocation();
1250 1226
1251 DEFINE_CASTING_OPERATIONS(MethodInvocation); 1227 DEFINE_CASTING_OPERATIONS(MethodInvocation);
1252 1228
1253 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1254
1255 Expression* receiver() { return receiver_; } 1229 Expression* receiver() { return receiver_; }
1256 Name* name() { return name_; } 1230 Name* name() { return name_; }
1257 Arguments* arguments() { return arguments_; } 1231 Arguments* arguments() { return arguments_; }
1258 1232
1259 private: 1233 private:
1260 MethodInvocation() {} 1234 MethodInvocation() {}
1261 1235
1262 NameIndex interface_target_reference_; 1236 NameIndex interface_target_reference_;
1263 Child<Expression> receiver_; 1237 Child<Expression> receiver_;
1264 Child<Name> name_; 1238 Child<Name> name_;
1265 Child<Arguments> arguments_; 1239 Child<Arguments> arguments_;
1266 1240
1267 DISALLOW_COPY_AND_ASSIGN(MethodInvocation); 1241 DISALLOW_COPY_AND_ASSIGN(MethodInvocation);
1268 }; 1242 };
1269 1243
1270 1244
1271 class DirectMethodInvocation : public Expression { 1245 class DirectMethodInvocation : public Expression {
1272 public: 1246 public:
1273 static DirectMethodInvocation* ReadFrom(Reader* reader); 1247 static DirectMethodInvocation* ReadFrom(Reader* reader);
1274 1248
1275 virtual ~DirectMethodInvocation(); 1249 virtual ~DirectMethodInvocation();
1276 1250
1277 DEFINE_CASTING_OPERATIONS(DirectMethodInvocation); 1251 DEFINE_CASTING_OPERATIONS(DirectMethodInvocation);
1278 1252
1279 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1280
1281 Expression* receiver() { return receiver_; } 1253 Expression* receiver() { return receiver_; }
1282 NameIndex target() { return target_reference_; } 1254 NameIndex target() { return target_reference_; }
1283 Arguments* arguments() { return arguments_; } 1255 Arguments* arguments() { return arguments_; }
1284 1256
1285 private: 1257 private:
1286 DirectMethodInvocation() {} 1258 DirectMethodInvocation() {}
1287 1259
1288 NameIndex target_reference_; // Procedure canonical name. 1260 NameIndex target_reference_; // Procedure canonical name.
1289 Child<Expression> receiver_; 1261 Child<Expression> receiver_;
1290 Child<Arguments> arguments_; 1262 Child<Arguments> arguments_;
1291 1263
1292 DISALLOW_COPY_AND_ASSIGN(DirectMethodInvocation); 1264 DISALLOW_COPY_AND_ASSIGN(DirectMethodInvocation);
1293 }; 1265 };
1294 1266
1295 1267
1296 class StaticInvocation : public Expression { 1268 class StaticInvocation : public Expression {
1297 public: 1269 public:
1298 static StaticInvocation* ReadFrom(Reader* reader, bool is_const); 1270 static StaticInvocation* ReadFrom(Reader* reader, bool is_const);
1299 ~StaticInvocation(); 1271 ~StaticInvocation();
1300 1272
1301 DEFINE_CASTING_OPERATIONS(StaticInvocation); 1273 DEFINE_CASTING_OPERATIONS(StaticInvocation);
1302 1274
1303 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1304
1305 NameIndex procedure() { return procedure_reference_; } 1275 NameIndex procedure() { return procedure_reference_; }
1306 Arguments* arguments() { return arguments_; } 1276 Arguments* arguments() { return arguments_; }
1307 bool is_const() { return is_const_; } 1277 bool is_const() { return is_const_; }
1308 1278
1309 private: 1279 private:
1310 StaticInvocation() {} 1280 StaticInvocation() {}
1311 1281
1312 NameIndex procedure_reference_; // Procedure canonical name. 1282 NameIndex procedure_reference_; // Procedure canonical name.
1313 bool is_const_; 1283 bool is_const_;
1314 Child<Arguments> arguments_; 1284 Child<Arguments> arguments_;
1315 1285
1316 DISALLOW_COPY_AND_ASSIGN(StaticInvocation); 1286 DISALLOW_COPY_AND_ASSIGN(StaticInvocation);
1317 }; 1287 };
1318 1288
1319 1289
1320 class ConstructorInvocation : public Expression { 1290 class ConstructorInvocation : public Expression {
1321 public: 1291 public:
1322 static ConstructorInvocation* ReadFrom(Reader* reader, bool is_const); 1292 static ConstructorInvocation* ReadFrom(Reader* reader, bool is_const);
1323 1293
1324 virtual ~ConstructorInvocation(); 1294 virtual ~ConstructorInvocation();
1325 1295
1326 DEFINE_CASTING_OPERATIONS(ConstructorInvocation); 1296 DEFINE_CASTING_OPERATIONS(ConstructorInvocation);
1327 1297
1328 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1329
1330 bool is_const() { return is_const_; } 1298 bool is_const() { return is_const_; }
1331 NameIndex target() { return target_reference_; } 1299 NameIndex target() { return target_reference_; }
1332 Arguments* arguments() { return arguments_; } 1300 Arguments* arguments() { return arguments_; }
1333 1301
1334 private: 1302 private:
1335 ConstructorInvocation() {} 1303 ConstructorInvocation() {}
1336 1304
1337 bool is_const_; 1305 bool is_const_;
1338 NameIndex target_reference_; // Constructor canonical name. 1306 NameIndex target_reference_; // Constructor canonical name.
1339 Child<Arguments> arguments_; 1307 Child<Arguments> arguments_;
1340 1308
1341 DISALLOW_COPY_AND_ASSIGN(ConstructorInvocation); 1309 DISALLOW_COPY_AND_ASSIGN(ConstructorInvocation);
1342 }; 1310 };
1343 1311
1344 1312
1345 class Not : public Expression { 1313 class Not : public Expression {
1346 public: 1314 public:
1347 static Not* ReadFrom(Reader* reader); 1315 static Not* ReadFrom(Reader* reader);
1348 1316
1349 virtual ~Not(); 1317 virtual ~Not();
1350 1318
1351 DEFINE_CASTING_OPERATIONS(Not); 1319 DEFINE_CASTING_OPERATIONS(Not);
1352 1320
1353 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1354
1355 Expression* expression() { return expression_; } 1321 Expression* expression() { return expression_; }
1356 1322
1357 private: 1323 private:
1358 Not() {} 1324 Not() {}
1359 1325
1360 Child<Expression> expression_; 1326 Child<Expression> expression_;
1361 1327
1362 DISALLOW_COPY_AND_ASSIGN(Not); 1328 DISALLOW_COPY_AND_ASSIGN(Not);
1363 }; 1329 };
1364 1330
1365 1331
1366 class LogicalExpression : public Expression { 1332 class LogicalExpression : public Expression {
1367 public: 1333 public:
1368 enum Operator { kAnd, kOr }; 1334 enum Operator { kAnd, kOr };
1369 1335
1370 static LogicalExpression* ReadFrom(Reader* reader); 1336 static LogicalExpression* ReadFrom(Reader* reader);
1371 1337
1372 virtual ~LogicalExpression(); 1338 virtual ~LogicalExpression();
1373 1339
1374 DEFINE_CASTING_OPERATIONS(LogicalExpression); 1340 DEFINE_CASTING_OPERATIONS(LogicalExpression);
1375 1341
1376 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1377
1378 Expression* left() { return left_; } 1342 Expression* left() { return left_; }
1379 Operator op() { return operator_; } 1343 Operator op() { return operator_; }
1380 Expression* right() { return right_; } 1344 Expression* right() { return right_; }
1381 1345
1382 private: 1346 private:
1383 LogicalExpression() {} 1347 LogicalExpression() {}
1384 1348
1385 Child<Expression> left_; 1349 Child<Expression> left_;
1386 Operator operator_; 1350 Operator operator_;
1387 Child<Expression> right_; 1351 Child<Expression> right_;
1388 1352
1389 DISALLOW_COPY_AND_ASSIGN(LogicalExpression); 1353 DISALLOW_COPY_AND_ASSIGN(LogicalExpression);
1390 }; 1354 };
1391 1355
1392 1356
1393 class ConditionalExpression : public Expression { 1357 class ConditionalExpression : public Expression {
1394 public: 1358 public:
1395 static ConditionalExpression* ReadFrom(Reader* reader); 1359 static ConditionalExpression* ReadFrom(Reader* reader);
1396 1360
1397 virtual ~ConditionalExpression(); 1361 virtual ~ConditionalExpression();
1398 1362
1399 DEFINE_CASTING_OPERATIONS(ConditionalExpression); 1363 DEFINE_CASTING_OPERATIONS(ConditionalExpression);
1400 1364
1401 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1402
1403 Expression* condition() { return condition_; } 1365 Expression* condition() { return condition_; }
1404 Expression* then() { return then_; } 1366 Expression* then() { return then_; }
1405 Expression* otherwise() { return otherwise_; } 1367 Expression* otherwise() { return otherwise_; }
1406 1368
1407 private: 1369 private:
1408 ConditionalExpression() {} 1370 ConditionalExpression() {}
1409 1371
1410 Child<Expression> condition_; 1372 Child<Expression> condition_;
1411 Child<Expression> then_; 1373 Child<Expression> then_;
1412 Child<Expression> otherwise_; 1374 Child<Expression> otherwise_;
1413 1375
1414 DISALLOW_COPY_AND_ASSIGN(ConditionalExpression); 1376 DISALLOW_COPY_AND_ASSIGN(ConditionalExpression);
1415 }; 1377 };
1416 1378
1417 1379
1418 class StringConcatenation : public Expression { 1380 class StringConcatenation : public Expression {
1419 public: 1381 public:
1420 static StringConcatenation* ReadFrom(Reader* reader); 1382 static StringConcatenation* ReadFrom(Reader* reader);
1421 1383
1422 virtual ~StringConcatenation(); 1384 virtual ~StringConcatenation();
1423 1385
1424 DEFINE_CASTING_OPERATIONS(StringConcatenation); 1386 DEFINE_CASTING_OPERATIONS(StringConcatenation);
1425 1387
1426 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1427
1428 List<Expression>& expressions() { return expressions_; } 1388 List<Expression>& expressions() { return expressions_; }
1429 1389
1430 private: 1390 private:
1431 StringConcatenation() {} 1391 StringConcatenation() {}
1432 1392
1433 List<Expression> expressions_; 1393 List<Expression> expressions_;
1434 1394
1435 DISALLOW_COPY_AND_ASSIGN(StringConcatenation); 1395 DISALLOW_COPY_AND_ASSIGN(StringConcatenation);
1436 }; 1396 };
1437 1397
1438 1398
1439 class IsExpression : public Expression { 1399 class IsExpression : public Expression {
1440 public: 1400 public:
1441 static IsExpression* ReadFrom(Reader* reader); 1401 static IsExpression* ReadFrom(Reader* reader);
1442 1402
1443 virtual ~IsExpression(); 1403 virtual ~IsExpression();
1444 1404
1445 DEFINE_CASTING_OPERATIONS(IsExpression); 1405 DEFINE_CASTING_OPERATIONS(IsExpression);
1446 1406
1447 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1448
1449 Expression* operand() { return operand_; } 1407 Expression* operand() { return operand_; }
1450 DartType* type() { return type_; } 1408 DartType* type() { return type_; }
1451 1409
1452 private: 1410 private:
1453 IsExpression() {} 1411 IsExpression() {}
1454 1412
1455 Child<Expression> operand_; 1413 Child<Expression> operand_;
1456 Child<DartType> type_; 1414 Child<DartType> type_;
1457 1415
1458 DISALLOW_COPY_AND_ASSIGN(IsExpression); 1416 DISALLOW_COPY_AND_ASSIGN(IsExpression);
1459 }; 1417 };
1460 1418
1461 1419
1462 class AsExpression : public Expression { 1420 class AsExpression : public Expression {
1463 public: 1421 public:
1464 static AsExpression* ReadFrom(Reader* reader); 1422 static AsExpression* ReadFrom(Reader* reader);
1465 1423
1466 virtual ~AsExpression(); 1424 virtual ~AsExpression();
1467 1425
1468 DEFINE_CASTING_OPERATIONS(AsExpression); 1426 DEFINE_CASTING_OPERATIONS(AsExpression);
1469 1427
1470 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1471
1472 Expression* operand() { return operand_; } 1428 Expression* operand() { return operand_; }
1473 DartType* type() { return type_; } 1429 DartType* type() { return type_; }
1474 1430
1475 private: 1431 private:
1476 AsExpression() {} 1432 AsExpression() {}
1477 1433
1478 Child<Expression> operand_; 1434 Child<Expression> operand_;
1479 Child<DartType> type_; 1435 Child<DartType> type_;
1480 1436
1481 DISALLOW_COPY_AND_ASSIGN(AsExpression); 1437 DISALLOW_COPY_AND_ASSIGN(AsExpression);
1482 }; 1438 };
1483 1439
1484 1440
1485 class BasicLiteral : public Expression { 1441 class BasicLiteral : public Expression {
1486 public: 1442 public:
1487 virtual ~BasicLiteral(); 1443 virtual ~BasicLiteral();
1488 1444
1489 DEFINE_CASTING_OPERATIONS(BasicLiteral); 1445 DEFINE_CASTING_OPERATIONS(BasicLiteral);
1490 }; 1446 };
1491 1447
1492 1448
1493 class StringLiteral : public BasicLiteral { 1449 class StringLiteral : public BasicLiteral {
1494 public: 1450 public:
1495 static StringLiteral* ReadFrom(Reader* reader); 1451 static StringLiteral* ReadFrom(Reader* reader);
1496 1452
1497 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1498
1499 explicit StringLiteral(StringIndex string_index) 1453 explicit StringLiteral(StringIndex string_index)
1500 : value_index_(string_index) {} 1454 : value_index_(string_index) {}
1501 virtual ~StringLiteral(); 1455 virtual ~StringLiteral();
1502 1456
1503 DEFINE_CASTING_OPERATIONS(StringLiteral); 1457 DEFINE_CASTING_OPERATIONS(StringLiteral);
1504 1458
1505 StringIndex value() { return value_index_; } 1459 StringIndex value() { return value_index_; }
1506 1460
1507 protected: 1461 protected:
1508 StringLiteral() {} 1462 StringLiteral() {}
1509 1463
1510 StringIndex value_index_; 1464 StringIndex value_index_;
1511 1465
1512 private: 1466 private:
1513 DISALLOW_COPY_AND_ASSIGN(StringLiteral); 1467 DISALLOW_COPY_AND_ASSIGN(StringLiteral);
1514 }; 1468 };
1515 1469
1516 1470
1517 class BigintLiteral : public StringLiteral { 1471 class BigintLiteral : public StringLiteral {
1518 public: 1472 public:
1519 static BigintLiteral* ReadFrom(Reader* reader); 1473 static BigintLiteral* ReadFrom(Reader* reader);
1520 1474
1521 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1522
1523 explicit BigintLiteral(StringIndex string_index) 1475 explicit BigintLiteral(StringIndex string_index)
1524 : StringLiteral(string_index) {} 1476 : StringLiteral(string_index) {}
1525 virtual ~BigintLiteral(); 1477 virtual ~BigintLiteral();
1526 1478
1527 DEFINE_CASTING_OPERATIONS(BigintLiteral); 1479 DEFINE_CASTING_OPERATIONS(BigintLiteral);
1528 1480
1529 private: 1481 private:
1530 BigintLiteral() {} 1482 BigintLiteral() {}
1531 1483
1532 DISALLOW_COPY_AND_ASSIGN(BigintLiteral); 1484 DISALLOW_COPY_AND_ASSIGN(BigintLiteral);
1533 }; 1485 };
1534 1486
1535 1487
1536 class IntLiteral : public BasicLiteral { 1488 class IntLiteral : public BasicLiteral {
1537 public: 1489 public:
1538 static IntLiteral* ReadFrom(Reader* reader, bool is_negative); 1490 static IntLiteral* ReadFrom(Reader* reader, bool is_negative);
1539 static IntLiteral* ReadFrom(Reader* reader, uint8_t payload); 1491 static IntLiteral* ReadFrom(Reader* reader, uint8_t payload);
1540 1492
1541 virtual ~IntLiteral(); 1493 virtual ~IntLiteral();
1542 1494
1543 DEFINE_CASTING_OPERATIONS(IntLiteral); 1495 DEFINE_CASTING_OPERATIONS(IntLiteral);
1544 1496
1545 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1546
1547 int64_t value() { return value_; } 1497 int64_t value() { return value_; }
1548 1498
1549 private: 1499 private:
1550 IntLiteral() {} 1500 IntLiteral() {}
1551 1501
1552 int64_t value_; 1502 int64_t value_;
1553 1503
1554 DISALLOW_COPY_AND_ASSIGN(IntLiteral); 1504 DISALLOW_COPY_AND_ASSIGN(IntLiteral);
1555 }; 1505 };
1556 1506
1557 1507
1558 class DoubleLiteral : public BasicLiteral { 1508 class DoubleLiteral : public BasicLiteral {
1559 public: 1509 public:
1560 static DoubleLiteral* ReadFrom(Reader* reader); 1510 static DoubleLiteral* ReadFrom(Reader* reader);
1561 1511
1562 virtual ~DoubleLiteral(); 1512 virtual ~DoubleLiteral();
1563 1513
1564 DEFINE_CASTING_OPERATIONS(DoubleLiteral); 1514 DEFINE_CASTING_OPERATIONS(DoubleLiteral);
1565 1515
1566 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1567
1568 StringIndex value() { return value_index_; } 1516 StringIndex value() { return value_index_; }
1569 1517
1570 private: 1518 private:
1571 DoubleLiteral() {} 1519 DoubleLiteral() {}
1572 1520
1573 StringIndex value_index_; 1521 StringIndex value_index_;
1574 1522
1575 DISALLOW_COPY_AND_ASSIGN(DoubleLiteral); 1523 DISALLOW_COPY_AND_ASSIGN(DoubleLiteral);
1576 }; 1524 };
1577 1525
1578 1526
1579 class BoolLiteral : public BasicLiteral { 1527 class BoolLiteral : public BasicLiteral {
1580 public: 1528 public:
1581 static BoolLiteral* ReadFrom(Reader* reader, bool value); 1529 static BoolLiteral* ReadFrom(Reader* reader, bool value);
1582 1530
1583 virtual ~BoolLiteral(); 1531 virtual ~BoolLiteral();
1584 1532
1585 DEFINE_CASTING_OPERATIONS(BoolLiteral); 1533 DEFINE_CASTING_OPERATIONS(BoolLiteral);
1586 1534
1587 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1588
1589 bool value() { return value_; } 1535 bool value() { return value_; }
1590 1536
1591 private: 1537 private:
1592 BoolLiteral() {} 1538 BoolLiteral() {}
1593 1539
1594 bool value_; 1540 bool value_;
1595 1541
1596 DISALLOW_COPY_AND_ASSIGN(BoolLiteral); 1542 DISALLOW_COPY_AND_ASSIGN(BoolLiteral);
1597 }; 1543 };
1598 1544
1599 1545
1600 class NullLiteral : public BasicLiteral { 1546 class NullLiteral : public BasicLiteral {
1601 public: 1547 public:
1602 static NullLiteral* ReadFrom(Reader* reader); 1548 static NullLiteral* ReadFrom(Reader* reader);
1603 1549
1604 virtual ~NullLiteral(); 1550 virtual ~NullLiteral();
1605 1551
1606 DEFINE_CASTING_OPERATIONS(NullLiteral); 1552 DEFINE_CASTING_OPERATIONS(NullLiteral);
1607 1553
1608 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1609
1610 private: 1554 private:
1611 NullLiteral() {} 1555 NullLiteral() {}
1612 1556
1613 DISALLOW_COPY_AND_ASSIGN(NullLiteral); 1557 DISALLOW_COPY_AND_ASSIGN(NullLiteral);
1614 }; 1558 };
1615 1559
1616 1560
1617 class SymbolLiteral : public Expression { 1561 class SymbolLiteral : public Expression {
1618 public: 1562 public:
1619 static SymbolLiteral* ReadFrom(Reader* reader); 1563 static SymbolLiteral* ReadFrom(Reader* reader);
1620 1564
1621 virtual ~SymbolLiteral(); 1565 virtual ~SymbolLiteral();
1622 1566
1623 DEFINE_CASTING_OPERATIONS(SymbolLiteral); 1567 DEFINE_CASTING_OPERATIONS(SymbolLiteral);
1624 1568
1625 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1626
1627 StringIndex value() { return value_index_; } 1569 StringIndex value() { return value_index_; }
1628 1570
1629 private: 1571 private:
1630 SymbolLiteral() {} 1572 SymbolLiteral() {}
1631 1573
1632 StringIndex value_index_; 1574 StringIndex value_index_;
1633 1575
1634 DISALLOW_COPY_AND_ASSIGN(SymbolLiteral); 1576 DISALLOW_COPY_AND_ASSIGN(SymbolLiteral);
1635 }; 1577 };
1636 1578
1637 1579
1638 class TypeLiteral : public Expression { 1580 class TypeLiteral : public Expression {
1639 public: 1581 public:
1640 static TypeLiteral* ReadFrom(Reader* reader); 1582 static TypeLiteral* ReadFrom(Reader* reader);
1641 1583
1642 virtual ~TypeLiteral(); 1584 virtual ~TypeLiteral();
1643 1585
1644 DEFINE_CASTING_OPERATIONS(TypeLiteral); 1586 DEFINE_CASTING_OPERATIONS(TypeLiteral);
1645 1587
1646 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1647
1648 DartType* type() { return type_; } 1588 DartType* type() { return type_; }
1649 1589
1650 private: 1590 private:
1651 TypeLiteral() {} 1591 TypeLiteral() {}
1652 1592
1653 Child<DartType> type_; 1593 Child<DartType> type_;
1654 1594
1655 DISALLOW_COPY_AND_ASSIGN(TypeLiteral); 1595 DISALLOW_COPY_AND_ASSIGN(TypeLiteral);
1656 }; 1596 };
1657 1597
1658 1598
1659 class ThisExpression : public Expression { 1599 class ThisExpression : public Expression {
1660 public: 1600 public:
1661 static ThisExpression* ReadFrom(Reader* reader); 1601 static ThisExpression* ReadFrom(Reader* reader);
1662 1602
1663 virtual ~ThisExpression(); 1603 virtual ~ThisExpression();
1664 1604
1665 DEFINE_CASTING_OPERATIONS(ThisExpression); 1605 DEFINE_CASTING_OPERATIONS(ThisExpression);
1666 1606
1667 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1668
1669 private: 1607 private:
1670 ThisExpression() {} 1608 ThisExpression() {}
1671 1609
1672 DISALLOW_COPY_AND_ASSIGN(ThisExpression); 1610 DISALLOW_COPY_AND_ASSIGN(ThisExpression);
1673 }; 1611 };
1674 1612
1675 1613
1676 class Rethrow : public Expression { 1614 class Rethrow : public Expression {
1677 public: 1615 public:
1678 static Rethrow* ReadFrom(Reader* reader); 1616 static Rethrow* ReadFrom(Reader* reader);
1679 1617
1680 virtual ~Rethrow(); 1618 virtual ~Rethrow();
1681 1619
1682 DEFINE_CASTING_OPERATIONS(Rethrow); 1620 DEFINE_CASTING_OPERATIONS(Rethrow);
1683 1621
1684 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1685
1686 private: 1622 private:
1687 Rethrow() {} 1623 Rethrow() {}
1688 1624
1689 DISALLOW_COPY_AND_ASSIGN(Rethrow); 1625 DISALLOW_COPY_AND_ASSIGN(Rethrow);
1690 }; 1626 };
1691 1627
1692 1628
1693 class Throw : public Expression { 1629 class Throw : public Expression {
1694 public: 1630 public:
1695 static Throw* ReadFrom(Reader* reader); 1631 static Throw* ReadFrom(Reader* reader);
1696 1632
1697 virtual ~Throw(); 1633 virtual ~Throw();
1698 1634
1699 DEFINE_CASTING_OPERATIONS(Throw); 1635 DEFINE_CASTING_OPERATIONS(Throw);
1700 1636
1701 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1702
1703 Expression* expression() { return expression_; } 1637 Expression* expression() { return expression_; }
1704 1638
1705 private: 1639 private:
1706 Throw() {} 1640 Throw() {}
1707 1641
1708 Child<Expression> expression_; 1642 Child<Expression> expression_;
1709 1643
1710 DISALLOW_COPY_AND_ASSIGN(Throw); 1644 DISALLOW_COPY_AND_ASSIGN(Throw);
1711 }; 1645 };
1712 1646
1713 1647
1714 class ListLiteral : public Expression { 1648 class ListLiteral : public Expression {
1715 public: 1649 public:
1716 static ListLiteral* ReadFrom(Reader* reader, bool is_const); 1650 static ListLiteral* ReadFrom(Reader* reader, bool is_const);
1717 1651
1718 virtual ~ListLiteral(); 1652 virtual ~ListLiteral();
1719 1653
1720 DEFINE_CASTING_OPERATIONS(ListLiteral); 1654 DEFINE_CASTING_OPERATIONS(ListLiteral);
1721 1655
1722 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1723
1724 bool is_const() { return is_const_; } 1656 bool is_const() { return is_const_; }
1725 DartType* type() { return type_; } 1657 DartType* type() { return type_; }
1726 List<Expression>& expressions() { return expressions_; } 1658 List<Expression>& expressions() { return expressions_; }
1727 1659
1728 private: 1660 private:
1729 ListLiteral() {} 1661 ListLiteral() {}
1730 1662
1731 bool is_const_; 1663 bool is_const_;
1732 Child<DartType> type_; 1664 Child<DartType> type_;
1733 List<Expression> expressions_; 1665 List<Expression> expressions_;
1734 1666
1735 DISALLOW_COPY_AND_ASSIGN(ListLiteral); 1667 DISALLOW_COPY_AND_ASSIGN(ListLiteral);
1736 }; 1668 };
1737 1669
1738 1670
1739 class MapLiteral : public Expression { 1671 class MapLiteral : public Expression {
1740 public: 1672 public:
1741 static MapLiteral* ReadFrom(Reader* reader, bool is_const); 1673 static MapLiteral* ReadFrom(Reader* reader, bool is_const);
1742 1674
1743 virtual ~MapLiteral(); 1675 virtual ~MapLiteral();
1744 1676
1745 DEFINE_CASTING_OPERATIONS(MapLiteral); 1677 DEFINE_CASTING_OPERATIONS(MapLiteral);
1746 1678
1747 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1748
1749 bool is_const() { return is_const_; } 1679 bool is_const() { return is_const_; }
1750 DartType* key_type() { return key_type_; } 1680 DartType* key_type() { return key_type_; }
1751 DartType* value_type() { return value_type_; } 1681 DartType* value_type() { return value_type_; }
1752 List<MapEntry>& entries() { return entries_; } 1682 List<MapEntry>& entries() { return entries_; }
1753 1683
1754 private: 1684 private:
1755 MapLiteral() {} 1685 MapLiteral() {}
1756 1686
1757 bool is_const_; 1687 bool is_const_;
1758 Child<DartType> key_type_; 1688 Child<DartType> key_type_;
(...skipping 29 matching lines...) Expand all
1788 1718
1789 1719
1790 class AwaitExpression : public Expression { 1720 class AwaitExpression : public Expression {
1791 public: 1721 public:
1792 static AwaitExpression* ReadFrom(Reader* reader); 1722 static AwaitExpression* ReadFrom(Reader* reader);
1793 1723
1794 virtual ~AwaitExpression(); 1724 virtual ~AwaitExpression();
1795 1725
1796 DEFINE_CASTING_OPERATIONS(AwaitExpression); 1726 DEFINE_CASTING_OPERATIONS(AwaitExpression);
1797 1727
1798 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1799
1800 Expression* operand() { return operand_; } 1728 Expression* operand() { return operand_; }
1801 1729
1802 private: 1730 private:
1803 AwaitExpression() {} 1731 AwaitExpression() {}
1804 1732
1805 Child<Expression> operand_; 1733 Child<Expression> operand_;
1806 1734
1807 DISALLOW_COPY_AND_ASSIGN(AwaitExpression); 1735 DISALLOW_COPY_AND_ASSIGN(AwaitExpression);
1808 }; 1736 };
1809 1737
1810 1738
1811 class FunctionExpression : public Expression { 1739 class FunctionExpression : public Expression {
1812 public: 1740 public:
1813 static FunctionExpression* ReadFrom(Reader* reader); 1741 static FunctionExpression* ReadFrom(Reader* reader);
1814 1742
1815 virtual ~FunctionExpression(); 1743 virtual ~FunctionExpression();
1816 1744
1817 DEFINE_CASTING_OPERATIONS(FunctionExpression); 1745 DEFINE_CASTING_OPERATIONS(FunctionExpression);
1818 1746
1819 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1820
1821 FunctionNode* function() { return function_; } 1747 FunctionNode* function() { return function_; }
1822 1748
1823 private: 1749 private:
1824 FunctionExpression() {} 1750 FunctionExpression() {}
1825 1751
1826 Child<FunctionNode> function_; 1752 Child<FunctionNode> function_;
1827 1753
1828 DISALLOW_COPY_AND_ASSIGN(FunctionExpression); 1754 DISALLOW_COPY_AND_ASSIGN(FunctionExpression);
1829 }; 1755 };
1830 1756
1831 1757
1832 class Let : public Expression { 1758 class Let : public Expression {
1833 public: 1759 public:
1834 static Let* ReadFrom(Reader* reader); 1760 static Let* ReadFrom(Reader* reader);
1835 1761
1836 virtual ~Let(); 1762 virtual ~Let();
1837 1763
1838 DEFINE_CASTING_OPERATIONS(Let); 1764 DEFINE_CASTING_OPERATIONS(Let);
1839 1765
1840 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1841
1842 VariableDeclaration* variable() { return variable_; } 1766 VariableDeclaration* variable() { return variable_; }
1843 Expression* body() { return body_; } 1767 Expression* body() { return body_; }
1844 TokenPosition position() { return position_; } 1768 TokenPosition position() { return position_; }
1845 TokenPosition end_position() { return end_position_; } 1769 TokenPosition end_position() { return end_position_; }
1846 1770
1847 private: 1771 private:
1848 Let() 1772 Let()
1849 : position_(TokenPosition::kNoSource), 1773 : position_(TokenPosition::kNoSource),
1850 end_position_(TokenPosition::kNoSource) {} 1774 end_position_(TokenPosition::kNoSource) {}
1851 1775
1852 Child<VariableDeclaration> variable_; 1776 Child<VariableDeclaration> variable_;
1853 Child<Expression> body_; 1777 Child<Expression> body_;
1854 TokenPosition position_; 1778 TokenPosition position_;
1855 TokenPosition end_position_; 1779 TokenPosition end_position_;
1856 1780
1857 DISALLOW_COPY_AND_ASSIGN(Let); 1781 DISALLOW_COPY_AND_ASSIGN(Let);
1858 }; 1782 };
1859 1783
1860 1784
1861 class VectorCreation : public Expression { 1785 class VectorCreation : public Expression {
1862 public: 1786 public:
1863 static VectorCreation* ReadFrom(Reader* reader); 1787 static VectorCreation* ReadFrom(Reader* reader);
1864 1788
1865 virtual ~VectorCreation(); 1789 virtual ~VectorCreation();
1866 1790
1867 DEFINE_CASTING_OPERATIONS(VectorCreation); 1791 DEFINE_CASTING_OPERATIONS(VectorCreation);
1868 1792
1869 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1870
1871 intptr_t value() { return value_; } 1793 intptr_t value() { return value_; }
1872 1794
1873 private: 1795 private:
1874 VectorCreation() {} 1796 VectorCreation() {}
1875 1797
1876 intptr_t value_; 1798 intptr_t value_;
1877 1799
1878 DISALLOW_COPY_AND_ASSIGN(VectorCreation); 1800 DISALLOW_COPY_AND_ASSIGN(VectorCreation);
1879 }; 1801 };
1880 1802
1881 1803
1882 class VectorGet : public Expression { 1804 class VectorGet : public Expression {
1883 public: 1805 public:
1884 static VectorGet* ReadFrom(Reader* reader); 1806 static VectorGet* ReadFrom(Reader* reader);
1885 1807
1886 virtual ~VectorGet(); 1808 virtual ~VectorGet();
1887 1809
1888 DEFINE_CASTING_OPERATIONS(VectorGet); 1810 DEFINE_CASTING_OPERATIONS(VectorGet);
1889 1811
1890 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1891
1892 Expression* vector_expression() { return vector_expression_; } 1812 Expression* vector_expression() { return vector_expression_; }
1893 intptr_t index() { return index_; } 1813 intptr_t index() { return index_; }
1894 1814
1895 private: 1815 private:
1896 VectorGet() {} 1816 VectorGet() {}
1897 1817
1898 Child<Expression> vector_expression_; 1818 Child<Expression> vector_expression_;
1899 intptr_t index_; 1819 intptr_t index_;
1900 1820
1901 DISALLOW_COPY_AND_ASSIGN(VectorGet); 1821 DISALLOW_COPY_AND_ASSIGN(VectorGet);
1902 }; 1822 };
1903 1823
1904 1824
1905 class VectorSet : public Expression { 1825 class VectorSet : public Expression {
1906 public: 1826 public:
1907 static VectorSet* ReadFrom(Reader* reader); 1827 static VectorSet* ReadFrom(Reader* reader);
1908 1828
1909 virtual ~VectorSet(); 1829 virtual ~VectorSet();
1910 1830
1911 DEFINE_CASTING_OPERATIONS(VectorSet); 1831 DEFINE_CASTING_OPERATIONS(VectorSet);
1912 1832
1913 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1914
1915 Expression* vector_expression() { return vector_expression_; } 1833 Expression* vector_expression() { return vector_expression_; }
1916 intptr_t index() { return index_; } 1834 intptr_t index() { return index_; }
1917 Expression* value() { return value_; } 1835 Expression* value() { return value_; }
1918 1836
1919 private: 1837 private:
1920 VectorSet() {} 1838 VectorSet() {}
1921 1839
1922 Child<Expression> vector_expression_; 1840 Child<Expression> vector_expression_;
1923 intptr_t index_; 1841 intptr_t index_;
1924 Child<Expression> value_; 1842 Child<Expression> value_;
1925 1843
1926 DISALLOW_COPY_AND_ASSIGN(VectorSet); 1844 DISALLOW_COPY_AND_ASSIGN(VectorSet);
1927 }; 1845 };
1928 1846
1929 1847
1930 class VectorCopy : public Expression { 1848 class VectorCopy : public Expression {
1931 public: 1849 public:
1932 static VectorCopy* ReadFrom(Reader* reader); 1850 static VectorCopy* ReadFrom(Reader* reader);
1933 1851
1934 virtual ~VectorCopy(); 1852 virtual ~VectorCopy();
1935 1853
1936 DEFINE_CASTING_OPERATIONS(VectorCopy); 1854 DEFINE_CASTING_OPERATIONS(VectorCopy);
1937 1855
1938 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1939
1940 Expression* vector_expression() { return vector_expression_; } 1856 Expression* vector_expression() { return vector_expression_; }
1941 1857
1942 private: 1858 private:
1943 VectorCopy() {} 1859 VectorCopy() {}
1944 1860
1945 Child<Expression> vector_expression_; 1861 Child<Expression> vector_expression_;
1946 1862
1947 DISALLOW_COPY_AND_ASSIGN(VectorCopy); 1863 DISALLOW_COPY_AND_ASSIGN(VectorCopy);
1948 }; 1864 };
1949 1865
1950 1866
1951 class ClosureCreation : public Expression { 1867 class ClosureCreation : public Expression {
1952 public: 1868 public:
1953 static ClosureCreation* ReadFrom(Reader* reader); 1869 static ClosureCreation* ReadFrom(Reader* reader);
1954 1870
1955 virtual ~ClosureCreation(); 1871 virtual ~ClosureCreation();
1956 1872
1957 DEFINE_CASTING_OPERATIONS(ClosureCreation); 1873 DEFINE_CASTING_OPERATIONS(ClosureCreation);
1958 1874
1959 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor);
1960
1961 NameIndex top_level_function() { return top_level_function_reference_; } 1875 NameIndex top_level_function() { return top_level_function_reference_; }
1962 Expression* context_vector() { return context_vector_; } 1876 Expression* context_vector() { return context_vector_; }
1963 FunctionType* function_type() { return function_type_; } 1877 FunctionType* function_type() { return function_type_; }
1964 1878
1965 private: 1879 private:
1966 ClosureCreation() {} 1880 ClosureCreation() {}
1967 1881
1968 NameIndex top_level_function_reference_; // Procedure canonical name. 1882 NameIndex top_level_function_reference_; // Procedure canonical name.
1969 Child<Expression> context_vector_; 1883 Child<Expression> context_vector_;
1970 Child<FunctionType> function_type_; 1884 Child<FunctionType> function_type_;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
2530 2444
2531 2445
2532 class DartType : public Node { 2446 class DartType : public Node {
2533 public: 2447 public:
2534 static DartType* ReadFrom(Reader* reader); 2448 static DartType* ReadFrom(Reader* reader);
2535 2449
2536 virtual ~DartType(); 2450 virtual ~DartType();
2537 2451
2538 DEFINE_CASTING_OPERATIONS(DartType); 2452 DEFINE_CASTING_OPERATIONS(DartType);
2539 2453
2540 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor) = 0;
2541
2542 protected: 2454 protected:
2543 DartType() {} 2455 DartType() {}
2544 2456
2545 private: 2457 private:
2546 DISALLOW_COPY_AND_ASSIGN(DartType); 2458 DISALLOW_COPY_AND_ASSIGN(DartType);
2547 }; 2459 };
2548 2460
2549 2461
2550 class InvalidType : public DartType { 2462 class InvalidType : public DartType {
2551 public: 2463 public:
2552 static InvalidType* ReadFrom(Reader* reader); 2464 static InvalidType* ReadFrom(Reader* reader);
2553 2465
2554 virtual ~InvalidType(); 2466 virtual ~InvalidType();
2555 2467
2556 DEFINE_CASTING_OPERATIONS(InvalidType); 2468 DEFINE_CASTING_OPERATIONS(InvalidType);
2557 2469
2558 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2559
2560 private: 2470 private:
2561 InvalidType() {} 2471 InvalidType() {}
2562 2472
2563 DISALLOW_COPY_AND_ASSIGN(InvalidType); 2473 DISALLOW_COPY_AND_ASSIGN(InvalidType);
2564 }; 2474 };
2565 2475
2566 2476
2567 class DynamicType : public DartType { 2477 class DynamicType : public DartType {
2568 public: 2478 public:
2569 static DynamicType* ReadFrom(Reader* reader); 2479 static DynamicType* ReadFrom(Reader* reader);
2570 2480
2571 virtual ~DynamicType(); 2481 virtual ~DynamicType();
2572 2482
2573 DEFINE_CASTING_OPERATIONS(DynamicType); 2483 DEFINE_CASTING_OPERATIONS(DynamicType);
2574 2484
2575 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2576
2577 private: 2485 private:
2578 DynamicType() {} 2486 DynamicType() {}
2579 2487
2580 DISALLOW_COPY_AND_ASSIGN(DynamicType); 2488 DISALLOW_COPY_AND_ASSIGN(DynamicType);
2581 }; 2489 };
2582 2490
2583 2491
2584 class VoidType : public DartType { 2492 class VoidType : public DartType {
2585 public: 2493 public:
2586 static VoidType* ReadFrom(Reader* reader); 2494 static VoidType* ReadFrom(Reader* reader);
2587 2495
2588 virtual ~VoidType(); 2496 virtual ~VoidType();
2589 2497
2590 DEFINE_CASTING_OPERATIONS(VoidType); 2498 DEFINE_CASTING_OPERATIONS(VoidType);
2591 2499
2592 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2593
2594 private: 2500 private:
2595 VoidType() {} 2501 VoidType() {}
2596 2502
2597 DISALLOW_COPY_AND_ASSIGN(VoidType); 2503 DISALLOW_COPY_AND_ASSIGN(VoidType);
2598 }; 2504 };
2599 2505
2600 2506
2601 class BottomType : public DartType { 2507 class BottomType : public DartType {
2602 public: 2508 public:
2603 static BottomType* ReadFrom(Reader* reader); 2509 static BottomType* ReadFrom(Reader* reader);
2604 2510
2605 virtual ~BottomType(); 2511 virtual ~BottomType();
2606 2512
2607 DEFINE_CASTING_OPERATIONS(BottomType); 2513 DEFINE_CASTING_OPERATIONS(BottomType);
2608 2514
2609 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2610
2611 private: 2515 private:
2612 BottomType() {} 2516 BottomType() {}
2613 2517
2614 DISALLOW_COPY_AND_ASSIGN(BottomType); 2518 DISALLOW_COPY_AND_ASSIGN(BottomType);
2615 }; 2519 };
2616 2520
2617 2521
2618 class InterfaceType : public DartType { 2522 class InterfaceType : public DartType {
2619 public: 2523 public:
2620 static InterfaceType* ReadFrom(Reader* reader); 2524 static InterfaceType* ReadFrom(Reader* reader);
2621 static InterfaceType* ReadFrom(Reader* reader, bool _without_type_arguments_); 2525 static InterfaceType* ReadFrom(Reader* reader, bool _without_type_arguments_);
2622 2526
2623 explicit InterfaceType(NameIndex class_reference) 2527 explicit InterfaceType(NameIndex class_reference)
2624 : class_reference_(class_reference) {} 2528 : class_reference_(class_reference) {}
2625 virtual ~InterfaceType(); 2529 virtual ~InterfaceType();
2626 2530
2627 DEFINE_CASTING_OPERATIONS(InterfaceType); 2531 DEFINE_CASTING_OPERATIONS(InterfaceType);
2628 2532
2629 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2630
2631 NameIndex klass() { return class_reference_; } 2533 NameIndex klass() { return class_reference_; }
2632 List<DartType>& type_arguments() { return type_arguments_; } 2534 List<DartType>& type_arguments() { return type_arguments_; }
2633 2535
2634 private: 2536 private:
2635 InterfaceType() {} 2537 InterfaceType() {}
2636 2538
2637 NameIndex class_reference_; // Class canonical name. 2539 NameIndex class_reference_; // Class canonical name.
2638 List<DartType> type_arguments_; 2540 List<DartType> type_arguments_;
2639 2541
2640 DISALLOW_COPY_AND_ASSIGN(InterfaceType); 2542 DISALLOW_COPY_AND_ASSIGN(InterfaceType);
2641 }; 2543 };
2642 2544
2643 2545
2644 class TypedefType : public DartType { 2546 class TypedefType : public DartType {
2645 public: 2547 public:
2646 static TypedefType* ReadFrom(Reader* reader); 2548 static TypedefType* ReadFrom(Reader* reader);
2647 2549
2648 explicit TypedefType(NameIndex class_reference) 2550 explicit TypedefType(NameIndex class_reference)
2649 : typedef_reference_(class_reference) {} 2551 : typedef_reference_(class_reference) {}
2650 virtual ~TypedefType(); 2552 virtual ~TypedefType();
2651 2553
2652 DEFINE_CASTING_OPERATIONS(TypedefType); 2554 DEFINE_CASTING_OPERATIONS(TypedefType);
2653 2555
2654 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2655
2656 NameIndex typedef_reference() { return typedef_reference_; } 2556 NameIndex typedef_reference() { return typedef_reference_; }
2657 List<DartType>& type_arguments() { return type_arguments_; } 2557 List<DartType>& type_arguments() { return type_arguments_; }
2658 2558
2659 private: 2559 private:
2660 TypedefType() {} 2560 TypedefType() {}
2661 2561
2662 NameIndex typedef_reference_; // Typedef canonical name. 2562 NameIndex typedef_reference_; // Typedef canonical name.
2663 List<DartType> type_arguments_; 2563 List<DartType> type_arguments_;
2664 2564
2665 DISALLOW_COPY_AND_ASSIGN(TypedefType); 2565 DISALLOW_COPY_AND_ASSIGN(TypedefType);
(...skipping 22 matching lines...) Expand all
2688 2588
2689 class FunctionType : public DartType { 2589 class FunctionType : public DartType {
2690 public: 2590 public:
2691 static FunctionType* ReadFrom(Reader* reader); 2591 static FunctionType* ReadFrom(Reader* reader);
2692 static FunctionType* ReadFrom(Reader* reader, bool _without_type_arguments_); 2592 static FunctionType* ReadFrom(Reader* reader, bool _without_type_arguments_);
2693 2593
2694 virtual ~FunctionType(); 2594 virtual ~FunctionType();
2695 2595
2696 DEFINE_CASTING_OPERATIONS(FunctionType); 2596 DEFINE_CASTING_OPERATIONS(FunctionType);
2697 2597
2698 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2699
2700 TypeParameterList& type_parameters() { return type_parameters_; } 2598 TypeParameterList& type_parameters() { return type_parameters_; }
2701 int required_parameter_count() { return required_parameter_count_; } 2599 int required_parameter_count() { return required_parameter_count_; }
2702 List<DartType>& positional_parameters() { return positional_parameters_; } 2600 List<DartType>& positional_parameters() { return positional_parameters_; }
2703 List<NamedParameter>& named_parameters() { return named_parameters_; } 2601 List<NamedParameter>& named_parameters() { return named_parameters_; }
2704 DartType* return_type() { return return_type_; } 2602 DartType* return_type() { return return_type_; }
2705 2603
2706 private: 2604 private:
2707 FunctionType() {} 2605 FunctionType() {}
2708 2606
2709 TypeParameterList type_parameters_; 2607 TypeParameterList type_parameters_;
2710 int required_parameter_count_; 2608 int required_parameter_count_;
2711 List<DartType> positional_parameters_; 2609 List<DartType> positional_parameters_;
2712 List<NamedParameter> named_parameters_; 2610 List<NamedParameter> named_parameters_;
2713 Child<DartType> return_type_; 2611 Child<DartType> return_type_;
2714 2612
2715 DISALLOW_COPY_AND_ASSIGN(FunctionType); 2613 DISALLOW_COPY_AND_ASSIGN(FunctionType);
2716 }; 2614 };
2717 2615
2718 2616
2719 class TypeParameterType : public DartType { 2617 class TypeParameterType : public DartType {
2720 public: 2618 public:
2721 static TypeParameterType* ReadFrom(Reader* reader); 2619 static TypeParameterType* ReadFrom(Reader* reader);
2722 2620
2723 virtual ~TypeParameterType(); 2621 virtual ~TypeParameterType();
2724 2622
2725 DEFINE_CASTING_OPERATIONS(TypeParameterType); 2623 DEFINE_CASTING_OPERATIONS(TypeParameterType);
2726 2624
2727 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2728
2729 TypeParameter* parameter() { return parameter_; } 2625 TypeParameter* parameter() { return parameter_; }
2730 2626
2731 private: 2627 private:
2732 TypeParameterType() {} 2628 TypeParameterType() {}
2733 2629
2734 Ref<TypeParameter> parameter_; 2630 Ref<TypeParameter> parameter_;
2735 2631
2736 DISALLOW_COPY_AND_ASSIGN(TypeParameterType); 2632 DISALLOW_COPY_AND_ASSIGN(TypeParameterType);
2737 }; 2633 };
2738 2634
2739 2635
2740 class VectorType : public DartType { 2636 class VectorType : public DartType {
2741 public: 2637 public:
2742 static VectorType* ReadFrom(Reader* reader); 2638 static VectorType* ReadFrom(Reader* reader);
2743 2639
2744 virtual ~VectorType(); 2640 virtual ~VectorType();
2745 2641
2746 DEFINE_CASTING_OPERATIONS(VectorType); 2642 DEFINE_CASTING_OPERATIONS(VectorType);
2747 2643
2748 virtual void AcceptDartTypeVisitor(DartTypeVisitor* visitor);
2749
2750 private: 2644 private:
2751 VectorType() {} 2645 VectorType() {}
2752 2646
2753 DISALLOW_COPY_AND_ASSIGN(VectorType); 2647 DISALLOW_COPY_AND_ASSIGN(VectorType);
2754 }; 2648 };
2755 2649
2756 2650
2757 class TypeParameter : public TreeNode { 2651 class TypeParameter : public TreeNode {
2758 public: 2652 public:
2759 TypeParameter* ReadFrom(Reader* reader); 2653 TypeParameter* ReadFrom(Reader* reader);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
2815 class Reference : public AllStatic { 2709 class Reference : public AllStatic {
2816 public: 2710 public:
2817 // Read canonical name references. 2711 // Read canonical name references.
2818 static NameIndex ReadMemberFrom(Reader* reader, bool allow_null = false); 2712 static NameIndex ReadMemberFrom(Reader* reader, bool allow_null = false);
2819 static NameIndex ReadClassFrom(Reader* reader, bool allow_null = false); 2713 static NameIndex ReadClassFrom(Reader* reader, bool allow_null = false);
2820 static NameIndex ReadTypedefFrom(Reader* reader); 2714 static NameIndex ReadTypedefFrom(Reader* reader);
2821 static NameIndex ReadLibraryFrom(Reader* reader); 2715 static NameIndex ReadLibraryFrom(Reader* reader);
2822 }; 2716 };
2823 2717
2824 2718
2825 class ExpressionVisitor {
2826 public:
2827 virtual ~ExpressionVisitor() {}
2828
2829 virtual void VisitDefaultExpression(Expression* node) = 0;
2830 virtual void VisitDefaultBasicLiteral(BasicLiteral* node) {
2831 VisitDefaultExpression(node);
2832 }
2833 virtual void VisitInvalidExpression(InvalidExpression* node) {
2834 VisitDefaultExpression(node);
2835 }
2836 virtual void VisitVariableGet(VariableGet* node) {
2837 VisitDefaultExpression(node);
2838 }
2839 virtual void VisitVariableSet(VariableSet* node) {
2840 VisitDefaultExpression(node);
2841 }
2842 virtual void VisitPropertyGet(PropertyGet* node) {
2843 VisitDefaultExpression(node);
2844 }
2845 virtual void VisitPropertySet(PropertySet* node) {
2846 VisitDefaultExpression(node);
2847 }
2848 virtual void VisitDirectPropertyGet(DirectPropertyGet* node) {
2849 VisitDefaultExpression(node);
2850 }
2851 virtual void VisitDirectPropertySet(DirectPropertySet* node) {
2852 VisitDefaultExpression(node);
2853 }
2854 virtual void VisitStaticGet(StaticGet* node) { VisitDefaultExpression(node); }
2855 virtual void VisitStaticSet(StaticSet* node) { VisitDefaultExpression(node); }
2856 virtual void VisitMethodInvocation(MethodInvocation* node) {
2857 VisitDefaultExpression(node);
2858 }
2859 virtual void VisitDirectMethodInvocation(DirectMethodInvocation* node) {
2860 VisitDefaultExpression(node);
2861 }
2862 virtual void VisitStaticInvocation(StaticInvocation* node) {
2863 VisitDefaultExpression(node);
2864 }
2865 virtual void VisitConstructorInvocation(ConstructorInvocation* node) {
2866 VisitDefaultExpression(node);
2867 }
2868 virtual void VisitNot(Not* node) { VisitDefaultExpression(node); }
2869 virtual void VisitLogicalExpression(LogicalExpression* node) {
2870 VisitDefaultExpression(node);
2871 }
2872 virtual void VisitConditionalExpression(ConditionalExpression* node) {
2873 VisitDefaultExpression(node);
2874 }
2875 virtual void VisitStringConcatenation(StringConcatenation* node) {
2876 VisitDefaultExpression(node);
2877 }
2878 virtual void VisitIsExpression(IsExpression* node) {
2879 VisitDefaultExpression(node);
2880 }
2881 virtual void VisitAsExpression(AsExpression* node) {
2882 VisitDefaultExpression(node);
2883 }
2884 virtual void VisitSymbolLiteral(SymbolLiteral* node) {
2885 VisitDefaultExpression(node);
2886 }
2887 virtual void VisitTypeLiteral(TypeLiteral* node) {
2888 VisitDefaultExpression(node);
2889 }
2890 virtual void VisitThisExpression(ThisExpression* node) {
2891 VisitDefaultExpression(node);
2892 }
2893 virtual void VisitRethrow(Rethrow* node) { VisitDefaultExpression(node); }
2894 virtual void VisitThrow(Throw* node) { VisitDefaultExpression(node); }
2895 virtual void VisitListLiteral(ListLiteral* node) {
2896 VisitDefaultExpression(node);
2897 }
2898 virtual void VisitMapLiteral(MapLiteral* node) {
2899 VisitDefaultExpression(node);
2900 }
2901 virtual void VisitAwaitExpression(AwaitExpression* node) {
2902 VisitDefaultExpression(node);
2903 }
2904 virtual void VisitFunctionExpression(FunctionExpression* node) {
2905 VisitDefaultExpression(node);
2906 }
2907 virtual void VisitStringLiteral(StringLiteral* node) {
2908 VisitDefaultBasicLiteral(node);
2909 }
2910 virtual void VisitBigintLiteral(BigintLiteral* node) {
2911 VisitDefaultBasicLiteral(node);
2912 }
2913 virtual void VisitIntLiteral(IntLiteral* node) {
2914 VisitDefaultBasicLiteral(node);
2915 }
2916 virtual void VisitDoubleLiteral(DoubleLiteral* node) {
2917 VisitDefaultBasicLiteral(node);
2918 }
2919 virtual void VisitBoolLiteral(BoolLiteral* node) {
2920 VisitDefaultBasicLiteral(node);
2921 }
2922 virtual void VisitNullLiteral(NullLiteral* node) {
2923 VisitDefaultBasicLiteral(node);
2924 }
2925 virtual void VisitLet(Let* node) { VisitDefaultExpression(node); }
2926 virtual void VisitVectorCreation(VectorCreation* node) {
2927 VisitDefaultExpression(node);
2928 }
2929 virtual void VisitVectorGet(VectorGet* node) { VisitDefaultExpression(node); }
2930 virtual void VisitVectorSet(VectorSet* node) { VisitDefaultExpression(node); }
2931 virtual void VisitVectorCopy(VectorCopy* node) {
2932 VisitDefaultExpression(node);
2933 }
2934 virtual void VisitClosureCreation(ClosureCreation* node) {
2935 VisitDefaultExpression(node);
2936 }
2937 };
2938
2939
2940 class DartTypeVisitor {
2941 public:
2942 virtual ~DartTypeVisitor() {}
2943
2944 virtual void VisitDefaultDartType(DartType* node) = 0;
2945 virtual void VisitInvalidType(InvalidType* node) {
2946 VisitDefaultDartType(node);
2947 }
2948 virtual void VisitDynamicType(DynamicType* node) {
2949 VisitDefaultDartType(node);
2950 }
2951 virtual void VisitVoidType(VoidType* node) { VisitDefaultDartType(node); }
2952 virtual void VisitBottomType(BottomType* node) { VisitDefaultDartType(node); }
2953 virtual void VisitInterfaceType(InterfaceType* node) {
2954 VisitDefaultDartType(node);
2955 }
2956 virtual void VisitFunctionType(FunctionType* node) {
2957 VisitDefaultDartType(node);
2958 }
2959 virtual void VisitTypeParameterType(TypeParameterType* node) {
2960 VisitDefaultDartType(node);
2961 }
2962 virtual void VisitVectorType(VectorType* node) { VisitDefaultDartType(node); }
2963 virtual void VisitTypedefType(TypedefType* node) {
2964 VisitDefaultDartType(node);
2965 }
2966 };
2967
2968
2969 template <typename T> 2719 template <typename T>
2970 List<T>::~List() { 2720 List<T>::~List() {
2971 for (int i = 0; i < length_; i++) { 2721 for (int i = 0; i < length_; i++) {
2972 delete array_[i]; 2722 delete array_[i];
2973 } 2723 }
2974 delete[] array_; 2724 delete[] array_;
2975 } 2725 }
2976 2726
2977 2727
2978 template <typename T> 2728 template <typename T>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
3038 } // namespace kernel 2788 } // namespace kernel
3039 2789
3040 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, 2790 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
3041 intptr_t buffer_length); 2791 intptr_t buffer_length);
3042 2792
3043 2793
3044 } // namespace dart 2794 } // namespace dart
3045 2795
3046 #endif // !defined(DART_PRECOMPILED_RUNTIME) 2796 #endif // !defined(DART_PRECOMPILED_RUNTIME)
3047 #endif // RUNTIME_VM_KERNEL_H_ 2797 #endif // RUNTIME_VM_KERNEL_H_
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_nocore.cc ('k') | runtime/vm/kernel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698