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 set_body(Statement* body) { body_ = 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 } |
939 | 944 |
940 TokenPosition position() { return position_; } | 945 TokenPosition position() { return position_; } |
941 TokenPosition end_position() { return end_position_; } | 946 TokenPosition end_position() { return end_position_; } |
942 | 947 |
943 private: | 948 private: |
944 FunctionNode() | 949 FunctionNode() |
945 : position_(TokenPosition::kNoSource), | 950 : position_(TokenPosition::kNoSource), |
946 end_position_(TokenPosition::kNoSource) {} | 951 end_position_(TokenPosition::kNoSource) {} |
947 | 952 |
948 AsyncMarker async_marker_; | 953 AsyncMarker async_marker_; |
(...skipping 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3336 } // namespace kernel | 3341 } // namespace kernel |
3337 | 3342 |
3338 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 3343 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
3339 intptr_t buffer_length); | 3344 intptr_t buffer_length); |
3340 | 3345 |
3341 | 3346 |
3342 } // namespace dart | 3347 } // namespace dart |
3343 | 3348 |
3344 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 3349 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
3345 #endif // RUNTIME_VM_KERNEL_H_ | 3350 #endif // RUNTIME_VM_KERNEL_H_ |
OLD | NEW |