| 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 #include "vm/class_table.h" | 5 #include "vm/class_table.h" |
| 6 #include "vm/flags.h" | 6 #include "vm/flags.h" |
| 7 #include "vm/freelist.h" | 7 #include "vm/freelist.h" |
| 8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 ASSERT(table_[index] == 0); | 174 ASSERT(table_[index] == 0); |
| 175 cls.set_id(index); | 175 cls.set_id(index); |
| 176 table_[index] = cls.raw(); | 176 table_[index] = cls.raw(); |
| 177 if (index >= top_) { | 177 if (index >= top_) { |
| 178 top_ = index + 1; | 178 top_ = index + 1; |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 | 182 |
| 183 #if defined(DEBUG) |
| 184 void ClassTable::Unregister(intptr_t index) { |
| 185 table_[index] = 0; |
| 186 } |
| 187 #endif |
| 188 |
| 189 |
| 183 void ClassTable::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 190 void ClassTable::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| 184 ASSERT(visitor != NULL); | 191 ASSERT(visitor != NULL); |
| 185 visitor->VisitPointers(reinterpret_cast<RawObject**>(&table_[0]), top_); | 192 visitor->VisitPointers(reinterpret_cast<RawObject**>(&table_[0]), top_); |
| 186 } | 193 } |
| 187 | 194 |
| 188 | 195 |
| 189 void ClassTable::Validate() { | 196 void ClassTable::Validate() { |
| 190 Class& cls = Class::Handle(); | 197 Class& cls = Class::Handle(); |
| 191 for (intptr_t i = kNumPredefinedCids; i < top_; i++) { | 198 for (intptr_t i = kNumPredefinedCids; i < top_; i++) { |
| 192 // Some of the class table entries maybe NULL as we create some | 199 // Some of the class table entries maybe NULL as we create some |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 | 549 |
| 543 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { | 550 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { |
| 544 ClassHeapStats* stats = PreliminaryStatsAt(cid); | 551 ClassHeapStats* stats = PreliminaryStatsAt(cid); |
| 545 ASSERT(stats != NULL); | 552 ASSERT(stats != NULL); |
| 546 ASSERT(size >= 0); | 553 ASSERT(size >= 0); |
| 547 stats->post_gc.AddNew(size); | 554 stats->post_gc.AddNew(size); |
| 548 } | 555 } |
| 549 | 556 |
| 550 | 557 |
| 551 } // namespace dart | 558 } // namespace dart |
| OLD | NEW |