| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 RawClass* At(intptr_t index) const { | 26 RawClass* At(intptr_t index) const { |
| 27 ASSERT(IsValidIndex(index)); | 27 ASSERT(IsValidIndex(index)); |
| 28 return table_[index]; | 28 return table_[index]; |
| 29 } | 29 } |
| 30 | 30 |
| 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 bool HasValidClassAt(intptr_t index) const { |
| 36 ASSERT(IsValidIndex(index)); |
| 37 return table_[index] != NULL; |
| 38 } |
| 39 |
| 40 intptr_t NumCids() const { return top_; } |
| 41 |
| 35 void Register(const Class& cls); | 42 void Register(const Class& cls); |
| 36 | 43 |
| 37 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 44 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 38 | 45 |
| 39 void Print(); | 46 void Print(); |
| 40 | 47 |
| 41 // Returns true if the class given by its cid has subclasses. | 48 // Returns true if the class given by its cid has subclasses. |
| 42 // Must not be called for kDartObjectCid. | 49 // Must not be called for kDartObjectCid. |
| 43 bool HasSubclasses(intptr_t cid) const; | 50 bool HasSubclasses(intptr_t cid) const; |
| 44 | 51 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 70 intptr_t capacity_; | 77 intptr_t capacity_; |
| 71 | 78 |
| 72 RawClass** table_; | 79 RawClass** table_; |
| 73 | 80 |
| 74 DISALLOW_COPY_AND_ASSIGN(ClassTable); | 81 DISALLOW_COPY_AND_ASSIGN(ClassTable); |
| 75 }; | 82 }; |
| 76 | 83 |
| 77 } // namespace dart | 84 } // namespace dart |
| 78 | 85 |
| 79 #endif // VM_CLASS_TABLE_H_ | 86 #endif // VM_CLASS_TABLE_H_ |
| OLD | NEW |