Mercurial > hg > graal-compiler
comparison src/share/vm/ci/ciMethod.cpp @ 10105:aeaca88565e6
8010862: The Method counter fields used for profiling can be allocated lazily.
Summary: Allocate the method's profiling related metadata until they are needed.
Reviewed-by: coleenp, roland
author | jiangli |
---|---|
date | Tue, 09 Apr 2013 17:17:41 -0400 |
parents | 16885e702c88 |
children | 6f3fd5150b67 |
comparison
equal
deleted
inserted
replaced
9055:dcdeb150988c | 10105:aeaca88565e6 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
903 if (md->is_empty()) return NULL; | 903 if (md->is_empty()) return NULL; |
904 return md; | 904 return md; |
905 } | 905 } |
906 | 906 |
907 // ------------------------------------------------------------------ | 907 // ------------------------------------------------------------------ |
908 // ciMethod::ensure_method_counters | |
909 // | |
910 address ciMethod::ensure_method_counters() { | |
911 check_is_loaded(); | |
912 VM_ENTRY_MARK; | |
913 methodHandle mh(THREAD, get_Method()); | |
914 MethodCounters *counter = mh->method_counters(); | |
915 if (counter == NULL) { | |
916 counter = Method::build_method_counters(mh(), CHECK_AND_CLEAR_NULL); | |
917 } | |
918 return (address)counter; | |
919 } | |
920 | |
921 // ------------------------------------------------------------------ | |
908 // ciMethod::should_exclude | 922 // ciMethod::should_exclude |
909 // | 923 // |
910 // Should this method be excluded from compilation? | 924 // Should this method be excluded from compilation? |
911 bool ciMethod::should_exclude() { | 925 bool ciMethod::should_exclude() { |
912 check_is_loaded(); | 926 check_is_loaded(); |
1189 | 1203 |
1190 void ciMethod::dump_replay_data(outputStream* st) { | 1204 void ciMethod::dump_replay_data(outputStream* st) { |
1191 ASSERT_IN_VM; | 1205 ASSERT_IN_VM; |
1192 ResourceMark rm; | 1206 ResourceMark rm; |
1193 Method* method = get_Method(); | 1207 Method* method = get_Method(); |
1208 MethodCounters* mcs = method->method_counters(); | |
1194 Klass* holder = method->method_holder(); | 1209 Klass* holder = method->method_holder(); |
1195 st->print_cr("ciMethod %s %s %s %d %d %d %d %d", | 1210 st->print_cr("ciMethod %s %s %s %d %d %d %d %d", |
1196 holder->name()->as_quoted_ascii(), | 1211 holder->name()->as_quoted_ascii(), |
1197 method->name()->as_quoted_ascii(), | 1212 method->name()->as_quoted_ascii(), |
1198 method->signature()->as_quoted_ascii(), | 1213 method->signature()->as_quoted_ascii(), |
1199 method->invocation_counter()->raw_counter(), | 1214 mcs == NULL ? 0 : mcs->invocation_counter()->raw_counter(), |
1200 method->backedge_counter()->raw_counter(), | 1215 mcs == NULL ? 0 : mcs->backedge_counter()->raw_counter(), |
1201 interpreter_invocation_count(), | 1216 interpreter_invocation_count(), |
1202 interpreter_throwout_count(), | 1217 interpreter_throwout_count(), |
1203 _instructions_size); | 1218 _instructions_size); |
1204 } | 1219 } |
1205 | 1220 |