OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef RUNTIME_VM_KERNEL_H_ | 5 #ifndef RUNTIME_VM_KERNEL_H_ |
6 #define RUNTIME_VM_KERNEL_H_ | 6 #define RUNTIME_VM_KERNEL_H_ |
7 | 7 |
8 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 bool is_referenced() { return is_referenced_; } | 392 bool is_referenced() { return is_referenced_; } |
393 void set_referenced(bool referenced) { is_referenced_ = referenced; } | 393 void set_referenced(bool referenced) { is_referenced_ = referenced; } |
394 | 394 |
395 CanonicalName* AddChild(String* string); | 395 CanonicalName* AddChild(String* string); |
396 | 396 |
397 static CanonicalName* NewRoot(); | 397 static CanonicalName* NewRoot(); |
398 | 398 |
399 private: | 399 private: |
400 CanonicalName(); | 400 CanonicalName(); |
401 | 401 |
| 402 CanonicalName* parent_; |
| 403 String* name_; |
| 404 MallocGrowableArray<CanonicalName*> children_; |
402 bool is_referenced_; | 405 bool is_referenced_; |
403 Ref<CanonicalName> parent_; | |
404 Ref<String> name_; | |
405 MallocGrowableArray<CanonicalName*> children_; | |
406 | 406 |
407 DISALLOW_COPY_AND_ASSIGN(CanonicalName); | 407 DISALLOW_COPY_AND_ASSIGN(CanonicalName); |
408 }; | 408 }; |
409 | 409 |
410 | 410 |
411 class Node { | 411 class Node { |
412 public: | 412 public: |
413 virtual ~Node(); | 413 virtual ~Node(); |
414 | 414 |
415 enum NodeType { | 415 enum NodeType { |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 | 948 |
949 AsyncMarker async_marker() { return async_marker_; } | 949 AsyncMarker async_marker() { return async_marker_; } |
950 AsyncMarker dart_async_marker() { return dart_async_marker_; } | 950 AsyncMarker dart_async_marker() { return dart_async_marker_; } |
951 TypeParameterList& type_parameters() { return type_parameters_; } | 951 TypeParameterList& type_parameters() { return type_parameters_; } |
952 int required_parameter_count() { return required_parameter_count_; } | 952 int required_parameter_count() { return required_parameter_count_; } |
953 List<VariableDeclaration>& positional_parameters() { | 953 List<VariableDeclaration>& positional_parameters() { |
954 return positional_parameters_; | 954 return positional_parameters_; |
955 } | 955 } |
956 List<VariableDeclaration>& named_parameters() { return named_parameters_; } | 956 List<VariableDeclaration>& named_parameters() { return named_parameters_; } |
957 DartType* return_type() { return return_type_; } | 957 DartType* return_type() { return return_type_; } |
| 958 |
958 Statement* body() { return body_; } | 959 Statement* body() { return body_; } |
| 960 void set_body(Statement* body) { body_ = body; } |
| 961 |
959 TokenPosition position() { return position_; } | 962 TokenPosition position() { return position_; } |
960 TokenPosition end_position() { return end_position_; } | 963 TokenPosition end_position() { return end_position_; } |
961 | 964 |
962 private: | 965 private: |
963 FunctionNode() | 966 FunctionNode() |
964 : position_(TokenPosition::kNoSource), | 967 : position_(TokenPosition::kNoSource), |
965 end_position_(TokenPosition::kNoSource) {} | 968 end_position_(TokenPosition::kNoSource) {} |
966 | 969 |
967 AsyncMarker async_marker_; | 970 AsyncMarker async_marker_; |
968 AsyncMarker dart_async_marker_; | 971 AsyncMarker dart_async_marker_; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 Child<Expression> receiver_; | 1167 Child<Expression> receiver_; |
1165 Ref<CanonicalName> target_reference_; // Member. | 1168 Ref<CanonicalName> target_reference_; // Member. |
1166 Child<Expression> value_; | 1169 Child<Expression> value_; |
1167 | 1170 |
1168 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet); | 1171 DISALLOW_COPY_AND_ASSIGN(DirectPropertySet); |
1169 }; | 1172 }; |
1170 | 1173 |
1171 | 1174 |
1172 class StaticGet : public Expression { | 1175 class StaticGet : public Expression { |
1173 public: | 1176 public: |
| 1177 explicit StaticGet(CanonicalName* target) : target_reference_(target) {} |
| 1178 |
1174 static StaticGet* ReadFrom(Reader* reader); | 1179 static StaticGet* ReadFrom(Reader* reader); |
1175 | 1180 |
1176 virtual ~StaticGet(); | 1181 virtual ~StaticGet(); |
1177 | 1182 |
1178 DEFINE_CASTING_OPERATIONS(StaticGet); | 1183 DEFINE_CASTING_OPERATIONS(StaticGet); |
1179 | 1184 |
1180 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); | 1185 virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
1181 virtual void VisitChildren(Visitor* visitor); | 1186 virtual void VisitChildren(Visitor* visitor); |
1182 | 1187 |
1183 CanonicalName* target() { return target_reference_; } | 1188 CanonicalName* target() { return target_reference_; } |
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 Child<Expression> condition_; | 2417 Child<Expression> condition_; |
2413 Child<Statement> then_; | 2418 Child<Statement> then_; |
2414 Child<Statement> otherwise_; | 2419 Child<Statement> otherwise_; |
2415 | 2420 |
2416 DISALLOW_COPY_AND_ASSIGN(IfStatement); | 2421 DISALLOW_COPY_AND_ASSIGN(IfStatement); |
2417 }; | 2422 }; |
2418 | 2423 |
2419 | 2424 |
2420 class ReturnStatement : public Statement { | 2425 class ReturnStatement : public Statement { |
2421 public: | 2426 public: |
| 2427 explicit ReturnStatement(Expression* expression) : expression_(expression) {} |
| 2428 |
2422 static ReturnStatement* ReadFrom(Reader* reader); | 2429 static ReturnStatement* ReadFrom(Reader* reader); |
2423 | 2430 |
2424 virtual ~ReturnStatement(); | 2431 virtual ~ReturnStatement(); |
2425 | 2432 |
2426 DEFINE_CASTING_OPERATIONS(ReturnStatement); | 2433 DEFINE_CASTING_OPERATIONS(ReturnStatement); |
2427 | 2434 |
2428 virtual void AcceptStatementVisitor(StatementVisitor* visitor); | 2435 virtual void AcceptStatementVisitor(StatementVisitor* visitor); |
2429 virtual void VisitChildren(Visitor* visitor); | 2436 virtual void VisitChildren(Visitor* visitor); |
2430 | 2437 |
2431 Expression* expression() { return expression_; } | 2438 Expression* expression() { return expression_; } |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3283 } // namespace kernel | 3290 } // namespace kernel |
3284 | 3291 |
3285 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3292 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
3286 intptr_t buffer_length); | 3293 intptr_t buffer_length); |
3287 | 3294 |
3288 | 3295 |
3289 } // namespace dart | 3296 } // namespace dart |
3290 | 3297 |
3291 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3298 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
3292 #endif // RUNTIME_VM_KERNEL_H_ | 3299 #endif // RUNTIME_VM_KERNEL_H_ |
OLD | NEW |