| 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/snapshot.h" | 5 #include "vm/snapshot.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 RawLibraryPrefix* SnapshotReader::NewLibraryPrefix() { | 295 RawLibraryPrefix* SnapshotReader::NewLibraryPrefix() { |
| 296 ALLOC_NEW_OBJECT(LibraryPrefix, Object::library_prefix_class()); | 296 ALLOC_NEW_OBJECT(LibraryPrefix, Object::library_prefix_class()); |
| 297 } | 297 } |
| 298 | 298 |
| 299 | 299 |
| 300 RawScript* SnapshotReader::NewScript() { | 300 RawScript* SnapshotReader::NewScript() { |
| 301 ALLOC_NEW_OBJECT(Script, Object::script_class()); | 301 ALLOC_NEW_OBJECT(Script, Object::script_class()); |
| 302 } | 302 } |
| 303 | 303 |
| 304 | 304 |
| 305 RawLiteralToken* SnapshotReader::NewLiteralToken() { |
| 306 ALLOC_NEW_OBJECT(LiteralToken, Object::literal_token_class()); |
| 307 } |
| 308 |
| 309 |
| 305 RawClass* SnapshotReader::LookupInternalClass(intptr_t class_header) { | 310 RawClass* SnapshotReader::LookupInternalClass(intptr_t class_header) { |
| 306 SerializedHeaderType header_type = SerializedHeaderTag::decode(class_header); | 311 SerializedHeaderType header_type = SerializedHeaderTag::decode(class_header); |
| 307 | 312 |
| 308 // If the header is an object Id, lookup singleton VM classes or classes | 313 // If the header is an object Id, lookup singleton VM classes or classes |
| 309 // stored in the object store. | 314 // stored in the object store. |
| 310 if (header_type == kObjectId) { | 315 if (header_type == kObjectId) { |
| 311 intptr_t header_value = SerializedHeaderData::decode(class_header); | 316 intptr_t header_value = SerializedHeaderData::decode(class_header); |
| 312 if (IsObjectStoreClassId(header_value)) { | 317 if (IsObjectStoreClassId(header_value)) { |
| 313 return object_store()->GetClass(header_value); | 318 return object_store()->GetClass(header_value); |
| 314 } else if (IsSingletonClassId(header_value)) { | 319 } else if (IsSingletonClassId(header_value)) { |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 | 645 |
| 641 | 646 |
| 642 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { | 647 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { |
| 643 for (RawObject** current = first; current <= last; current++) { | 648 for (RawObject** current = first; current <= last; current++) { |
| 644 RawObject* raw_obj = *current; | 649 RawObject* raw_obj = *current; |
| 645 writer_->WriteObject(raw_obj); | 650 writer_->WriteObject(raw_obj); |
| 646 } | 651 } |
| 647 } | 652 } |
| 648 | 653 |
| 649 } // namespace dart | 654 } // namespace dart |
| OLD | NEW |