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

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

Issue 9303031: Add support for lists and backward references when decoding a message to a Dart_CObject object (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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/snapshot.cc » ('j') | runtime/vm/snapshot.cc » ('J')
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_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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 // Allocates a Dart_CObject object for string data on the C heap. 442 // Allocates a Dart_CObject object for string data on the C heap.
443 Dart_CObject* AllocateDartCObjectString(intptr_t length); 443 Dart_CObject* AllocateDartCObjectString(intptr_t length);
444 // Allocates a C array of Dart_CObject objects on the C heap. 444 // Allocates a C array of Dart_CObject objects on the C heap.
445 Dart_CObject* AllocateDartCObjectArray(intptr_t length); 445 Dart_CObject* AllocateDartCObjectArray(intptr_t length);
446 446
447 intptr_t LookupInternalClass(intptr_t class_header); 447 intptr_t LookupInternalClass(intptr_t class_header);
448 Dart_CObject* ReadInlinedObject(intptr_t object_id); 448 Dart_CObject* ReadInlinedObject(intptr_t object_id);
449 Dart_CObject* ReadObjectImpl(intptr_t header); 449 Dart_CObject* ReadObjectImpl(intptr_t header);
450 Dart_CObject* ReadIndexedObject(intptr_t object_id); 450 Dart_CObject* ReadIndexedObject(intptr_t object_id);
451 451
452 // Add object to backward references.
453 void AddBackwardReference(intptr_t id, Dart_CObject* obj);
454
452 Dart_CObject_Internal* AsInternal(Dart_CObject* object) { 455 Dart_CObject_Internal* AsInternal(Dart_CObject* object) {
453 ASSERT(object->type >= Dart_CObject::kNumberOfTypes); 456 ASSERT(object->type >= Dart_CObject::kNumberOfTypes);
454 return reinterpret_cast<Dart_CObject_Internal*>(object); 457 return reinterpret_cast<Dart_CObject_Internal*>(object);
455 } 458 }
456 459
457 ReAlloc alloc_; 460 ReAlloc alloc_;
461 GrowableArray<Dart_CObject*> backward_references_;
458 462
459 Dart_CObject type_arguments_marker; 463 Dart_CObject type_arguments_marker;
460 Dart_CObject dynamic_type_marker; 464 Dart_CObject dynamic_type_marker;
461 }; 465 };
462 466
463 467
464 class BaseWriter { 468 class BaseWriter {
465 public: 469 public:
466 // Size of the snapshot. 470 // Size of the snapshot.
467 intptr_t BytesWritten() const { return stream_.bytes_written(); } 471 intptr_t BytesWritten() const { return stream_.bytes_written(); }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 633
630 private: 634 private:
631 SnapshotWriter* writer_; 635 SnapshotWriter* writer_;
632 636
633 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); 637 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor);
634 }; 638 };
635 639
636 } // namespace dart 640 } // namespace dart
637 641
638 #endif // VM_SNAPSHOT_H_ 642 #endif // VM_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/snapshot.cc » ('j') | runtime/vm/snapshot.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698