| 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 14 matching lines...) Expand all Loading... |
| 25 static bool IsSingletonClassId(intptr_t class_id) { | 25 static bool IsSingletonClassId(intptr_t class_id) { |
| 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 <= kUint32x4Cid) || | 35 (class_id >= kInstanceCid && class_id <= kInt32x4Cid) || |
| 36 class_id == kArrayCid || | 36 class_id == kArrayCid || |
| 37 class_id == kImmutableArrayCid || | 37 class_id == kImmutableArrayCid || |
| 38 RawObject::IsStringClassId(class_id) || | 38 RawObject::IsStringClassId(class_id) || |
| 39 RawObject::IsTypedDataClassId(class_id) || | 39 RawObject::IsTypedDataClassId(class_id) || |
| 40 RawObject::IsExternalTypedDataClassId(class_id)); | 40 RawObject::IsExternalTypedDataClassId(class_id)); |
| 41 } | 41 } |
| 42 | 42 |
| 43 | 43 |
| 44 static bool IsObjectStoreTypeId(intptr_t index) { | 44 static bool IsObjectStoreTypeId(intptr_t index) { |
| 45 // 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. |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 RawFloat32x4* obj = reinterpret_cast<RawFloat32x4*>( | 615 RawFloat32x4* obj = reinterpret_cast<RawFloat32x4*>( |
| 616 AllocateUninitialized(cls_, Float32x4::InstanceSize())); | 616 AllocateUninitialized(cls_, Float32x4::InstanceSize())); |
| 617 obj->ptr()->value_[0] = v0; | 617 obj->ptr()->value_[0] = v0; |
| 618 obj->ptr()->value_[1] = v1; | 618 obj->ptr()->value_[1] = v1; |
| 619 obj->ptr()->value_[2] = v2; | 619 obj->ptr()->value_[2] = v2; |
| 620 obj->ptr()->value_[3] = v3; | 620 obj->ptr()->value_[3] = v3; |
| 621 return obj; | 621 return obj; |
| 622 } | 622 } |
| 623 | 623 |
| 624 | 624 |
| 625 RawUint32x4* SnapshotReader::NewUint32x4(uint32_t v0, uint32_t v1, uint32_t v2, | 625 RawInt32x4* SnapshotReader::NewInt32x4(uint32_t v0, uint32_t v1, uint32_t v2, |
| 626 uint32_t v3) { | 626 uint32_t v3) { |
| 627 ASSERT(kind_ == Snapshot::kFull); | 627 ASSERT(kind_ == Snapshot::kFull); |
| 628 ASSERT(isolate()->no_gc_scope_depth() != 0); | 628 ASSERT(isolate()->no_gc_scope_depth() != 0); |
| 629 cls_ = object_store()->uint32x4_class(); | 629 cls_ = object_store()->int32x4_class(); |
| 630 RawUint32x4* obj = reinterpret_cast<RawUint32x4*>( | 630 RawInt32x4* obj = reinterpret_cast<RawInt32x4*>( |
| 631 AllocateUninitialized(cls_, Uint32x4::InstanceSize())); | 631 AllocateUninitialized(cls_, Int32x4::InstanceSize())); |
| 632 obj->ptr()->value_[0] = v0; | 632 obj->ptr()->value_[0] = v0; |
| 633 obj->ptr()->value_[1] = v1; | 633 obj->ptr()->value_[1] = v1; |
| 634 obj->ptr()->value_[2] = v2; | 634 obj->ptr()->value_[2] = v2; |
| 635 obj->ptr()->value_[3] = v3; | 635 obj->ptr()->value_[3] = v3; |
| 636 return obj; | 636 return obj; |
| 637 } | 637 } |
| 638 | 638 |
| 639 | 639 |
| 640 RawApiError* SnapshotReader::NewApiError() { | 640 RawApiError* SnapshotReader::NewApiError() { |
| 641 ALLOC_NEW_OBJECT(ApiError, Object::api_error_class()); | 641 ALLOC_NEW_OBJECT(ApiError, Object::api_error_class()); |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 UnmarkAll(); | 1516 UnmarkAll(); |
| 1517 isolate->set_long_jump_base(base); | 1517 isolate->set_long_jump_base(base); |
| 1518 } else { | 1518 } else { |
| 1519 isolate->set_long_jump_base(base); | 1519 isolate->set_long_jump_base(base); |
| 1520 ThrowException(exception_type(), exception_msg()); | 1520 ThrowException(exception_type(), exception_msg()); |
| 1521 } | 1521 } |
| 1522 } | 1522 } |
| 1523 | 1523 |
| 1524 | 1524 |
| 1525 } // namespace dart | 1525 } // namespace dart |
| OLD | NEW |