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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 } | 189 } |
190 } | 190 } |
191 | 191 |
192 | 192 |
193 void ClassTable::Print() { | 193 void ClassTable::Print() { |
194 Class& cls = Class::Handle(); | 194 Class& cls = Class::Handle(); |
195 String& name = String::Handle(); | 195 String& name = String::Handle(); |
196 | 196 |
197 for (intptr_t i = 1; i < top_; i++) { | 197 for (intptr_t i = 1; i < top_; i++) { |
| 198 if (!HasValidClassAt(i)) { |
| 199 continue; |
| 200 } |
| 201 if (i == kFreeListElement) { |
| 202 continue; |
| 203 } |
198 cls = At(i); | 204 cls = At(i); |
199 if (cls.raw() != reinterpret_cast<RawClass*>(0)) { | 205 if (cls.raw() != reinterpret_cast<RawClass*>(0)) { |
200 name = cls.Name(); | 206 name = cls.Name(); |
201 OS::Print("%" Pd ": %s\n", i, name.ToCString()); | 207 OS::Print("%" Pd ": %s\n", i, name.ToCString()); |
202 } | 208 } |
203 } | 209 } |
204 } | 210 } |
205 | 211 |
206 | 212 |
207 void ClassTable::PrintToJSONObject(JSONObject* object) { | 213 void ClassTable::PrintToJSONObject(JSONObject* object) { |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 478 |
473 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { | 479 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { |
474 ClassHeapStats* stats = PreliminaryStatsAt(cid); | 480 ClassHeapStats* stats = PreliminaryStatsAt(cid); |
475 ASSERT(stats != NULL); | 481 ASSERT(stats != NULL); |
476 ASSERT(size >= 0); | 482 ASSERT(size >= 0); |
477 stats->post_gc.AddNew(size); | 483 stats->post_gc.AddNew(size); |
478 } | 484 } |
479 | 485 |
480 | 486 |
481 } // namespace dart | 487 } // namespace dart |
OLD | NEW |