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/heap.h" | 8 #include "vm/heap.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/raw_object.h" | 10 #include "vm/raw_object.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 168 } |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 | 172 |
173 void ClassTable::Print() { | 173 void ClassTable::Print() { |
174 Class& cls = Class::Handle(); | 174 Class& cls = Class::Handle(); |
175 String& name = String::Handle(); | 175 String& name = String::Handle(); |
176 | 176 |
177 for (intptr_t i = 1; i < top_; i++) { | 177 for (intptr_t i = 1; i < top_; i++) { |
| 178 if (!HasValidClassAt(i)) { |
| 179 continue; |
| 180 } |
| 181 if (i == kFreeListElement) { |
| 182 continue; |
| 183 } |
178 cls = At(i); | 184 cls = At(i); |
179 if (cls.raw() != reinterpret_cast<RawClass*>(0)) { | 185 if (cls.raw() != reinterpret_cast<RawClass*>(0)) { |
180 name = cls.Name(); | 186 name = cls.Name(); |
181 OS::Print("%" Pd ": %s\n", i, name.ToCString()); | 187 OS::Print("%" Pd ": %s\n", i, name.ToCString()); |
182 } | 188 } |
183 } | 189 } |
184 } | 190 } |
185 | 191 |
186 | 192 |
187 void ClassTable::PrintToJSONObject(JSONObject* object) { | 193 void ClassTable::PrintToJSONObject(JSONObject* object) { |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 458 |
453 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { | 459 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { |
454 ClassHeapStats* stats = PreliminaryStatsAt(cid); | 460 ClassHeapStats* stats = PreliminaryStatsAt(cid); |
455 ASSERT(stats != NULL); | 461 ASSERT(stats != NULL); |
456 ASSERT(size >= 0); | 462 ASSERT(size >= 0); |
457 stats->post_gc.AddNew(size); | 463 stats->post_gc.AddNew(size); |
458 } | 464 } |
459 | 465 |
460 | 466 |
461 } // namespace dart | 467 } // namespace dart |
OLD | NEW |