| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assert.h" | 7 #include "vm/assert.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // - Object that is seen for the first time (inlined as follows): | 250 // - Object that is seen for the first time (inlined as follows): |
| 251 // (object size in multiples of kObjectAlignment | 0x1) | 251 // (object size in multiples of kObjectAlignment | 0x1) |
| 252 // serialized fields of the object | 252 // serialized fields of the object |
| 253 // ...... | 253 // ...... |
| 254 | 254 |
| 255 NoGCScope no_gc; | 255 NoGCScope no_gc; |
| 256 // writing a snap shot. | 256 // writing a snap shot. |
| 257 | 257 |
| 258 // First check if it is a Smi (i.e not a heap object). | 258 // First check if it is a Smi (i.e not a heap object). |
| 259 if (!rawobj->IsHeapObject()) { | 259 if (!rawobj->IsHeapObject()) { |
| 260 Write<int64_t>(reinterpret_cast<int64_t>(rawobj)); | 260 Write<int64_t>(reinterpret_cast<intptr_t>(rawobj)); |
| 261 return; | 261 return; |
| 262 } | 262 } |
| 263 | 263 |
| 264 // Check if it is a singleton null object which is shared by all isolates. | 264 // Check if it is a singleton null object which is shared by all isolates. |
| 265 if (rawobj == Object::null()) { | 265 if (rawobj == Object::null()) { |
| 266 WriteIndexedObject(Object::kNullObject); | 266 WriteIndexedObject(Object::kNullObject); |
| 267 return; | 267 return; |
| 268 } | 268 } |
| 269 | 269 |
| 270 // Check if it is a singleton sentinel object which is shared by all isolates. | 270 // Check if it is a singleton sentinel object which is shared by all isolates. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 445 |
| 446 | 446 |
| 447 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { | 447 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { |
| 448 for (RawObject** current = first; current <= last; current++) { | 448 for (RawObject** current = first; current <= last; current++) { |
| 449 RawObject* raw_obj = *current; | 449 RawObject* raw_obj = *current; |
| 450 writer_->WriteObject(raw_obj); | 450 writer_->WriteObject(raw_obj); |
| 451 } | 451 } |
| 452 } | 452 } |
| 453 | 453 |
| 454 } // namespace dart | 454 } // namespace dart |
| OLD | NEW |