Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1792 | 1792 |
| 1793 static void ClearCodeKindStatistics() { | 1793 static void ClearCodeKindStatistics() { |
| 1794 Isolate* isolate = Isolate::Current(); | 1794 Isolate* isolate = Isolate::Current(); |
| 1795 for (int i = 0; i < Code::NUMBER_OF_KINDS; i++) { | 1795 for (int i = 0; i < Code::NUMBER_OF_KINDS; i++) { |
| 1796 isolate->code_kind_statistics()[i] = 0; | 1796 isolate->code_kind_statistics()[i] = 0; |
| 1797 } | 1797 } |
| 1798 } | 1798 } |
| 1799 | 1799 |
| 1800 | 1800 |
| 1801 static void ReportCodeKindStatistics() { | 1801 static void ReportCodeKindStatistics() { |
| 1802 Isolate* isolate = Isolate::Current(); | 1802 Isolate* isolate = Isolate::Current(); |
|
Sven Panne
2013/06/25 08:08:10
Not from your change, but let's change this while
Benedikt Meurer
2013/06/25 08:48:09
Done.
| |
| 1803 const char* table[Code::NUMBER_OF_KINDS] = { NULL }; | 1803 const char* table[Code::NUMBER_OF_KINDS] = { NULL }; |
|
Sven Panne
2013/06/25 08:08:10
Nuke the table and just use Code::Kind2String belo
Benedikt Meurer
2013/06/25 08:48:09
Done.
| |
| 1804 | 1804 |
| 1805 #define CASE(name) \ | |
| 1806 case Code::name: table[Code::name] = #name; \ | |
| 1807 break | |
| 1808 | |
| 1809 for (int i = 0; i < Code::NUMBER_OF_KINDS; i++) { | 1805 for (int i = 0; i < Code::NUMBER_OF_KINDS; i++) { |
| 1810 switch (static_cast<Code::Kind>(i)) { | 1806 table[i] = Code::Kind2String(static_cast<Code::Kind>(i)); |
| 1811 CASE(FUNCTION); | |
| 1812 CASE(OPTIMIZED_FUNCTION); | |
| 1813 CASE(STUB); | |
| 1814 CASE(BUILTIN); | |
| 1815 CASE(LOAD_IC); | |
| 1816 CASE(KEYED_LOAD_IC); | |
| 1817 CASE(STORE_IC); | |
| 1818 CASE(KEYED_STORE_IC); | |
| 1819 CASE(CALL_IC); | |
| 1820 CASE(KEYED_CALL_IC); | |
| 1821 CASE(UNARY_OP_IC); | |
| 1822 CASE(BINARY_OP_IC); | |
| 1823 CASE(COMPARE_IC); | |
| 1824 CASE(COMPARE_NIL_IC); | |
| 1825 CASE(TO_BOOLEAN_IC); | |
| 1826 CASE(REGEXP); | |
| 1827 } | |
| 1828 } | 1807 } |
| 1829 | 1808 |
| 1830 #undef CASE | |
| 1831 | |
| 1832 PrintF("\n Code kind histograms: \n"); | 1809 PrintF("\n Code kind histograms: \n"); |
| 1833 for (int i = 0; i < Code::NUMBER_OF_KINDS; i++) { | 1810 for (int i = 0; i < Code::NUMBER_OF_KINDS; i++) { |
| 1834 if (isolate->code_kind_statistics()[i] > 0) { | 1811 if (isolate->code_kind_statistics()[i] > 0) { |
| 1835 PrintF(" %-20s: %10d bytes\n", table[i], | 1812 PrintF(" %-20s: %10d bytes\n", table[i], |
| 1836 isolate->code_kind_statistics()[i]); | 1813 isolate->code_kind_statistics()[i]); |
| 1837 } | 1814 } |
| 1838 } | 1815 } |
| 1839 PrintF("\n"); | 1816 PrintF("\n"); |
| 1840 } | 1817 } |
| 1841 | 1818 |
| (...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3235 object->ShortPrint(); | 3212 object->ShortPrint(); |
| 3236 PrintF("\n"); | 3213 PrintF("\n"); |
| 3237 } | 3214 } |
| 3238 printf(" --------------------------------------\n"); | 3215 printf(" --------------------------------------\n"); |
| 3239 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3216 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3240 } | 3217 } |
| 3241 | 3218 |
| 3242 #endif // DEBUG | 3219 #endif // DEBUG |
| 3243 | 3220 |
| 3244 } } // namespace v8::internal | 3221 } } // namespace v8::internal |
| OLD | NEW |