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 7190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7201 } | 7201 } |
7202 } | 7202 } |
7203 } | 7203 } |
7204 | 7204 |
7205 static bool IsTypedData(const Instance& obj) { | 7205 static bool IsTypedData(const Instance& obj) { |
7206 ASSERT(!obj.IsNull()); | 7206 ASSERT(!obj.IsNull()); |
7207 intptr_t cid = obj.raw()->GetClassId(); | 7207 intptr_t cid = obj.raw()->GetClassId(); |
7208 return RawObject::IsTypedDataClassId(cid); | 7208 return RawObject::IsTypedDataClassId(cid); |
7209 } | 7209 } |
7210 | 7210 |
7211 static RawTypedData* EmptyUint32Array(Isolate* isolate); | 7211 static RawTypedData* EmptyUint32Array(Thread* thread); |
7212 | 7212 |
7213 protected: | 7213 protected: |
7214 void SetLength(intptr_t value) const { | 7214 void SetLength(intptr_t value) const { |
7215 StoreSmi(&raw_ptr()->length_, Smi::New(value)); | 7215 StoreSmi(&raw_ptr()->length_, Smi::New(value)); |
7216 } | 7216 } |
7217 | 7217 |
7218 private: | 7218 private: |
7219 static intptr_t element_size(intptr_t index) { | 7219 static intptr_t element_size(intptr_t index) { |
7220 ASSERT(0 <= index && index < kNumElementSizes); | 7220 ASSERT(0 <= index && index < kNumElementSizes); |
7221 intptr_t size = element_size_table[index]; | 7221 intptr_t size = element_size_table[index]; |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7971 } | 7971 } |
7972 | 7972 |
7973 static RawUserTag* New(const String& label, | 7973 static RawUserTag* New(const String& label, |
7974 Heap::Space space = Heap::kOld); | 7974 Heap::Space space = Heap::kOld); |
7975 static RawUserTag* DefaultTag(); | 7975 static RawUserTag* DefaultTag(); |
7976 | 7976 |
7977 static bool TagTableIsFull(Isolate* isolate); | 7977 static bool TagTableIsFull(Isolate* isolate); |
7978 static RawUserTag* FindTagById(uword tag_id); | 7978 static RawUserTag* FindTagById(uword tag_id); |
7979 | 7979 |
7980 private: | 7980 private: |
7981 static RawUserTag* FindTagInIsolate(Isolate* isolate, const String& label); | 7981 static RawUserTag* FindTagInIsolate(Thread* thread, const String& label); |
7982 static void AddTagToIsolate(Isolate* isolate, const UserTag& tag); | 7982 static void AddTagToIsolate(Thread* thread, const UserTag& tag); |
7983 | 7983 |
7984 void set_label(const String& tag_label) const { | 7984 void set_label(const String& tag_label) const { |
7985 StorePointer(&raw_ptr()->label_, tag_label.raw()); | 7985 StorePointer(&raw_ptr()->label_, tag_label.raw()); |
7986 } | 7986 } |
7987 | 7987 |
7988 FINAL_HEAP_OBJECT_IMPLEMENTATION(UserTag, Instance); | 7988 FINAL_HEAP_OBJECT_IMPLEMENTATION(UserTag, Instance); |
7989 friend class Class; | 7989 friend class Class; |
7990 }; | 7990 }; |
7991 | 7991 |
7992 | 7992 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8148 | 8148 |
8149 | 8149 |
8150 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8150 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
8151 intptr_t index) { | 8151 intptr_t index) { |
8152 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8152 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
8153 } | 8153 } |
8154 | 8154 |
8155 } // namespace dart | 8155 } // namespace dart |
8156 | 8156 |
8157 #endif // VM_OBJECT_H_ | 8157 #endif // VM_OBJECT_H_ |
OLD | NEW |