comparison src/share/vm/interpreter/invocationCounter.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 f95d63e2154a
children 836a62f43af9
comparison
equal deleted inserted replaced
9055:dcdeb150988c 10105:aeaca88565e6
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 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.
102 } 102 }
103 103
104 104
105 static address do_nothing(methodHandle method, TRAPS) { 105 static address do_nothing(methodHandle method, TRAPS) {
106 // dummy action for inactive invocation counters 106 // dummy action for inactive invocation counters
107 method->invocation_counter()->set_carry(); 107 MethodCounters* mcs = method->method_counters();
108 method->invocation_counter()->set_state(InvocationCounter::wait_for_nothing); 108 assert(mcs != NULL, "");
109 mcs->invocation_counter()->set_carry();
110 mcs->invocation_counter()->set_state(InvocationCounter::wait_for_nothing);
109 return NULL; 111 return NULL;
110 } 112 }
111 113
112 114
113 static address do_decay(methodHandle method, TRAPS) { 115 static address do_decay(methodHandle method, TRAPS) {
114 // decay invocation counters so compilation gets delayed 116 // decay invocation counters so compilation gets delayed
115 method->invocation_counter()->decay(); 117 MethodCounters* mcs = method->method_counters();
118 assert(mcs != NULL, "");
119 mcs->invocation_counter()->decay();
116 return NULL; 120 return NULL;
117 } 121 }
118 122
119 123
120 void InvocationCounter::def(State state, int init, Action action) { 124 void InvocationCounter::def(State state, int init, Action action) {