| 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/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Check if this is a singleton object class which is shared by all isolates. | 26 // Check if this is a singleton object class which is shared by all isolates. |
| 27 return ((class_id >= kClassCid && class_id <= kUnwindErrorCid) || | 27 return ((class_id >= kClassCid && class_id <= kUnwindErrorCid) || |
| 28 (class_id >= kNullCid && class_id <= kVoidCid)); | 28 (class_id >= kNullCid && class_id <= kVoidCid)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 | 31 |
| 32 static bool IsObjectStoreClassId(intptr_t class_id) { | 32 static bool IsObjectStoreClassId(intptr_t class_id) { |
| 33 // Check if this is a class which is stored in the object store. | 33 // Check if this is a class which is stored in the object store. |
| 34 return (class_id == kObjectCid || | 34 return (class_id == kObjectCid || |
| 35 (class_id >= kInstanceCid && class_id <= kWeakPropertyCid) || | 35 (class_id >= kInstanceCid && class_id <= kWeakPropertyCid) || |
| 36 class_id == kArrayCid || |
| 37 class_id == kImmutableArrayCid || |
| 36 RawObject::IsStringClassId(class_id) || | 38 RawObject::IsStringClassId(class_id) || |
| 37 RawObject::IsTypedDataClassId(class_id) || | 39 RawObject::IsTypedDataClassId(class_id) || |
| 38 RawObject::IsExternalTypedDataClassId(class_id)); | 40 RawObject::IsExternalTypedDataClassId(class_id)); |
| 39 } | 41 } |
| 40 | 42 |
| 41 | 43 |
| 42 static bool IsObjectStoreTypeId(intptr_t index) { | 44 static bool IsObjectStoreTypeId(intptr_t index) { |
| 43 // Check if this is a type which is stored in the object store. | 45 // Check if this is a type which is stored in the object store. |
| 44 return (index >= kObjectType && index <= kArrayType); | 46 return (index >= kObjectType && index <= kArrayType); |
| 45 } | 47 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 isolate(), | 291 isolate(), |
| 290 ((kind_ == Snapshot::kFull) ? | 292 ((kind_ == Snapshot::kFull) ? |
| 291 NewArray(len) : Array::New(len, HEAP_SPACE(kind_)))); | 293 NewArray(len) : Array::New(len, HEAP_SPACE(kind_)))); |
| 292 AddBackRef(object_id, &array, kIsNotDeserialized); | 294 AddBackRef(object_id, &array, kIsNotDeserialized); |
| 293 | 295 |
| 294 return array.raw(); | 296 return array.raw(); |
| 295 } | 297 } |
| 296 if (class_id == kImmutableArrayCid) { | 298 if (class_id == kImmutableArrayCid) { |
| 297 // Read the length and allocate an object based on the len. | 299 // Read the length and allocate an object based on the len. |
| 298 intptr_t len = ReadSmiValue(); | 300 intptr_t len = ReadSmiValue(); |
| 299 ImmutableArray& array = ImmutableArray::ZoneHandle( | 301 Array& array = Array::ZoneHandle( |
| 300 isolate(), | 302 isolate(), |
| 301 (kind_ == Snapshot::kFull) ? | 303 (kind_ == Snapshot::kFull) ? |
| 302 NewImmutableArray(len) : ImmutableArray::New(len, HEAP_SPACE(kind_))); | 304 NewImmutableArray(len) : ImmutableArray::New(len, HEAP_SPACE(kind_))); |
| 303 AddBackRef(object_id, &array, kIsNotDeserialized); | 305 AddBackRef(object_id, &array, kIsNotDeserialized); |
| 304 | 306 |
| 305 return array.raw(); | 307 return array.raw(); |
| 306 } | 308 } |
| 307 | 309 |
| 308 // For all other internal VM classes we read the object inline. | 310 // For all other internal VM classes we read the object inline. |
| 309 intptr_t tags = ReadIntptrValue(); | 311 intptr_t tags = ReadIntptrValue(); |
| (...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 UnmarkAll(); | 1465 UnmarkAll(); |
| 1464 isolate->set_long_jump_base(base); | 1466 isolate->set_long_jump_base(base); |
| 1465 } else { | 1467 } else { |
| 1466 isolate->set_long_jump_base(base); | 1468 isolate->set_long_jump_base(base); |
| 1467 ThrowException(exception_type(), exception_msg()); | 1469 ThrowException(exception_type(), exception_msg()); |
| 1468 } | 1470 } |
| 1469 } | 1471 } |
| 1470 | 1472 |
| 1471 | 1473 |
| 1472 } // namespace dart | 1474 } // namespace dart |
| OLD | NEW |