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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 ReAlloc alloc_; | 105 ReAlloc alloc_; |
106 ApiGrowableArray<BackRefNode*> backward_references_; | 106 ApiGrowableArray<BackRefNode*> backward_references_; |
107 | 107 |
108 Dart_CObject type_arguments_marker; | 108 Dart_CObject type_arguments_marker; |
109 Dart_CObject dynamic_type_marker; | 109 Dart_CObject dynamic_type_marker; |
110 }; | 110 }; |
111 | 111 |
112 | 112 |
113 class ApiMessageWriter : public BaseWriter { | 113 class ApiMessageWriter : public BaseWriter { |
114 public: | 114 public: |
| 115 static const intptr_t kIncrementSize = 512; |
115 ApiMessageWriter(uint8_t** buffer, ReAlloc alloc) | 116 ApiMessageWriter(uint8_t** buffer, ReAlloc alloc) |
116 : BaseWriter(buffer, alloc), object_id_(0), | 117 : BaseWriter(buffer, alloc, kIncrementSize), object_id_(0), |
117 forward_list_(NULL), forward_list_length_(0), forward_id_(0) { | 118 forward_list_(NULL), forward_list_length_(0), forward_id_(0) { |
118 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes - 1); | 119 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes - 1); |
119 } | 120 } |
120 ~ApiMessageWriter() { | 121 ~ApiMessageWriter() { |
121 ::free(forward_list_); | 122 ::free(forward_list_); |
122 } | 123 } |
123 | 124 |
124 // Writes a message of integers. | 125 // Writes a message of integers. |
125 void WriteMessage(intptr_t field_count, intptr_t *data); | 126 void WriteMessage(intptr_t field_count, intptr_t *data); |
126 | 127 |
(...skipping 28 matching lines...) Expand all Loading... |
155 Dart_CObject** forward_list_; | 156 Dart_CObject** forward_list_; |
156 intptr_t forward_list_length_; | 157 intptr_t forward_list_length_; |
157 intptr_t forward_id_; | 158 intptr_t forward_id_; |
158 | 159 |
159 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter); | 160 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter); |
160 }; | 161 }; |
161 | 162 |
162 } // namespace dart | 163 } // namespace dart |
163 | 164 |
164 #endif // VM_DART_API_MESSAGE_H_ | 165 #endif // VM_DART_API_MESSAGE_H_ |
OLD | NEW |