| 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_CLASS_TABLE_H_ | 5 #ifndef VM_CLASS_TABLE_H_ |
| 6 #define VM_CLASS_TABLE_H_ | 6 #define VM_CLASS_TABLE_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 intptr_t IsValidIndex(intptr_t index) const { | 31 intptr_t IsValidIndex(intptr_t index) const { |
| 32 return (index > 0) && (index < top_); | 32 return (index > 0) && (index < top_); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void Register(const Class& cls); | 35 void Register(const Class& cls); |
| 36 | 36 |
| 37 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 37 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 38 | 38 |
| 39 void Print(); | 39 void Print(); |
| 40 | 40 |
| 41 // Returns true if the class given by its cid has subclasses. |
| 42 // Must not be called for kDartObjectCid. |
| 43 bool HasSubclasses(intptr_t cid) const; |
| 44 |
| 41 // Returns an array containing the cids of the direct and indirect subclasses | 45 // Returns an array containing the cids of the direct and indirect subclasses |
| 42 // of the class given by its cid. | 46 // of the class given by its cid. |
| 43 // Must not be called for kDartObjectCid. | 47 // Must not be called for kDartObjectCid. |
| 44 ZoneGrowableArray<intptr_t>* GetSubclassIdsOf(intptr_t cid) const; | 48 ZoneGrowableArray<intptr_t>* GetSubclassIdsOf(intptr_t cid) const; |
| 45 | 49 |
| 46 // Returns an array containing instance functions of the given name and | 50 // Returns an array containing instance functions of the given name and |
| 47 // belonging to the classes given by their cids. | 51 // belonging to the classes given by their cids. |
| 48 // Cids must not contain kDartObjectCid. | 52 // Cids must not contain kDartObjectCid. |
| 49 ZoneGrowableArray<Function*>* GetNamedInstanceFunctionsOf( | 53 ZoneGrowableArray<Function*>* GetNamedInstanceFunctionsOf( |
| 50 const ZoneGrowableArray<intptr_t>& cids, | 54 const ZoneGrowableArray<intptr_t>& cids, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 66 intptr_t capacity_; | 70 intptr_t capacity_; |
| 67 | 71 |
| 68 RawClass** table_; | 72 RawClass** table_; |
| 69 | 73 |
| 70 DISALLOW_COPY_AND_ASSIGN(ClassTable); | 74 DISALLOW_COPY_AND_ASSIGN(ClassTable); |
| 71 }; | 75 }; |
| 72 | 76 |
| 73 } // namespace dart | 77 } // namespace dart |
| 74 | 78 |
| 75 #endif // VM_CLASS_TABLE_H_ | 79 #endif // VM_CLASS_TABLE_H_ |
| OLD | NEW |