| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 last_reset.new_size = recent.new_size; | 236 last_reset.new_size = recent.new_size; |
| 237 last_reset.old_count = recent.old_count; | 237 last_reset.old_count = recent.old_count; |
| 238 last_reset.old_size = recent.old_size; | 238 last_reset.old_size = recent.old_size; |
| 239 accumulated.Reset(); | 239 accumulated.Reset(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 | 242 |
| 243 void ClassHeapStats::PrintTOJSONArray(const Class& cls, JSONArray* array) { | 243 void ClassHeapStats::PrintTOJSONArray(const Class& cls, JSONArray* array) { |
| 244 JSONObject obj(array); | 244 JSONObject obj(array); |
| 245 obj.AddProperty("type", "ClassHeapStats"); | 245 obj.AddProperty("type", "ClassHeapStats"); |
| 246 obj.AddPropertyF("id", "allocationprofile/%" Pd "", cls.id()); |
| 246 obj.AddProperty("class", cls); | 247 obj.AddProperty("class", cls); |
| 247 { | 248 { |
| 248 JSONArray new_stats(&obj, "new"); | 249 JSONArray new_stats(&obj, "new"); |
| 249 new_stats.AddValue(pre_gc.new_count); | 250 new_stats.AddValue(pre_gc.new_count); |
| 250 new_stats.AddValue(pre_gc.new_size); | 251 new_stats.AddValue(pre_gc.new_size); |
| 251 new_stats.AddValue(post_gc.new_count); | 252 new_stats.AddValue(post_gc.new_count); |
| 252 new_stats.AddValue(post_gc.new_size); | 253 new_stats.AddValue(post_gc.new_size); |
| 253 new_stats.AddValue(recent.new_count); | 254 new_stats.AddValue(recent.new_count); |
| 254 new_stats.AddValue(recent.new_size); | 255 new_stats.AddValue(recent.new_size); |
| 255 new_stats.AddValue64(accumulated.new_count + recent.new_count - | 256 new_stats.AddValue64(accumulated.new_count + recent.new_count - |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } | 325 } |
| 325 | 326 |
| 326 | 327 |
| 327 void ClassTable::AllocationProfilePrintToJSONStream(JSONStream* stream) { | 328 void ClassTable::AllocationProfilePrintToJSONStream(JSONStream* stream) { |
| 328 Isolate* isolate = Isolate::Current(); | 329 Isolate* isolate = Isolate::Current(); |
| 329 ASSERT(isolate != NULL); | 330 ASSERT(isolate != NULL); |
| 330 Heap* heap = isolate->heap(); | 331 Heap* heap = isolate->heap(); |
| 331 ASSERT(heap != NULL); | 332 ASSERT(heap != NULL); |
| 332 JSONObject obj(stream); | 333 JSONObject obj(stream); |
| 333 obj.AddProperty("type", "AllocationProfile"); | 334 obj.AddProperty("type", "AllocationProfile"); |
| 335 obj.AddProperty("id", "allocationprofile"); |
| 334 { | 336 { |
| 335 JSONObject heaps(&obj, "heaps"); | 337 JSONObject heaps(&obj, "heaps"); |
| 336 { | 338 { |
| 337 heap->PrintToJSONObject(Heap::kNew, &heaps); | 339 heap->PrintToJSONObject(Heap::kNew, &heaps); |
| 338 } | 340 } |
| 339 { | 341 { |
| 340 heap->PrintToJSONObject(Heap::kOld, &heaps); | 342 heap->PrintToJSONObject(Heap::kOld, &heaps); |
| 341 } | 343 } |
| 342 } | 344 } |
| 343 { | 345 { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 426 |
| 425 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { | 427 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { |
| 426 ClassHeapStats* stats = StatsAt(cid); | 428 ClassHeapStats* stats = StatsAt(cid); |
| 427 ASSERT(stats != NULL); | 429 ASSERT(stats != NULL); |
| 428 ASSERT(size >= 0); | 430 ASSERT(size >= 0); |
| 429 stats->post_gc.AddNew(size); | 431 stats->post_gc.AddNew(size); |
| 430 } | 432 } |
| 431 | 433 |
| 432 | 434 |
| 433 } // namespace dart | 435 } // namespace dart |
| OLD | NEW |