Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: runtime/vm/dart_api_message.h

Issue 387993007: 5% smaller snapshots by omitting object ids when possible (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart_api_message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "vm/dart_api_state.h" 9 #include "vm/dart_api_state.h"
10 #include "vm/snapshot.h" 10 #include "vm/snapshot.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 Dart_CObject* ReadVMSymbol(intptr_t object_id); 113 Dart_CObject* ReadVMSymbol(intptr_t object_id);
114 Dart_CObject* ReadObjectRef(); 114 Dart_CObject* ReadObjectRef();
115 Dart_CObject* ReadObject(); 115 Dart_CObject* ReadObject();
116 116
117 // Add object to backward references. 117 // Add object to backward references.
118 void AddBackRef(intptr_t id, Dart_CObject* obj, DeserializeState state); 118 void AddBackRef(intptr_t id, Dart_CObject* obj, DeserializeState state);
119 119
120 // Get an object from the backward references list. 120 // Get an object from the backward references list.
121 Dart_CObject* GetBackRef(intptr_t id); 121 Dart_CObject* GetBackRef(intptr_t id);
122 122
123 intptr_t NextAvailableObjectId() const;
124
123 Dart_CObject_Internal* AsInternal(Dart_CObject* object) { 125 Dart_CObject_Internal* AsInternal(Dart_CObject* object) {
124 ASSERT(object->type >= Dart_CObject_kNumberOfTypes); 126 ASSERT(object->type >= Dart_CObject_kNumberOfTypes);
125 return reinterpret_cast<Dart_CObject_Internal*>(object); 127 return reinterpret_cast<Dart_CObject_Internal*>(object);
126 } 128 }
127 129
128 // Allocation of the structures for the decoded message happens 130 // Allocation of the structures for the decoded message happens
129 // either in the supplied zone or using the supplied allocation 131 // either in the supplied zone or using the supplied allocation
130 // function. 132 // function.
131 ReAlloc alloc_; 133 ReAlloc alloc_;
132 ApiGrowableArray<BackRefNode*> backward_references_; 134 ApiGrowableArray<BackRefNode*> backward_references_;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 Dart_CObject** forward_list_; 186 Dart_CObject** forward_list_;
185 intptr_t forward_list_length_; 187 intptr_t forward_list_length_;
186 intptr_t forward_id_; 188 intptr_t forward_id_;
187 189
188 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter); 190 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter);
189 }; 191 };
190 192
191 } // namespace dart 193 } // namespace dart
192 194
193 #endif // VM_DART_API_MESSAGE_H_ 195 #endif // VM_DART_API_MESSAGE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698