| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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() { | 305 RawLiteralToken* SnapshotReader::NewLiteralToken() { |
| 306 ALLOC_NEW_OBJECT(LiteralToken, Object::literal_token_class()); | 306 ALLOC_NEW_OBJECT(LiteralToken, Object::literal_token_class()); |
| 307 } | 307 } |
| 308 | 308 |
| 309 | 309 |
| 310 RawGrowableObjectArray* SnapshotReader::NewGrowableObjectArray() { |
| 311 ALLOC_NEW_OBJECT(GrowableObjectArray, |
| 312 object_store()->growable_object_array_class()); |
| 313 } |
| 314 |
| 315 |
| 310 RawClass* SnapshotReader::LookupInternalClass(intptr_t class_header) { | 316 RawClass* SnapshotReader::LookupInternalClass(intptr_t class_header) { |
| 311 SerializedHeaderType header_type = SerializedHeaderTag::decode(class_header); | 317 SerializedHeaderType header_type = SerializedHeaderTag::decode(class_header); |
| 312 | 318 |
| 313 // If the header is an object Id, lookup singleton VM classes or classes | 319 // If the header is an object Id, lookup singleton VM classes or classes |
| 314 // stored in the object store. | 320 // stored in the object store. |
| 315 if (header_type == kObjectId) { | 321 if (header_type == kObjectId) { |
| 316 intptr_t header_value = SerializedHeaderData::decode(class_header); | 322 intptr_t header_value = SerializedHeaderData::decode(class_header); |
| 317 if (IsObjectStoreClassId(header_value)) { | 323 if (IsObjectStoreClassId(header_value)) { |
| 318 return object_store()->GetClass(header_value); | 324 return object_store()->GetClass(header_value); |
| 319 } else if (IsSingletonClassId(header_value)) { | 325 } else if (IsSingletonClassId(header_value)) { |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 | 658 |
| 653 | 659 |
| 654 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { | 660 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { |
| 655 for (RawObject** current = first; current <= last; current++) { | 661 for (RawObject** current = first; current <= last; current++) { |
| 656 RawObject* raw_obj = *current; | 662 RawObject* raw_obj = *current; |
| 657 writer_->WriteObject(raw_obj); | 663 writer_->WriteObject(raw_obj); |
| 658 } | 664 } |
| 659 } | 665 } |
| 660 | 666 |
| 661 } // namespace dart | 667 } // namespace dart |
| OLD | NEW |