| OLD | NEW |
| 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 Exceptions::ExceptionType exception_type() const { | 459 Exceptions::ExceptionType exception_type() const { |
| 460 return exception_type_; | 460 return exception_type_; |
| 461 } | 461 } |
| 462 void set_exception_type(Exceptions::ExceptionType type) { | 462 void set_exception_type(Exceptions::ExceptionType type) { |
| 463 exception_type_ = type; | 463 exception_type_ = type; |
| 464 } | 464 } |
| 465 const char* exception_msg() const { return exception_msg_; } | 465 const char* exception_msg() const { return exception_msg_; } |
| 466 void set_exception_msg(const char* msg) { | 466 void set_exception_msg(const char* msg) { |
| 467 exception_msg_ = msg; | 467 exception_msg_ = msg; |
| 468 } | 468 } |
| 469 LanguageError* ErrorHandle() { return &error_; } | |
| 470 void ThrowException(Exceptions::ExceptionType type, const char* msg); | 469 void ThrowException(Exceptions::ExceptionType type, const char* msg); |
| 471 | 470 |
| 472 protected: | 471 protected: |
| 473 class ForwardObjectNode : public ZoneAllocated { | 472 class ForwardObjectNode : public ZoneAllocated { |
| 474 public: | 473 public: |
| 475 ForwardObjectNode(RawObject* raw, uword tags, SerializeState state) | 474 ForwardObjectNode(RawObject* raw, uword tags, SerializeState state) |
| 476 : raw_(raw), tags_(tags), state_(state) {} | 475 : raw_(raw), tags_(tags), state_(state) {} |
| 477 RawObject* raw() const { return raw_; } | 476 RawObject* raw() const { return raw_; } |
| 478 uword tags() const { return tags_; } | 477 uword tags() const { return tags_; } |
| 479 bool is_serialized() const { return state_ == kIsSerialized; } | 478 bool is_serialized() const { return state_ == kIsSerialized; } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 513 |
| 515 ObjectStore* object_store() const { return object_store_; } | 514 ObjectStore* object_store() const { return object_store_; } |
| 516 | 515 |
| 517 private: | 516 private: |
| 518 Snapshot::Kind kind_; | 517 Snapshot::Kind kind_; |
| 519 ObjectStore* object_store_; // Object store for common classes. | 518 ObjectStore* object_store_; // Object store for common classes. |
| 520 ClassTable* class_table_; // Class table for the class index to class lookup. | 519 ClassTable* class_table_; // Class table for the class index to class lookup. |
| 521 GrowableArray<ForwardObjectNode*> forward_list_; | 520 GrowableArray<ForwardObjectNode*> forward_list_; |
| 522 Exceptions::ExceptionType exception_type_; // Exception type. | 521 Exceptions::ExceptionType exception_type_; // Exception type. |
| 523 const char* exception_msg_; // Message associated with exception. | 522 const char* exception_msg_; // Message associated with exception. |
| 524 LanguageError& error_; // Error handle. | |
| 525 | 523 |
| 526 friend class RawArray; | 524 friend class RawArray; |
| 527 friend class RawClass; | 525 friend class RawClass; |
| 528 friend class RawClosureData; | 526 friend class RawClosureData; |
| 529 friend class RawGrowableObjectArray; | 527 friend class RawGrowableObjectArray; |
| 530 friend class RawImmutableArray; | 528 friend class RawImmutableArray; |
| 531 friend class RawJSRegExp; | 529 friend class RawJSRegExp; |
| 532 friend class RawLibrary; | 530 friend class RawLibrary; |
| 533 friend class RawLiteralToken; | 531 friend class RawLiteralToken; |
| 534 friend class RawScript; | 532 friend class RawScript; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 private: | 610 private: |
| 613 SnapshotWriter* writer_; | 611 SnapshotWriter* writer_; |
| 614 bool as_references_; | 612 bool as_references_; |
| 615 | 613 |
| 616 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); | 614 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); |
| 617 }; | 615 }; |
| 618 | 616 |
| 619 } // namespace dart | 617 } // namespace dart |
| 620 | 618 |
| 621 #endif // VM_SNAPSHOT_H_ | 619 #endif // VM_SNAPSHOT_H_ |
| OLD | NEW |