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

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

Issue 9104041: Added API Dart_PostCMessage for posting a Dart_CMessage structure (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
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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 528
529 private: 529 private:
530 WriteStream stream_; 530 WriteStream stream_;
531 531
532 DISALLOW_IMPLICIT_CONSTRUCTORS(BaseWriter); 532 DISALLOW_IMPLICIT_CONSTRUCTORS(BaseWriter);
533 }; 533 };
534 534
535 535
536 class MessageWriter : public BaseWriter { 536 class MessageWriter : public BaseWriter {
537 public: 537 public:
538 MessageWriter(uint8_t** buffer, ReAlloc alloc) : BaseWriter(buffer, alloc) { 538 MessageWriter(uint8_t** buffer, ReAlloc alloc) : BaseWriter(buffer, alloc),
539 object_id_(0) {
539 } 540 }
540 ~MessageWriter() { } 541 ~MessageWriter() { }
541 542
542 // Writes a message of integers. 543 // Writes a message of integers.
543 void WriteMessage(intptr_t field_count, intptr_t *data); 544 void WriteMessage(intptr_t field_count, intptr_t *data);
544 545
546 void WriteCMessage(Dart_CObject* object);
547
545 void FinalizeBuffer() { 548 void FinalizeBuffer() {
546 BaseWriter::FinalizeBuffer(Snapshot::kMessage); 549 BaseWriter::FinalizeBuffer(Snapshot::kMessage);
547 } 550 }
548 551
549 private: 552 private:
553 void WriteSmi(int32_t value);
554 void WriteCObject(Dart_CObject* object);
555
556 intptr_t object_id_;
557
550 DISALLOW_COPY_AND_ASSIGN(MessageWriter); 558 DISALLOW_COPY_AND_ASSIGN(MessageWriter);
551 }; 559 };
552 560
553 561
554 class SnapshotWriter : public BaseWriter { 562 class SnapshotWriter : public BaseWriter {
555 public: 563 public:
556 SnapshotWriter(Snapshot::Kind kind, uint8_t** buffer, ReAlloc alloc) 564 SnapshotWriter(Snapshot::Kind kind, uint8_t** buffer, ReAlloc alloc)
557 : BaseWriter(buffer, alloc), 565 : BaseWriter(buffer, alloc),
558 kind_(kind), 566 kind_(kind),
559 object_store_(Isolate::Current()->object_store()), 567 object_store_(Isolate::Current()->object_store()),
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 646
639 private: 647 private:
640 SnapshotWriter* writer_; 648 SnapshotWriter* writer_;
641 649
642 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); 650 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor);
643 }; 651 };
644 652
645 } // namespace dart 653 } // namespace dart
646 654
647 #endif // VM_SNAPSHOT_H_ 655 #endif // VM_SNAPSHOT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698