Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Side by Side Diff: runtime/vm/object.cc

Issue 1221503004: Reclaim the CreatedFromSnapshot bit and use it to indicate VM Heap object (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-code-review-comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 392
393 Heap* heap = isolate->heap(); 393 Heap* heap = isolate->heap();
394 394
395 // Allocate and initialize the null instance. 395 // Allocate and initialize the null instance.
396 // 'null_' must be the first object allocated as it is used in allocation to 396 // 'null_' must be the first object allocated as it is used in allocation to
397 // clear the object. 397 // clear the object.
398 { 398 {
399 uword address = heap->Allocate(Instance::InstanceSize(), Heap::kOld); 399 uword address = heap->Allocate(Instance::InstanceSize(), Heap::kOld);
400 null_ = reinterpret_cast<RawInstance*>(address + kHeapObjectTag); 400 null_ = reinterpret_cast<RawInstance*>(address + kHeapObjectTag);
401 // The call below is using 'null_' to initialize itself. 401 // The call below is using 'null_' to initialize itself.
402 InitializeObject(address, kNullCid, Instance::InstanceSize()); 402 InitializeObject(address, kNullCid, Instance::InstanceSize(), true);
403 } 403 }
404 } 404 }
405 405
406 406
407 void Object::InitOnce(Isolate* isolate) { 407 void Object::InitOnce(Isolate* isolate) {
408 // Should only be run by the vm isolate. 408 // Should only be run by the vm isolate.
409 ASSERT(isolate == Dart::vm_isolate()); 409 ASSERT(isolate == Dart::vm_isolate());
410 410
411 // Initialize the static vtable values. 411 // Initialize the static vtable values.
412 { 412 {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 *empty_array_ = Array::null(); 455 *empty_array_ = Array::null();
456 *zero_array_ = Array::null(); 456 *zero_array_ = Array::null();
457 457
458 Class& cls = Class::Handle(); 458 Class& cls = Class::Handle();
459 459
460 // Allocate and initialize the class class. 460 // Allocate and initialize the class class.
461 { 461 {
462 intptr_t size = Class::InstanceSize(); 462 intptr_t size = Class::InstanceSize();
463 uword address = heap->Allocate(size, Heap::kOld); 463 uword address = heap->Allocate(size, Heap::kOld);
464 class_class_ = reinterpret_cast<RawClass*>(address + kHeapObjectTag); 464 class_class_ = reinterpret_cast<RawClass*>(address + kHeapObjectTag);
465 InitializeObject(address, Class::kClassId, size); 465 InitializeObject(address, Class::kClassId, size, true);
466 466
467 Class fake; 467 Class fake;
468 // Initialization from Class::New<Class>. 468 // Initialization from Class::New<Class>.
469 // Directly set raw_ to break a circular dependency: SetRaw will attempt 469 // Directly set raw_ to break a circular dependency: SetRaw will attempt
470 // to lookup class class in the class table where it is not registered yet. 470 // to lookup class class in the class table where it is not registered yet.
471 cls.raw_ = class_class_; 471 cls.raw_ = class_class_;
472 cls.set_handle_vtable(fake.vtable()); 472 cls.set_handle_vtable(fake.vtable());
473 cls.set_instance_size(Class::InstanceSize()); 473 cls.set_instance_size(Class::InstanceSize());
474 cls.set_next_field_offset(Class::NextFieldOffset()); 474 cls.set_next_field_offset(Class::NextFieldOffset());
475 cls.set_id(Class::kClassId); 475 cls.set_id(Class::kClassId);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 // need it when reading in the token stream of bootstrap classes in the VM 628 // need it when reading in the token stream of bootstrap classes in the VM
629 // isolate. 629 // isolate.
630 Class::NewExternalTypedDataClass(kExternalTypedDataUint8ArrayCid); 630 Class::NewExternalTypedDataClass(kExternalTypedDataUint8ArrayCid);
631 631
632 // Needed for object pools of VM isolate stubs. 632 // Needed for object pools of VM isolate stubs.
633 Class::NewTypedDataClass(kTypedDataInt8ArrayCid); 633 Class::NewTypedDataClass(kTypedDataInt8ArrayCid);
634 634
635 // Allocate and initialize the empty_array instance. 635 // Allocate and initialize the empty_array instance.
636 { 636 {
637 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld); 637 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld);
638 InitializeObject(address, kImmutableArrayCid, Array::InstanceSize(0)); 638 InitializeObject(address, kImmutableArrayCid, Array::InstanceSize(0), true);
639 Array::initializeHandle( 639 Array::initializeHandle(
640 empty_array_, 640 empty_array_,
641 reinterpret_cast<RawArray*>(address + kHeapObjectTag)); 641 reinterpret_cast<RawArray*>(address + kHeapObjectTag));
642 empty_array_->StoreSmi(&empty_array_->raw_ptr()->length_, Smi::New(0)); 642 empty_array_->StoreSmi(&empty_array_->raw_ptr()->length_, Smi::New(0));
643 } 643 }
644 644
645 Smi& smi = Smi::Handle(); 645 Smi& smi = Smi::Handle();
646 // Allocate and initialize the zero_array instance. 646 // Allocate and initialize the zero_array instance.
647 { 647 {
648 uword address = heap->Allocate(Array::InstanceSize(1), Heap::kOld); 648 uword address = heap->Allocate(Array::InstanceSize(1), Heap::kOld);
649 InitializeObject(address, kImmutableArrayCid, Array::InstanceSize(1)); 649 InitializeObject(address, kImmutableArrayCid, Array::InstanceSize(1), true);
650 Array::initializeHandle( 650 Array::initializeHandle(
651 zero_array_, 651 zero_array_,
652 reinterpret_cast<RawArray*>(address + kHeapObjectTag)); 652 reinterpret_cast<RawArray*>(address + kHeapObjectTag));
653 zero_array_->StoreSmi(&zero_array_->raw_ptr()->length_, Smi::New(1)); 653 zero_array_->StoreSmi(&zero_array_->raw_ptr()->length_, Smi::New(1));
654 smi = Smi::New(0); 654 smi = Smi::New(0);
655 zero_array_->SetAt(0, smi); 655 zero_array_->SetAt(0, smi);
656 } 656 }
657 657
658 // Allocate and initialize the canonical empty object pool object. 658 // Allocate and initialize the canonical empty object pool object.
659 { 659 {
660 uword address = 660 uword address =
661 heap->Allocate(ObjectPool::InstanceSize(0), Heap::kOld); 661 heap->Allocate(ObjectPool::InstanceSize(0), Heap::kOld);
662 InitializeObject(address, 662 InitializeObject(address,
663 kObjectPoolCid, 663 kObjectPoolCid,
664 ObjectPool::InstanceSize(0)); 664 ObjectPool::InstanceSize(0),
665 true);
665 ObjectPool::initializeHandle( 666 ObjectPool::initializeHandle(
666 empty_object_pool_, 667 empty_object_pool_,
667 reinterpret_cast<RawObjectPool*>(address + kHeapObjectTag)); 668 reinterpret_cast<RawObjectPool*>(address + kHeapObjectTag));
668 empty_object_pool_->StoreNonPointer( 669 empty_object_pool_->StoreNonPointer(
669 &empty_object_pool_->raw_ptr()->length_, 0); 670 &empty_object_pool_->raw_ptr()->length_, 0);
670 } 671 }
671 672
672 // Allocate and initialize the empty_descriptors instance. 673 // Allocate and initialize the empty_descriptors instance.
673 { 674 {
674 uword address = heap->Allocate(PcDescriptors::InstanceSize(0), Heap::kOld); 675 uword address = heap->Allocate(PcDescriptors::InstanceSize(0), Heap::kOld);
675 InitializeObject(address, kPcDescriptorsCid, 676 InitializeObject(address, kPcDescriptorsCid,
676 PcDescriptors::InstanceSize(0)); 677 PcDescriptors::InstanceSize(0),
678 true);
677 PcDescriptors::initializeHandle( 679 PcDescriptors::initializeHandle(
678 empty_descriptors_, 680 empty_descriptors_,
679 reinterpret_cast<RawPcDescriptors*>(address + kHeapObjectTag)); 681 reinterpret_cast<RawPcDescriptors*>(address + kHeapObjectTag));
680 empty_descriptors_->StoreNonPointer(&empty_descriptors_->raw_ptr()->length_, 682 empty_descriptors_->StoreNonPointer(&empty_descriptors_->raw_ptr()->length_,
681 0); 683 0);
682 } 684 }
683 685
684 // Allocate and initialize the canonical empty variable descriptor object. 686 // Allocate and initialize the canonical empty variable descriptor object.
685 { 687 {
686 uword address = 688 uword address =
687 heap->Allocate(LocalVarDescriptors::InstanceSize(0), Heap::kOld); 689 heap->Allocate(LocalVarDescriptors::InstanceSize(0), Heap::kOld);
688 InitializeObject(address, 690 InitializeObject(address,
689 kLocalVarDescriptorsCid, 691 kLocalVarDescriptorsCid,
690 LocalVarDescriptors::InstanceSize(0)); 692 LocalVarDescriptors::InstanceSize(0),
693 true);
691 LocalVarDescriptors::initializeHandle( 694 LocalVarDescriptors::initializeHandle(
692 empty_var_descriptors_, 695 empty_var_descriptors_,
693 reinterpret_cast<RawLocalVarDescriptors*>(address + kHeapObjectTag)); 696 reinterpret_cast<RawLocalVarDescriptors*>(address + kHeapObjectTag));
694 empty_var_descriptors_->StoreNonPointer( 697 empty_var_descriptors_->StoreNonPointer(
695 &empty_var_descriptors_->raw_ptr()->num_entries_, 0); 698 &empty_var_descriptors_->raw_ptr()->num_entries_, 0);
696 } 699 }
697 700
698 // Allocate and initialize the canonical empty exception handler info object. 701 // Allocate and initialize the canonical empty exception handler info object.
699 // The vast majority of all functions do not contain an exception handler 702 // The vast majority of all functions do not contain an exception handler
700 // and can share this canonical descriptor. 703 // and can share this canonical descriptor.
701 { 704 {
702 uword address = 705 uword address =
703 heap->Allocate(ExceptionHandlers::InstanceSize(0), Heap::kOld); 706 heap->Allocate(ExceptionHandlers::InstanceSize(0), Heap::kOld);
704 InitializeObject(address, 707 InitializeObject(address,
705 kExceptionHandlersCid, 708 kExceptionHandlersCid,
706 ExceptionHandlers::InstanceSize(0)); 709 ExceptionHandlers::InstanceSize(0),
710 true);
707 ExceptionHandlers::initializeHandle( 711 ExceptionHandlers::initializeHandle(
708 empty_exception_handlers_, 712 empty_exception_handlers_,
709 reinterpret_cast<RawExceptionHandlers*>(address + kHeapObjectTag)); 713 reinterpret_cast<RawExceptionHandlers*>(address + kHeapObjectTag));
710 empty_exception_handlers_->StoreNonPointer( 714 empty_exception_handlers_->StoreNonPointer(
711 &empty_exception_handlers_->raw_ptr()->num_entries_, 0); 715 &empty_exception_handlers_->raw_ptr()->num_entries_, 0);
712 } 716 }
713 717
714 // The VM isolate snapshot object table is initialized to an empty array 718 // The VM isolate snapshot object table is initialized to an empty array
715 // as we do not have any VM isolate snapshot at this time. 719 // as we do not have any VM isolate snapshot at this time.
716 *vm_isolate_snapshot_object_table_ = Object::empty_array().raw(); 720 *vm_isolate_snapshot_object_table_ = Object::empty_array().raw();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 // An object visitor which will mark all visited objects. This is used to 806 // An object visitor which will mark all visited objects. This is used to
803 // premark all objects in the vm_isolate_ heap. 807 // premark all objects in the vm_isolate_ heap.
804 class PremarkingVisitor : public ObjectVisitor { 808 class PremarkingVisitor : public ObjectVisitor {
805 public: 809 public:
806 explicit PremarkingVisitor(Isolate* isolate) : ObjectVisitor(isolate) {} 810 explicit PremarkingVisitor(Isolate* isolate) : ObjectVisitor(isolate) {}
807 811
808 void VisitObject(RawObject* obj) { 812 void VisitObject(RawObject* obj) {
809 ASSERT(!obj->IsMarked()); 813 ASSERT(!obj->IsMarked());
810 // Free list elements should never be marked. 814 // Free list elements should never be marked.
811 if (!obj->IsFreeListElement()) { 815 if (!obj->IsFreeListElement()) {
816 ASSERT(obj->IsVMHeapObject());
812 obj->SetMarkBitUnsynchronized(); 817 obj->SetMarkBitUnsynchronized();
813 } 818 }
814 } 819 }
815 }; 820 };
816 821
817 822
818 #define SET_CLASS_NAME(class_name, name) \ 823 #define SET_CLASS_NAME(class_name, name) \
819 cls = class_name##_class(); \ 824 cls = class_name##_class(); \
820 cls.set_name(Symbols::name()); \ 825 cls.set_name(Symbols::name()); \
821 826
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 return; 1672 return;
1668 } 1673 }
1669 } 1674 }
1670 1675
1671 1676
1672 RawString* Object::DictionaryName() const { 1677 RawString* Object::DictionaryName() const {
1673 return String::null(); 1678 return String::null();
1674 } 1679 }
1675 1680
1676 1681
1677 void Object::InitializeObject(uword address, intptr_t class_id, intptr_t size) { 1682 void Object::InitializeObject(uword address,
1683 intptr_t class_id,
1684 intptr_t size,
1685 bool is_vm_object) {
1678 // TODO(iposva): Get a proper halt instruction from the assembler which 1686 // TODO(iposva): Get a proper halt instruction from the assembler which
1679 // would be needed here for code objects. 1687 // would be needed here for code objects.
1680 uword initial_value = reinterpret_cast<uword>(null_); 1688 uword initial_value = reinterpret_cast<uword>(null_);
1681 uword cur = address; 1689 uword cur = address;
1682 uword end = address + size; 1690 uword end = address + size;
1683 while (cur < end) { 1691 while (cur < end) {
1684 *reinterpret_cast<uword*>(cur) = initial_value; 1692 *reinterpret_cast<uword*>(cur) = initial_value;
1685 cur += kWordSize; 1693 cur += kWordSize;
1686 } 1694 }
1687 uword tags = 0; 1695 uword tags = 0;
1688 ASSERT(class_id != kIllegalCid); 1696 ASSERT(class_id != kIllegalCid);
1689 tags = RawObject::ClassIdTag::update(class_id, tags); 1697 tags = RawObject::ClassIdTag::update(class_id, tags);
1690 tags = RawObject::SizeTag::update(size, tags); 1698 tags = RawObject::SizeTag::update(size, tags);
1699 tags = RawObject::VMHeapObjectTag::update(is_vm_object, tags);
1691 reinterpret_cast<RawObject*>(address)->tags_ = tags; 1700 reinterpret_cast<RawObject*>(address)->tags_ = tags;
1701 ASSERT(is_vm_object == RawObject::IsVMHeapObject(tags));
1692 VerifiedMemory::Accept(address, size); 1702 VerifiedMemory::Accept(address, size);
1693 } 1703 }
1694 1704
1695 1705
1696 void Object::CheckHandle() const { 1706 void Object::CheckHandle() const {
1697 #if defined(DEBUG) 1707 #if defined(DEBUG)
1698 if (raw_ != Object::null()) { 1708 if (raw_ != Object::null()) {
1699 if ((reinterpret_cast<uword>(raw_) & kSmiTagMask) == kSmiTag) { 1709 if ((reinterpret_cast<uword>(raw_) & kSmiTagMask) == kSmiTag) {
1700 ASSERT(vtable() == Smi::handle_vtable_); 1710 ASSERT(vtable() == Smi::handle_vtable_);
1701 return; 1711 return;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 if (space == Heap::kNew) { 1749 if (space == Heap::kNew) {
1740 class_table->UpdateAllocatedNew(cls_id, size); 1750 class_table->UpdateAllocatedNew(cls_id, size);
1741 } else { 1751 } else {
1742 class_table->UpdateAllocatedOld(cls_id, size); 1752 class_table->UpdateAllocatedOld(cls_id, size);
1743 } 1753 }
1744 const Class& cls = Class::Handle(class_table->At(cls_id)); 1754 const Class& cls = Class::Handle(class_table->At(cls_id));
1745 if (cls.trace_allocation()) { 1755 if (cls.trace_allocation()) {
1746 Profiler::RecordAllocation(isolate, cls_id); 1756 Profiler::RecordAllocation(isolate, cls_id);
1747 } 1757 }
1748 NoSafepointScope no_safepoint; 1758 NoSafepointScope no_safepoint;
1749 InitializeObject(address, cls_id, size); 1759 InitializeObject(address, cls_id, size, (isolate == Dart::vm_isolate()));
1750 RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag); 1760 RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag);
1751 ASSERT(cls_id == RawObject::ClassIdTag::decode(raw_obj->ptr()->tags_)); 1761 ASSERT(cls_id == RawObject::ClassIdTag::decode(raw_obj->ptr()->tags_));
1752 return raw_obj; 1762 return raw_obj;
1753 } 1763 }
1754 1764
1755 1765
1756 class StoreBufferUpdateVisitor : public ObjectPointerVisitor { 1766 class StoreBufferUpdateVisitor : public ObjectPointerVisitor {
1757 public: 1767 public:
1758 explicit StoreBufferUpdateVisitor(Thread* thread, RawObject* obj) : 1768 explicit StoreBufferUpdateVisitor(Thread* thread, RawObject* obj) :
1759 ObjectPointerVisitor(thread->isolate()), thread_(thread), old_obj_(obj) { 1769 ObjectPointerVisitor(thread->isolate()), thread_(thread), old_obj_(obj) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 return GeneratePrettyName(); 1843 return GeneratePrettyName();
1834 } 1844 }
1835 1845
1836 1846
1837 RawString* Class::UserVisibleName() const { 1847 RawString* Class::UserVisibleName() const {
1838 ASSERT(raw_ptr()->user_name_ != String::null()); 1848 ASSERT(raw_ptr()->user_name_ != String::null());
1839 return raw_ptr()->user_name_; 1849 return raw_ptr()->user_name_;
1840 } 1850 }
1841 1851
1842 1852
1853 bool Class::IsInFullSnapshot() const {
1854 NoSafepointScope no_safepoint;
1855 return raw_ptr()->library_->ptr()->is_in_fullsnapshot_;
1856 }
1857
1858
1843 RawType* Class::SignatureType() const { 1859 RawType* Class::SignatureType() const {
1844 ASSERT(IsSignatureClass()); 1860 ASSERT(IsSignatureClass());
1845 const Function& function = Function::Handle(signature_function()); 1861 const Function& function = Function::Handle(signature_function());
1846 ASSERT(!function.IsNull()); 1862 ASSERT(!function.IsNull());
1847 if (function.signature_class() != raw()) { 1863 if (function.signature_class() != raw()) {
1848 // This class is a function type alias. Return the canonical signature type. 1864 // This class is a function type alias. Return the canonical signature type.
1849 const Class& canonical_class = Class::Handle(function.signature_class()); 1865 const Class& canonical_class = Class::Handle(function.signature_class());
1850 return canonical_class.SignatureType(); 1866 return canonical_class.SignatureType();
1851 } 1867 }
1852 // Return the first canonical signature type if already computed at class 1868 // Return the first canonical signature type if already computed at class
(...skipping 7966 matching lines...) Expand 10 before | Expand all | Expand 10 after
9819 GrowableObjectArray::New(4, Heap::kOld)); 9835 GrowableObjectArray::New(4, Heap::kOld));
9820 result.StorePointer(&result.raw_ptr()->anonymous_classes_, 9836 result.StorePointer(&result.raw_ptr()->anonymous_classes_,
9821 Object::empty_array().raw()); 9837 Object::empty_array().raw());
9822 result.StoreNonPointer(&result.raw_ptr()->num_anonymous_, 0); 9838 result.StoreNonPointer(&result.raw_ptr()->num_anonymous_, 0);
9823 result.StorePointer(&result.raw_ptr()->imports_, Object::empty_array().raw()); 9839 result.StorePointer(&result.raw_ptr()->imports_, Object::empty_array().raw());
9824 result.StorePointer(&result.raw_ptr()->exports_, Object::empty_array().raw()); 9840 result.StorePointer(&result.raw_ptr()->exports_, Object::empty_array().raw());
9825 result.StorePointer(&result.raw_ptr()->loaded_scripts_, Array::null()); 9841 result.StorePointer(&result.raw_ptr()->loaded_scripts_, Array::null());
9826 result.StorePointer(&result.raw_ptr()->load_error_, Instance::null()); 9842 result.StorePointer(&result.raw_ptr()->load_error_, Instance::null());
9827 result.set_native_entry_resolver(NULL); 9843 result.set_native_entry_resolver(NULL);
9828 result.set_native_entry_symbol_resolver(NULL); 9844 result.set_native_entry_symbol_resolver(NULL);
9845 result.set_is_in_fullsnapshot(false);
9829 result.StoreNonPointer(&result.raw_ptr()->corelib_imported_, true); 9846 result.StoreNonPointer(&result.raw_ptr()->corelib_imported_, true);
9830 result.set_debuggable(false); 9847 result.set_debuggable(false);
9831 result.set_is_dart_scheme(url.StartsWith(Symbols::DartScheme())); 9848 result.set_is_dart_scheme(url.StartsWith(Symbols::DartScheme()));
9832 result.StoreNonPointer(&result.raw_ptr()->load_state_, 9849 result.StoreNonPointer(&result.raw_ptr()->load_state_,
9833 RawLibrary::kAllocated); 9850 RawLibrary::kAllocated);
9834 result.StoreNonPointer(&result.raw_ptr()->index_, -1); 9851 result.StoreNonPointer(&result.raw_ptr()->index_, -1);
9835 const intptr_t kInitialNameCacheSize = 64; 9852 const intptr_t kInitialNameCacheSize = 64;
9836 result.InitResolvedNamesCache(kInitialNameCacheSize); 9853 result.InitResolvedNamesCache(kInitialNameCacheSize);
9837 result.InitClassDictionary(); 9854 result.InitClassDictionary();
9838 result.InitImportList(); 9855 result.InitImportList();
(...skipping 5412 matching lines...) Expand 10 before | Expand all | Expand 10 after
15251 type ^= type.Canonicalize(); 15268 type ^= type.Canonicalize();
15252 } 15269 }
15253 ASSERT(type.IsFinalized()); 15270 ASSERT(type.IsFinalized());
15254 return type.raw(); 15271 return type.raw();
15255 } 15272 }
15256 15273
15257 15274
15258 void Type::SetIsFinalized() const { 15275 void Type::SetIsFinalized() const {
15259 ASSERT(!IsFinalized()); 15276 ASSERT(!IsFinalized());
15260 if (IsInstantiated()) { 15277 if (IsInstantiated()) {
15278 ASSERT(HasResolvedTypeClass());
15261 set_type_state(RawType::kFinalizedInstantiated); 15279 set_type_state(RawType::kFinalizedInstantiated);
15262 } else { 15280 } else {
15263 set_type_state(RawType::kFinalizedUninstantiated); 15281 set_type_state(RawType::kFinalizedUninstantiated);
15264 } 15282 }
15265 } 15283 }
15266 15284
15267 15285
15268 void Type::ResetIsFinalized() const { 15286 void Type::ResetIsFinalized() const {
15269 ASSERT(IsFinalized()); 15287 ASSERT(IsFinalized());
15270 set_type_state(RawType::kBeingFinalized); 15288 set_type_state(RawType::kBeingFinalized);
(...skipping 6072 matching lines...) Expand 10 before | Expand all | Expand 10 after
21343 return tag_label.ToCString(); 21361 return tag_label.ToCString();
21344 } 21362 }
21345 21363
21346 21364
21347 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21365 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21348 Instance::PrintJSONImpl(stream, ref); 21366 Instance::PrintJSONImpl(stream, ref);
21349 } 21367 }
21350 21368
21351 21369
21352 } // namespace dart 21370 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698