OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/heap/object-stats.h" | 5 #include "src/heap/object-stats.h" |
6 | 6 |
7 #include "src/counters.h" | 7 #include "src/counters.h" |
8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 memset(over_allocated_, 0, sizeof(over_allocated_)); | 22 memset(over_allocated_, 0, sizeof(over_allocated_)); |
23 memset(size_histogram_, 0, sizeof(size_histogram_)); | 23 memset(size_histogram_, 0, sizeof(size_histogram_)); |
24 memset(over_allocated_histogram_, 0, sizeof(over_allocated_histogram_)); | 24 memset(over_allocated_histogram_, 0, sizeof(over_allocated_histogram_)); |
25 if (clear_last_time_stats) { | 25 if (clear_last_time_stats) { |
26 memset(object_counts_last_time_, 0, sizeof(object_counts_last_time_)); | 26 memset(object_counts_last_time_, 0, sizeof(object_counts_last_time_)); |
27 memset(object_sizes_last_time_, 0, sizeof(object_sizes_last_time_)); | 27 memset(object_sizes_last_time_, 0, sizeof(object_sizes_last_time_)); |
28 } | 28 } |
29 visited_fixed_array_sub_types_.clear(); | 29 visited_fixed_array_sub_types_.clear(); |
30 } | 30 } |
31 | 31 |
32 static void PrintJSONArray(size_t* array, const int len) { | 32 // Tell the compiler to never inline this: occasionally, the optimizer will |
| 33 // decide to inline this and unroll the loop, making the compiled code more than |
| 34 // 100KB larger. |
| 35 V8_NOINLINE static void PrintJSONArray(size_t* array, const int len) { |
33 PrintF("[ "); | 36 PrintF("[ "); |
34 for (int i = 0; i < len; i++) { | 37 for (int i = 0; i < len; i++) { |
35 PrintF("%zu", array[i]); | 38 PrintF("%zu", array[i]); |
36 if (i != (len - 1)) PrintF(", "); | 39 if (i != (len - 1)) PrintF(", "); |
37 } | 40 } |
38 PrintF(" ]"); | 41 PrintF(" ]"); |
39 } | 42 } |
40 | 43 |
41 void ObjectStats::PrintJSON(const char* key) { | 44 void ObjectStats::PrintJSON(const char* key) { |
42 double time = isolate()->time_millis_since_init(); | 45 double time = isolate()->time_millis_since_init(); |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); | 483 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); |
481 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); | 484 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); |
482 stats_->RecordFixedArraySubTypeStats( | 485 stats_->RecordFixedArraySubTypeStats( |
483 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, | 486 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, |
484 fast_cache->Size(), 0); | 487 fast_cache->Size(), 0); |
485 } | 488 } |
486 } | 489 } |
487 | 490 |
488 } // namespace internal | 491 } // namespace internal |
489 } // namespace v8 | 492 } // namespace v8 |
OLD | NEW |