| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 VM_DART_API_MESSAGE_H_ | 5 #ifndef VM_DART_API_MESSAGE_H_ |
| 6 #define VM_DART_API_MESSAGE_H_ | 6 #define VM_DART_API_MESSAGE_H_ |
| 7 | 7 |
| 8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
| 9 #include "vm/snapshot.h" | 9 #include "vm/snapshot.h" |
| 10 | 10 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 ApiGrowableArray<BackRefNode*> backward_references_; | 112 ApiGrowableArray<BackRefNode*> backward_references_; |
| 113 Dart_CObject** vm_symbol_references_; | 113 Dart_CObject** vm_symbol_references_; |
| 114 | 114 |
| 115 Dart_CObject type_arguments_marker; | 115 Dart_CObject type_arguments_marker; |
| 116 Dart_CObject dynamic_type_marker; | 116 Dart_CObject dynamic_type_marker; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 | 119 |
| 120 class ApiMessageWriter : public BaseWriter { | 120 class ApiMessageWriter : public BaseWriter { |
| 121 public: | 121 public: |
| 122 static const intptr_t kIncrementSize = 512; | 122 static const intptr_t kInitialSize = 512; |
| 123 ApiMessageWriter(uint8_t** buffer, ReAlloc alloc) | 123 ApiMessageWriter(uint8_t** buffer, ReAlloc alloc) |
| 124 : BaseWriter(buffer, alloc, kIncrementSize), object_id_(0), | 124 : BaseWriter(buffer, alloc, kInitialSize), |
| 125 forward_list_(NULL), forward_list_length_(0), forward_id_(0) { | 125 object_id_(0), forward_list_(NULL), |
| 126 forward_list_length_(0), forward_id_(0) { |
| 126 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes - 1); | 127 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes - 1); |
| 127 } | 128 } |
| 128 ~ApiMessageWriter() { | 129 ~ApiMessageWriter() { |
| 129 ::free(forward_list_); | 130 ::free(forward_list_); |
| 130 } | 131 } |
| 131 | 132 |
| 132 // Writes a message of integers. | 133 // Writes a message of integers. |
| 133 void WriteMessage(intptr_t field_count, intptr_t *data); | 134 void WriteMessage(intptr_t field_count, intptr_t *data); |
| 134 | 135 |
| 135 // Writes a message with a single object. | 136 // Writes a message with a single object. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 163 Dart_CObject** forward_list_; | 164 Dart_CObject** forward_list_; |
| 164 intptr_t forward_list_length_; | 165 intptr_t forward_list_length_; |
| 165 intptr_t forward_id_; | 166 intptr_t forward_id_; |
| 166 | 167 |
| 167 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter); | 168 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter); |
| 168 }; | 169 }; |
| 169 | 170 |
| 170 } // namespace dart | 171 } // namespace dart |
| 171 | 172 |
| 172 #endif // VM_DART_API_MESSAGE_H_ | 173 #endif // VM_DART_API_MESSAGE_H_ |
| OLD | NEW |