| 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 #ifndef VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 5812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5823 raw_weak->ptr()->key_ = Object::null(); | 5823 raw_weak->ptr()->key_ = Object::null(); |
| 5824 raw_weak->ptr()->value_ = Object::null(); | 5824 raw_weak->ptr()->value_ = Object::null(); |
| 5825 } | 5825 } |
| 5826 | 5826 |
| 5827 private: | 5827 private: |
| 5828 FINAL_HEAP_OBJECT_IMPLEMENTATION(WeakProperty, Instance); | 5828 FINAL_HEAP_OBJECT_IMPLEMENTATION(WeakProperty, Instance); |
| 5829 friend class Class; | 5829 friend class Class; |
| 5830 }; | 5830 }; |
| 5831 | 5831 |
| 5832 | 5832 |
| 5833 class MirrorReference : public Instance { |
| 5834 public: |
| 5835 RawObject* referent() const { |
| 5836 return raw_ptr()->referent_; |
| 5837 } |
| 5838 |
| 5839 void set_referent(const Object& referent) const { |
| 5840 StorePointer(&raw_ptr()->referent_, referent.raw()); |
| 5841 } |
| 5842 |
| 5843 static RawMirrorReference* New(Heap::Space space = Heap::kNew); |
| 5844 |
| 5845 static intptr_t InstanceSize() { |
| 5846 return RoundedAllocationSize(sizeof(RawMirrorReference)); |
| 5847 } |
| 5848 |
| 5849 private: |
| 5850 FINAL_HEAP_OBJECT_IMPLEMENTATION(MirrorReference, Instance); |
| 5851 friend class Class; |
| 5852 }; |
| 5853 |
| 5854 |
| 5833 // Breaking cycles and loops. | 5855 // Breaking cycles and loops. |
| 5834 RawClass* Object::clazz() const { | 5856 RawClass* Object::clazz() const { |
| 5835 uword raw_value = reinterpret_cast<uword>(raw_); | 5857 uword raw_value = reinterpret_cast<uword>(raw_); |
| 5836 if ((raw_value & kSmiTagMask) == kSmiTag) { | 5858 if ((raw_value & kSmiTagMask) == kSmiTag) { |
| 5837 return Smi::Class(); | 5859 return Smi::Class(); |
| 5838 } | 5860 } |
| 5839 return Isolate::Current()->class_table()->At(raw()->GetClassId()); | 5861 return Isolate::Current()->class_table()->At(raw()->GetClassId()); |
| 5840 } | 5862 } |
| 5841 | 5863 |
| 5842 | 5864 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5949 | 5971 |
| 5950 | 5972 |
| 5951 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5973 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5952 intptr_t index) { | 5974 intptr_t index) { |
| 5953 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5975 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5954 } | 5976 } |
| 5955 | 5977 |
| 5956 } // namespace dart | 5978 } // namespace dart |
| 5957 | 5979 |
| 5958 #endif // VM_OBJECT_H_ | 5980 #endif // VM_OBJECT_H_ |
| OLD | NEW |