| 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 #include "vm/bigint_operations.h" | 5 #include "vm/bigint_operations.h" |
| 6 #include "vm/object.h" | 6 #include "vm/object.h" |
| 7 #include "vm/object_store.h" | 7 #include "vm/object_store.h" |
| 8 #include "vm/snapshot.h" | 8 #include "vm/snapshot.h" |
| 9 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
| 10 #include "vm/visitor.h" | 10 #include "vm/visitor.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 if ((kind == Snapshot::kFull) || | 41 if ((kind == Snapshot::kFull) || |
| 42 (kind == Snapshot::kScript && !RawObject::IsCreatedFromSnapshot(tags))) { | 42 (kind == Snapshot::kScript && !RawObject::IsCreatedFromSnapshot(tags))) { |
| 43 // Read in the base information. | 43 // Read in the base information. |
| 44 intptr_t class_id = reader->ReadIntptrValue(); | 44 intptr_t class_id = reader->ReadIntptrValue(); |
| 45 | 45 |
| 46 // Allocate class object of specified kind. | 46 // Allocate class object of specified kind. |
| 47 if (kind == Snapshot::kFull) { | 47 if (kind == Snapshot::kFull) { |
| 48 cls = reader->NewClass(class_id); | 48 cls = reader->NewClass(class_id); |
| 49 } else { | 49 } else { |
| 50 if (class_id < kNumPredefinedCids) { | 50 if (class_id < kNumPredefinedCids) { |
| 51 ASSERT((class_id >= kInstanceCid) && (class_id <= kDartFunctionCid)); | 51 ASSERT((class_id >= kInstanceCid) && (class_id <= kMirrorReferenceCid)); |
| 52 cls = reader->isolate()->class_table()->At(class_id); | 52 cls = reader->isolate()->class_table()->At(class_id); |
| 53 } else { | 53 } else { |
| 54 cls = New<Instance>(kIllegalCid); | 54 cls = New<Instance>(kIllegalCid); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 reader->AddBackRef(object_id, &cls, kIsDeserialized); | 57 reader->AddBackRef(object_id, &cls, kIsDeserialized); |
| 58 | 58 |
| 59 // Set the object tags. | 59 // Set the object tags. |
| 60 cls.set_tags(tags); | 60 cls.set_tags(tags); |
| 61 | 61 |
| (...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2466 EXT_TYPED_DATA_WRITE(kTypedDataFloat64ArrayCid, double); // NOLINT. | 2466 EXT_TYPED_DATA_WRITE(kTypedDataFloat64ArrayCid, double); // NOLINT. |
| 2467 break; | 2467 break; |
| 2468 default: | 2468 default: |
| 2469 UNREACHABLE(); | 2469 UNREACHABLE(); |
| 2470 } | 2470 } |
| 2471 } | 2471 } |
| 2472 #undef TYPED_DATA_WRITE | 2472 #undef TYPED_DATA_WRITE |
| 2473 #undef EXT_TYPED_DATA_WRITE | 2473 #undef EXT_TYPED_DATA_WRITE |
| 2474 | 2474 |
| 2475 | 2475 |
| 2476 RawDartFunction* DartFunction::ReadFrom(SnapshotReader* reader, | |
| 2477 intptr_t object_id, | |
| 2478 intptr_t tags, | |
| 2479 Snapshot::Kind kind) { | |
| 2480 UNREACHABLE(); // DartFunction is an abstract class. | |
| 2481 return DartFunction::null(); | |
| 2482 } | |
| 2483 | |
| 2484 | |
| 2485 void RawDartFunction::WriteTo(SnapshotWriter* writer, | |
| 2486 intptr_t object_id, | |
| 2487 Snapshot::Kind kind) { | |
| 2488 UNREACHABLE(); // DartFunction is an abstract class. | |
| 2489 } | |
| 2490 | |
| 2491 | |
| 2492 RawStacktrace* Stacktrace::ReadFrom(SnapshotReader* reader, | 2476 RawStacktrace* Stacktrace::ReadFrom(SnapshotReader* reader, |
| 2493 intptr_t object_id, | 2477 intptr_t object_id, |
| 2494 intptr_t tags, | 2478 intptr_t tags, |
| 2495 Snapshot::Kind kind) { | 2479 Snapshot::Kind kind) { |
| 2496 if (kind == Snapshot::kFull) { | 2480 if (kind == Snapshot::kFull) { |
| 2497 Stacktrace& result = Stacktrace::ZoneHandle(reader->isolate(), | 2481 Stacktrace& result = Stacktrace::ZoneHandle(reader->isolate(), |
| 2498 reader->NewStacktrace()); | 2482 reader->NewStacktrace()); |
| 2499 reader->AddBackRef(object_id, &result, kIsDeserialized); | 2483 reader->AddBackRef(object_id, &result, kIsDeserialized); |
| 2500 | 2484 |
| 2501 // There are no non object pointer fields. | 2485 // There are no non object pointer fields. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 } | 2642 } |
| 2659 | 2643 |
| 2660 | 2644 |
| 2661 void RawMirrorReference::WriteTo(SnapshotWriter* writer, | 2645 void RawMirrorReference::WriteTo(SnapshotWriter* writer, |
| 2662 intptr_t object_id, | 2646 intptr_t object_id, |
| 2663 Snapshot::Kind kind) { | 2647 Snapshot::Kind kind) { |
| 2664 UNREACHABLE(); | 2648 UNREACHABLE(); |
| 2665 } | 2649 } |
| 2666 | 2650 |
| 2667 } // namespace dart | 2651 } // namespace dart |
| OLD | NEW |