Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: src/spaces.cc

Issue 726002: Add a bit more room for type string when reporting heap... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 } 1407 }
1408 1408
1409 return obj->Size(); 1409 return obj->Size();
1410 } 1410 }
1411 1411
1412 1412
1413 static void ReportHistogram(bool print_spill) { 1413 static void ReportHistogram(bool print_spill) {
1414 PrintF("\n Object Histogram:\n"); 1414 PrintF("\n Object Histogram:\n");
1415 for (int i = 0; i <= LAST_TYPE; i++) { 1415 for (int i = 0; i <= LAST_TYPE; i++) {
1416 if (heap_histograms[i].number() > 0) { 1416 if (heap_histograms[i].number() > 0) {
1417 PrintF(" %-33s%10d (%10d bytes)\n", 1417 PrintF(" %-34s%10d (%10d bytes)\n",
1418 heap_histograms[i].name(), 1418 heap_histograms[i].name(),
1419 heap_histograms[i].number(), 1419 heap_histograms[i].number(),
1420 heap_histograms[i].bytes()); 1420 heap_histograms[i].bytes());
1421 } 1421 }
1422 } 1422 }
1423 PrintF("\n"); 1423 PrintF("\n");
1424 1424
1425 // Summarize string types. 1425 // Summarize string types.
1426 int string_number = 0; 1426 int string_number = 0;
1427 int string_bytes = 0; 1427 int string_bytes = 0;
1428 #define INCREMENT(type, size, name, camel_name) \ 1428 #define INCREMENT(type, size, name, camel_name) \
1429 string_number += heap_histograms[type].number(); \ 1429 string_number += heap_histograms[type].number(); \
1430 string_bytes += heap_histograms[type].bytes(); 1430 string_bytes += heap_histograms[type].bytes();
1431 STRING_TYPE_LIST(INCREMENT) 1431 STRING_TYPE_LIST(INCREMENT)
1432 #undef INCREMENT 1432 #undef INCREMENT
1433 if (string_number > 0) { 1433 if (string_number > 0) {
1434 PrintF(" %-33s%10d (%10d bytes)\n\n", "STRING_TYPE", string_number, 1434 PrintF(" %-34s%10d (%10d bytes)\n\n", "STRING_TYPE", string_number,
1435 string_bytes); 1435 string_bytes);
1436 } 1436 }
1437 1437
1438 if (FLAG_collect_heap_spill_statistics && print_spill) { 1438 if (FLAG_collect_heap_spill_statistics && print_spill) {
1439 js_spill_information.Print(); 1439 js_spill_information.Print();
1440 } 1440 }
1441 } 1441 }
1442 #endif // DEBUG 1442 #endif // DEBUG
1443 1443
1444 1444
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 1493
1494 void NewSpace::ReportStatistics() { 1494 void NewSpace::ReportStatistics() {
1495 #ifdef DEBUG 1495 #ifdef DEBUG
1496 if (FLAG_heap_stats) { 1496 if (FLAG_heap_stats) {
1497 float pct = static_cast<float>(Available()) / Capacity(); 1497 float pct = static_cast<float>(Available()) / Capacity();
1498 PrintF(" capacity: %d, available: %d, %%%d\n", 1498 PrintF(" capacity: %d, available: %d, %%%d\n",
1499 Capacity(), Available(), static_cast<int>(pct*100)); 1499 Capacity(), Available(), static_cast<int>(pct*100));
1500 PrintF("\n Object Histogram:\n"); 1500 PrintF("\n Object Histogram:\n");
1501 for (int i = 0; i <= LAST_TYPE; i++) { 1501 for (int i = 0; i <= LAST_TYPE; i++) {
1502 if (allocated_histogram_[i].number() > 0) { 1502 if (allocated_histogram_[i].number() > 0) {
1503 PrintF(" %-33s%10d (%10d bytes)\n", 1503 PrintF(" %-34s%10d (%10d bytes)\n",
1504 allocated_histogram_[i].name(), 1504 allocated_histogram_[i].name(),
1505 allocated_histogram_[i].number(), 1505 allocated_histogram_[i].number(),
1506 allocated_histogram_[i].bytes()); 1506 allocated_histogram_[i].bytes());
1507 } 1507 }
1508 } 1508 }
1509 PrintF("\n"); 1509 PrintF("\n");
1510 } 1510 }
1511 #endif // DEBUG 1511 #endif // DEBUG
1512 1512
1513 #ifdef ENABLE_LOGGING_AND_PROFILING 1513 #ifdef ENABLE_LOGGING_AND_PROFILING
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
2870 reinterpret_cast<Object**>(object->address() 2870 reinterpret_cast<Object**>(object->address()
2871 + Page::kObjectAreaSize), 2871 + Page::kObjectAreaSize),
2872 allocation_top); 2872 allocation_top);
2873 PrintF("\n"); 2873 PrintF("\n");
2874 } 2874 }
2875 } 2875 }
2876 } 2876 }
2877 #endif // DEBUG 2877 #endif // DEBUG
2878 2878
2879 } } // namespace v8::internal 2879 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698