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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 AsyncMarker dart_async_marker() { return dart_async_marker_; } | 928 AsyncMarker dart_async_marker() { return dart_async_marker_; } |
929 TypeParameterList& type_parameters() { return type_parameters_; } | 929 TypeParameterList& type_parameters() { return type_parameters_; } |
930 int required_parameter_count() { return required_parameter_count_; } | 930 int required_parameter_count() { return required_parameter_count_; } |
931 List<VariableDeclaration>& positional_parameters() { | 931 List<VariableDeclaration>& positional_parameters() { |
932 return positional_parameters_; | 932 return positional_parameters_; |
933 } | 933 } |
934 List<VariableDeclaration>& named_parameters() { return named_parameters_; } | 934 List<VariableDeclaration>& named_parameters() { return named_parameters_; } |
935 DartType* return_type() { return return_type_; } | 935 DartType* return_type() { return return_type_; } |
936 | 936 |
937 Statement* body() { return body_; } | 937 Statement* body() { return body_; } |
938 void ReplaceBody(Statement* body) { | 938 void ReplaceBody(Statement* body); |
939 delete body_; | |
940 // Use static_cast to invoke the conversion function and so avoid triggering | |
941 // ASSERT(pointer_ == NULL) in operator= when overwriting a non-NULL body. | |
942 static_cast<Statement*&>(body_) = body; | |
943 } | |
944 | 939 |
945 TokenPosition position() { return position_; } | 940 TokenPosition position() { return position_; } |
946 TokenPosition end_position() { return end_position_; } | 941 TokenPosition end_position() { return end_position_; } |
947 | 942 |
948 private: | 943 private: |
949 FunctionNode() | 944 FunctionNode() |
950 : position_(TokenPosition::kNoSource), | 945 : position_(TokenPosition::kNoSource), |
951 end_position_(TokenPosition::kNoSource) {} | 946 end_position_(TokenPosition::kNoSource) {} |
952 | 947 |
953 AsyncMarker async_marker_; | 948 AsyncMarker async_marker_; |
(...skipping 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3341 } // namespace kernel | 3336 } // namespace kernel |
3342 | 3337 |
3343 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3338 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
3344 intptr_t buffer_length); | 3339 intptr_t buffer_length); |
3345 | 3340 |
3346 | 3341 |
3347 } // namespace dart | 3342 } // namespace dart |
3348 | 3343 |
3349 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3344 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
3350 #endif // RUNTIME_VM_KERNEL_H_ | 3345 #endif // RUNTIME_VM_KERNEL_H_ |
OLD | NEW |