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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 void ClassHeapStats::UpdatePromotedAfterNewGC() { | 298 void ClassHeapStats::UpdatePromotedAfterNewGC() { |
299 promoted_count = recent.old_count - old_pre_new_gc_count_; | 299 promoted_count = recent.old_count - old_pre_new_gc_count_; |
300 promoted_size = recent.old_size - old_pre_new_gc_size_; | 300 promoted_size = recent.old_size - old_pre_new_gc_size_; |
301 } | 301 } |
302 | 302 |
303 | 303 |
304 void ClassHeapStats::PrintToJSONObject(const Class& cls, | 304 void ClassHeapStats::PrintToJSONObject(const Class& cls, |
305 JSONObject* obj) const { | 305 JSONObject* obj) const { |
306 obj->AddProperty("type", "ClassHeapStats"); | 306 obj->AddProperty("type", "ClassHeapStats"); |
307 obj->AddPropertyF("id", "allocationprofile/%" Pd "", cls.id()); | |
308 obj->AddProperty("class", cls); | 307 obj->AddProperty("class", cls); |
309 { | 308 { |
310 JSONArray new_stats(obj, "new"); | 309 JSONArray new_stats(obj, "new"); |
311 new_stats.AddValue(pre_gc.new_count); | 310 new_stats.AddValue(pre_gc.new_count); |
312 new_stats.AddValue(pre_gc.new_size); | 311 new_stats.AddValue(pre_gc.new_size); |
313 new_stats.AddValue(post_gc.new_count); | 312 new_stats.AddValue(post_gc.new_count); |
314 new_stats.AddValue(post_gc.new_size); | 313 new_stats.AddValue(post_gc.new_size); |
315 new_stats.AddValue(recent.new_count); | 314 new_stats.AddValue(recent.new_count); |
316 new_stats.AddValue(recent.new_size); | 315 new_stats.AddValue(recent.new_size); |
317 new_stats.AddValue64(accumulated.new_count + recent.new_count - | 316 new_stats.AddValue64(accumulated.new_count + recent.new_count - |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 } | 415 } |
417 | 416 |
418 | 417 |
419 void ClassTable::AllocationProfilePrintJSON(JSONStream* stream) { | 418 void ClassTable::AllocationProfilePrintJSON(JSONStream* stream) { |
420 Isolate* isolate = Isolate::Current(); | 419 Isolate* isolate = Isolate::Current(); |
421 ASSERT(isolate != NULL); | 420 ASSERT(isolate != NULL); |
422 Heap* heap = isolate->heap(); | 421 Heap* heap = isolate->heap(); |
423 ASSERT(heap != NULL); | 422 ASSERT(heap != NULL); |
424 JSONObject obj(stream); | 423 JSONObject obj(stream); |
425 obj.AddProperty("type", "AllocationProfile"); | 424 obj.AddProperty("type", "AllocationProfile"); |
426 obj.AddProperty("id", "allocationprofile"); | |
427 obj.AddPropertyF( | 425 obj.AddPropertyF( |
428 "dateLastAccumulatorReset", | 426 "dateLastAccumulatorReset", |
429 "%" Pd64 "", | 427 "%" Pd64 "", |
430 isolate->last_allocationprofile_accumulator_reset_timestamp()); | 428 isolate->last_allocationprofile_accumulator_reset_timestamp()); |
431 obj.AddPropertyF( | 429 obj.AddPropertyF( |
432 "dateLastServiceGC", | 430 "dateLastServiceGC", |
433 "%" Pd64 "", | 431 "%" Pd64 "", |
434 isolate->last_allocationprofile_gc_timestamp()); | 432 isolate->last_allocationprofile_gc_timestamp()); |
435 | 433 |
436 { | 434 { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 475 |
478 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { | 476 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { |
479 ClassHeapStats* stats = PreliminaryStatsAt(cid); | 477 ClassHeapStats* stats = PreliminaryStatsAt(cid); |
480 ASSERT(stats != NULL); | 478 ASSERT(stats != NULL); |
481 ASSERT(size >= 0); | 479 ASSERT(size >= 0); |
482 stats->post_gc.AddNew(size); | 480 stats->post_gc.AddNew(size); |
483 } | 481 } |
484 | 482 |
485 | 483 |
486 } // namespace dart | 484 } // namespace dart |
OLD | NEW |