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

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

Issue 9348048: Add support for medium integers to the native message format (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ 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 | « runtime/vm/dart_api_message.cc ('k') | runtime/vm/snapshot.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_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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 WriteStream stream_; 464 WriteStream stream_;
465 465
466 DISALLOW_IMPLICIT_CONSTRUCTORS(BaseWriter); 466 DISALLOW_IMPLICIT_CONSTRUCTORS(BaseWriter);
467 }; 467 };
468 468
469 469
470 class MessageWriter : public BaseWriter { 470 class MessageWriter : public BaseWriter {
471 public: 471 public:
472 MessageWriter(uint8_t** buffer, ReAlloc alloc) 472 MessageWriter(uint8_t** buffer, ReAlloc alloc)
473 : BaseWriter(buffer, alloc), object_id_(0) { 473 : BaseWriter(buffer, alloc), object_id_(0) {
474 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes); 474 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes - 1);
475 } 475 }
476 ~MessageWriter() { } 476 ~MessageWriter() { }
477 477
478 // Writes a message of integers. 478 // Writes a message of integers.
479 void WriteMessage(intptr_t field_count, intptr_t *data); 479 void WriteMessage(intptr_t field_count, intptr_t *data);
480 480
481 void WriteCMessage(Dart_CObject* object); 481 void WriteCMessage(Dart_CObject* object);
482 482
483 void FinalizeBuffer() { 483 void FinalizeBuffer() {
484 BaseWriter::FinalizeBuffer(Snapshot::kMessage); 484 BaseWriter::FinalizeBuffer(Snapshot::kMessage);
485 } 485 }
486 486
487 private: 487 private:
488 static const intptr_t kDartCObjectTypeBits = 3; 488 static const intptr_t kDartCObjectTypeBits = 3;
489 static const intptr_t kDartCObjectTypeMask = (1 << kDartCObjectTypeBits) - 1; 489 static const intptr_t kDartCObjectTypeMask = (1 << kDartCObjectTypeBits) - 1;
490 static const intptr_t kDartCObjectMarkMask = ~kDartCObjectTypeMask; 490 static const intptr_t kDartCObjectMarkMask = ~kDartCObjectTypeMask;
491 static const intptr_t kDartCObjectMarkOffset = 1; 491 static const intptr_t kDartCObjectMarkOffset = 1;
492 492
493 void MarkCObject(Dart_CObject* object, intptr_t object_id); 493 void MarkCObject(Dart_CObject* object, intptr_t object_id);
494 void UnmarkCObject(Dart_CObject* object); 494 void UnmarkCObject(Dart_CObject* object);
495 bool IsCObjectMarked(Dart_CObject* object); 495 bool IsCObjectMarked(Dart_CObject* object);
496 intptr_t GetMarkedCObjectMark(Dart_CObject* object); 496 intptr_t GetMarkedCObjectMark(Dart_CObject* object);
497 void UnmarkAllCObjects(Dart_CObject* object); 497 void UnmarkAllCObjects(Dart_CObject* object);
498 498
499 void WriteSmi(int32_t value); 499 void WriteSmi(int64_t value);
500 void WriteMint(Dart_CObject* object, int64_t value);
501 void WriteInt32(Dart_CObject* object);
502 void WriteInt64(Dart_CObject* object);
500 void WriteInlinedHeader(Dart_CObject* object); 503 void WriteInlinedHeader(Dart_CObject* object);
501 void WriteCObject(Dart_CObject* object); 504 void WriteCObject(Dart_CObject* object);
502 505
503 intptr_t object_id_; 506 intptr_t object_id_;
504 507
505 DISALLOW_COPY_AND_ASSIGN(MessageWriter); 508 DISALLOW_COPY_AND_ASSIGN(MessageWriter);
506 }; 509 };
507 510
508 511
509 class SnapshotWriter : public BaseWriter { 512 class SnapshotWriter : public BaseWriter {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 596
594 private: 597 private:
595 SnapshotWriter* writer_; 598 SnapshotWriter* writer_;
596 599
597 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); 600 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor);
598 }; 601 };
599 602
600 } // namespace dart 603 } // namespace dart
601 604
602 #endif // VM_SNAPSHOT_H_ 605 #endif // VM_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_message.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698