2133 static int _size_histogram[MAX_ARITY]; // histogram of arg size in words |
2133 static int _size_histogram[MAX_ARITY]; // histogram of arg size in words |
2134 static int _max_arity; // max. arity seen |
2134 static int _max_arity; // max. arity seen |
2135 static int _max_size; // max. arg size seen |
2135 static int _max_size; // max. arg size seen |
2136 |
2136 |
2137 static void add_method_to_histogram(nmethod* nm) { |
2137 static void add_method_to_histogram(nmethod* nm) { |
2138 Method* m = nm->method(); |
2138 // These checks are taken from CodeHeapState::print_names() |
2139 ArgumentCount args(m->signature()); |
2139 Method* m = (nm == NULL) ? NULL : nm->method(); // nm->method() may be uninitialized, i.e. != NULL, but invalid |
2140 int arity = args.size() + (m->is_static() ? 0 : 1); |
2140 if ((nm != NULL) && (m != NULL) && !nm->is_zombie() && !nm->is_not_installed() && |
2141 int argsize = m->size_of_parameters(); |
2141 os::is_readable_pointer(m) && os::is_readable_pointer(m->constants())) { |
2142 arity = MIN2(arity, MAX_ARITY-1); |
2142 ArgumentCount args(m->signature()); |
2143 argsize = MIN2(argsize, MAX_ARITY-1); |
2143 int arity = args.size() + (m->is_static() ? 0 : 1); |
2144 int count = nm->method()->compiled_invocation_count(); |
2144 int argsize = m->size_of_parameters(); |
2145 _arity_histogram[arity] += count; |
2145 arity = MIN2(arity, MAX_ARITY-1); |
2146 _size_histogram[argsize] += count; |
2146 argsize = MIN2(argsize, MAX_ARITY-1); |
2147 _max_arity = MAX2(_max_arity, arity); |
2147 int count = nm->method()->compiled_invocation_count(); |
2148 _max_size = MAX2(_max_size, argsize); |
2148 _arity_histogram[arity] += count; |
|
2149 _size_histogram[argsize] += count; |
|
2150 _max_arity = MAX2(_max_arity, arity); |
|
2151 _max_size = MAX2(_max_size, argsize); |
|
2152 } |
2149 } |
2153 } |
2150 |
2154 |
2151 void print_histogram_helper(int n, int* histo, const char* name) { |
2155 void print_histogram_helper(int n, int* histo, const char* name) { |
2152 const int N = MIN2(5, n); |
2156 const int N = MIN2(5, n); |
2153 tty->print_cr("\nHistogram of call arity (incl. rcvr, calls to compiled methods only):"); |
2157 tty->print_cr("\nHistogram of call arity (incl. rcvr, calls to compiled methods only):"); |