| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 for (intptr_t i = 1; i < top_; i++) { | 160 for (intptr_t i = 1; i < top_; i++) { |
| 161 cls = At(i); | 161 cls = At(i); |
| 162 if (cls.raw() != reinterpret_cast<RawClass*>(0)) { | 162 if (cls.raw() != reinterpret_cast<RawClass*>(0)) { |
| 163 name = cls.Name(); | 163 name = cls.Name(); |
| 164 OS::Print("%" Pd ": %s\n", i, name.ToCString()); | 164 OS::Print("%" Pd ": %s\n", i, name.ToCString()); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 | 169 |
| 170 void ClassTable::PrintToJSONStream(JSONStream* stream) { | 170 void ClassTable::PrintToJSONObject(JSONObject* object) { |
| 171 Class& cls = Class::Handle(); | 171 Class& cls = Class::Handle(); |
| 172 JSONObject jsobj(stream); | 172 object->AddProperty("type", "ClassList"); |
| 173 jsobj.AddProperty("type", "ClassList"); | 173 object->AddProperty("id", "classes"); |
| 174 { | 174 { |
| 175 JSONArray members(&jsobj, "members"); | 175 JSONArray members(object, "members"); |
| 176 for (intptr_t i = 1; i < top_; i++) { | 176 for (intptr_t i = 1; i < top_; i++) { |
| 177 if (HasValidClassAt(i)) { | 177 if (HasValidClassAt(i)) { |
| 178 cls = At(i); | 178 cls = At(i); |
| 179 members.AddValue(cls); | 179 members.AddValue(cls); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 | 184 |
| 185 | 185 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 | 426 |
| 427 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { | 427 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { |
| 428 ClassHeapStats* stats = StatsAt(cid); | 428 ClassHeapStats* stats = StatsAt(cid); |
| 429 ASSERT(stats != NULL); | 429 ASSERT(stats != NULL); |
| 430 ASSERT(size >= 0); | 430 ASSERT(size >= 0); |
| 431 stats->post_gc.AddNew(size); | 431 stats->post_gc.AddNew(size); |
| 432 } | 432 } |
| 433 | 433 |
| 434 | 434 |
| 435 } // namespace dart | 435 } // namespace dart |
| OLD | NEW |