Mercurial > hg > truffle
comparison src/share/vm/runtime/simpleThresholdPolicy.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 | 9191895df19d |
children | 487d442ef257 |
comparison
equal
deleted
inserted
replaced
9055:dcdeb150988c | 10105:aeaca88565e6 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2010, 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. |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 // Set carry flags on the counters if necessary | 154 // Set carry flags on the counters if necessary |
155 void SimpleThresholdPolicy::handle_counter_overflow(Method* method) { | 155 void SimpleThresholdPolicy::handle_counter_overflow(Method* method) { |
156 set_carry_if_necessary(method->invocation_counter()); | 156 MethodCounters *mcs = method->method_counters(); |
157 set_carry_if_necessary(method->backedge_counter()); | 157 assert(mcs != NULL, ""); |
158 set_carry_if_necessary(mcs->invocation_counter()); | |
159 set_carry_if_necessary(mcs->backedge_counter()); | |
158 MethodData* mdo = method->method_data(); | 160 MethodData* mdo = method->method_data(); |
159 if (mdo != NULL) { | 161 if (mdo != NULL) { |
160 set_carry_if_necessary(mdo->invocation_counter()); | 162 set_carry_if_necessary(mdo->invocation_counter()); |
161 set_carry_if_necessary(mdo->backedge_counter()); | 163 set_carry_if_necessary(mdo->backedge_counter()); |
162 } | 164 } |