| 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/pages.h" | 5 #include "vm/pages.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/compiler_stats.h" | 8 #include "vm/compiler_stats.h" |
| 9 #include "vm/gc_marker.h" | 9 #include "vm/gc_marker.h" |
| 10 #include "vm/gc_sweeper.h" | 10 #include "vm/gc_sweeper.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 } | 438 } |
| 439 private: | 439 private: |
| 440 JSONArray* array_; | 440 JSONArray* array_; |
| 441 }; | 441 }; |
| 442 | 442 |
| 443 | 443 |
| 444 void PageSpace::PrintHeapMapToJSONStream(JSONStream* stream) { | 444 void PageSpace::PrintHeapMapToJSONStream(JSONStream* stream) { |
| 445 JSONObject heap_map(stream); | 445 JSONObject heap_map(stream); |
| 446 heap_map.AddProperty("type", "HeapMap"); | 446 heap_map.AddProperty("type", "HeapMap"); |
| 447 heap_map.AddProperty("id", "heapmap"); | 447 heap_map.AddProperty("id", "heapmap"); |
| 448 heap_map.AddProperty("free_class_id", kFreeListElement); | 448 heap_map.AddProperty("free_class_id", |
| 449 heap_map.AddProperty("unit_size_bytes", kObjectAlignment); | 449 static_cast<intptr_t>(kFreeListElement)); |
| 450 heap_map.AddProperty("unit_size_bytes", |
| 451 static_cast<intptr_t>(kObjectAlignment)); |
| 450 { | 452 { |
| 451 // "pages" is an array [page0, page1, ..., pageN], each page an array | 453 // "pages" is an array [page0, page1, ..., pageN], each page an array |
| 452 // [size, class id, size, class id, ...] (size unit is kObjectAlignment). | 454 // [size, class id, size, class id, ...] (size unit is kObjectAlignment). |
| 453 JSONArray all_pages(&heap_map, "pages"); | 455 JSONArray all_pages(&heap_map, "pages"); |
| 454 for (HeapPage* page = pages_; page != NULL; page = page->next()) { | 456 for (HeapPage* page = pages_; page != NULL; page = page->next()) { |
| 455 JSONArray page_map(&all_pages); | 457 JSONArray page_map(&all_pages); |
| 456 HeapMapAsJSONVisitor printer(&page_map); | 458 HeapMapAsJSONVisitor printer(&page_map); |
| 457 page->VisitObjects(&printer); | 459 page->VisitObjects(&printer); |
| 458 } | 460 } |
| 459 } | 461 } |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 return 0; | 737 return 0; |
| 736 } else { | 738 } else { |
| 737 ASSERT(total_time >= gc_time); | 739 ASSERT(total_time >= gc_time); |
| 738 int result= static_cast<int>((static_cast<double>(gc_time) / | 740 int result= static_cast<int>((static_cast<double>(gc_time) / |
| 739 static_cast<double>(total_time)) * 100); | 741 static_cast<double>(total_time)) * 100); |
| 740 return result; | 742 return result; |
| 741 } | 743 } |
| 742 } | 744 } |
| 743 | 745 |
| 744 } // namespace dart | 746 } // namespace dart |
| OLD | NEW |