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

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

Issue 1151523002: VM-internalize the default Map implementation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Ready for review. Created 5 years, 7 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
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_SNAPSHOT_H_ 5 #ifndef VM_SNAPSHOT_H_
6 #define VM_SNAPSHOT_H_ 6 #define VM_SNAPSHOT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/bitfield.h" 10 #include "vm/bitfield.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 class RawType; 70 class RawType;
71 class RawTypeArguments; 71 class RawTypeArguments;
72 class RawTypedData; 72 class RawTypedData;
73 class RawTypeParameter; 73 class RawTypeParameter;
74 class RawTypeRef; 74 class RawTypeRef;
75 class RawUnhandledException; 75 class RawUnhandledException;
76 class RawUnresolvedClass; 76 class RawUnresolvedClass;
77 class String; 77 class String;
78 class TokenStream; 78 class TokenStream;
79 class TypeArguments; 79 class TypeArguments;
80 class TypedData;
80 class UnhandledException; 81 class UnhandledException;
81 82
82 // Serialized object header encoding is as follows: 83 // Serialized object header encoding is as follows:
83 // - Smi: the Smi value is written as is (last bit is not tagged). 84 // - Smi: the Smi value is written as is (last bit is not tagged).
84 // - VM object (from VM isolate): (object id in vm isolate | 0x3) 85 // - VM object (from VM isolate): (object id in vm isolate | 0x3)
85 // This valus is serialized as a negative number. 86 // This valus is serialized as a negative number.
86 // (note VM objects are never serialized they are expected to be found 87 // (note VM objects are never serialized they are expected to be found
87 // using ths unique ID assigned to them). 88 // using ths unique ID assigned to them).
88 // - Reference to object that has already been written: (object id | 0x3) 89 // - Reference to object that has already been written: (object id | 0x3)
89 // This valus is serialized as a positive number. 90 // This valus is serialized as a positive number.
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 ObjectStore* object_store() const { return isolate_->object_store(); } 269 ObjectStore* object_store() const { return isolate_->object_store(); }
269 ClassTable* class_table() const { return isolate_->class_table(); } 270 ClassTable* class_table() const { return isolate_->class_table(); }
270 PassiveObject* PassiveObjectHandle() { return &pobj_; } 271 PassiveObject* PassiveObjectHandle() { return &pobj_; }
271 Array* ArrayHandle() { return &array_; } 272 Array* ArrayHandle() { return &array_; }
272 String* StringHandle() { return &str_; } 273 String* StringHandle() { return &str_; }
273 AbstractType* TypeHandle() { return &type_; } 274 AbstractType* TypeHandle() { return &type_; }
274 TypeArguments* TypeArgumentsHandle() { return &type_arguments_; } 275 TypeArguments* TypeArgumentsHandle() { return &type_arguments_; }
275 Array* TokensHandle() { return &tokens_; } 276 Array* TokensHandle() { return &tokens_; }
276 TokenStream* StreamHandle() { return &stream_; } 277 TokenStream* StreamHandle() { return &stream_; }
277 ExternalTypedData* DataHandle() { return &data_; } 278 ExternalTypedData* DataHandle() { return &data_; }
279 TypedData* TypedDataHandle() { return &typed_data_; }
278 Snapshot::Kind kind() const { return kind_; } 280 Snapshot::Kind kind() const { return kind_; }
279 281
280 // Reads an object. 282 // Reads an object.
281 RawObject* ReadObject(); 283 RawObject* ReadObject();
282 284
283 // Add object to backward references. 285 // Add object to backward references.
284 void AddBackRef(intptr_t id, Object* obj, DeserializeState state); 286 void AddBackRef(intptr_t id, Object* obj, DeserializeState state);
285 287
286 // Get an object from the backward references list. 288 // Get an object from the backward references list.
287 Object* GetBackRef(intptr_t id); 289 Object* GetBackRef(intptr_t id);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 PassiveObject& pobj_; // Temporary PassiveObject handle. 395 PassiveObject& pobj_; // Temporary PassiveObject handle.
394 Array& array_; // Temporary Array handle. 396 Array& array_; // Temporary Array handle.
395 Field& field_; // Temporary Field handle. 397 Field& field_; // Temporary Field handle.
396 String& str_; // Temporary String handle. 398 String& str_; // Temporary String handle.
397 Library& library_; // Temporary library handle. 399 Library& library_; // Temporary library handle.
398 AbstractType& type_; // Temporary type handle. 400 AbstractType& type_; // Temporary type handle.
399 TypeArguments& type_arguments_; // Temporary type argument handle. 401 TypeArguments& type_arguments_; // Temporary type argument handle.
400 Array& tokens_; // Temporary tokens handle. 402 Array& tokens_; // Temporary tokens handle.
401 TokenStream& stream_; // Temporary token stream handle. 403 TokenStream& stream_; // Temporary token stream handle.
402 ExternalTypedData& data_; // Temporary stream data handle. 404 ExternalTypedData& data_; // Temporary stream data handle.
405 TypedData& typed_data_; // Temporary typed data handle.
403 UnhandledException& error_; // Error handle. 406 UnhandledException& error_; // Error handle.
404 intptr_t max_vm_isolate_object_id_; 407 intptr_t max_vm_isolate_object_id_;
405 ZoneGrowableArray<BackRefNode>* backward_references_; 408 ZoneGrowableArray<BackRefNode>* backward_references_;
406 409
407 friend class ApiError; 410 friend class ApiError;
408 friend class Array; 411 friend class Array;
409 friend class BoundedType; 412 friend class BoundedType;
410 friend class MixinAppType; 413 friend class MixinAppType;
411 friend class Class; 414 friend class Class;
412 friend class Context; 415 friend class Context;
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 private: 848 private:
846 SnapshotWriter* writer_; 849 SnapshotWriter* writer_;
847 bool as_references_; 850 bool as_references_;
848 851
849 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); 852 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor);
850 }; 853 };
851 854
852 } // namespace dart 855 } // namespace dart
853 856
854 #endif // VM_SNAPSHOT_H_ 857 #endif // VM_SNAPSHOT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698