Print this page
rev 6900 : 8048169: Change 8037816 breaks HS build on PPC64 and CPP-Interpreter platforms
Summary: Fix the matching of format string parameter types to the actual argument types for the PPC64 and CPP-Interpreter files in the same way as 8037816 already did it for all the other files
Reviewed-by: stefank, coleenp, dholmes
Split |
Split |
Close |
Expand all |
Collapse all |
--- old/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp
+++ new/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp
1 1 /*
2 - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
3 - * Copyright 2012, 2013 SAP AG. All rights reserved.
2 + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
3 + * Copyright 2012, 2014 SAP AG. All rights reserved.
4 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 5 *
6 6 * This code is free software; you can redistribute it and/or modify it
7 7 * under the terms of the GNU General Public License version 2 only, as
8 8 * published by the Free Software Foundation.
9 9 *
10 10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 13 * version 2 for more details (a copy is included in the LICENSE file that
14 14 * accompanied this code).
15 15 *
16 16 * You should have received a copy of the GNU General Public License version
17 17 * 2 along with this work; if not, write to the Free Software Foundation,
18 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 19 *
20 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 21 * or visit www.oracle.com if you need additional information or have any
22 22 * questions.
23 23 *
24 24 */
25 25
26 26 // This file defines a set of macros which are used by the c++-interpreter
27 27 // for updating a method's methodData object.
28 28
29 29
30 30 #ifndef SHARE_VM_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP
31 31 #define SHARE_VM_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP
32 32
33 33
34 34 // Global settings /////////////////////////////////////////////////////////////
35 35
36 36
37 37 // Enables profiling support.
38 38 #if defined(COMPILER2)
39 39 #define CC_INTERP_PROFILE
40 40 #endif
41 41
42 42 // Enables assertions for profiling code (also works in product-builds).
43 43 // #define CC_INTERP_PROFILE_WITH_ASSERTIONS
44 44
45 45
46 46 #ifdef CC_INTERP
47 47
48 48 // Empty dummy implementations if profiling code is switched off. //////////////
49 49
50 50 #ifndef CC_INTERP_PROFILE
51 51
52 52 #define SET_MDX(mdx)
53 53
54 54 #define BI_PROFILE_GET_OR_CREATE_METHOD_DATA(exception_handler) \
55 55 if (ProfileInterpreter) { \
56 56 ShouldNotReachHere(); \
57 57 }
58 58
59 59 #define BI_PROFILE_ALIGN_TO_CURRENT_BCI()
60 60
61 61 #define BI_PROFILE_UPDATE_JUMP()
62 62 #define BI_PROFILE_UPDATE_BRANCH(is_taken)
63 63 #define BI_PROFILE_UPDATE_RET(bci)
64 64 #define BI_PROFILE_SUBTYPECHECK_FAILED(receiver)
65 65 #define BI_PROFILE_UPDATE_CHECKCAST(null_seen, receiver)
66 66 #define BI_PROFILE_UPDATE_INSTANCEOF(null_seen, receiver)
67 67 #define BI_PROFILE_UPDATE_CALL()
68 68 #define BI_PROFILE_UPDATE_FINALCALL()
69 69 #define BI_PROFILE_UPDATE_VIRTUALCALL(receiver)
70 70 #define BI_PROFILE_UPDATE_SWITCH(switch_index)
71 71
72 72
73 73 #else
74 74
75 75
76 76 // Non-dummy implementations ///////////////////////////////////////////////////
77 77
78 78 // Accessors for the current method data pointer 'mdx'.
↓ open down ↓ |
65 lines elided |
↑ open up ↑ |
79 79 #define MDX() (istate->mdx())
80 80 #define SET_MDX(mdx) \
81 81 if (TraceProfileInterpreter) { \
82 82 /* Let it look like TraceBytecodes' format. */ \
83 83 tty->print_cr("[%d] %4d " \
84 84 "mdx " PTR_FORMAT "(%d)" \
85 85 " " \
86 86 " \t-> " PTR_FORMAT "(%d)", \
87 87 (int) THREAD->osthread()->thread_id(), \
88 88 BCI(), \
89 - MDX(), \
89 + p2i(MDX()), \
90 90 (MDX() == NULL \
91 91 ? 0 \
92 92 : istate->method()->method_data()->dp_to_di((address)MDX())), \
93 - mdx, \
93 + p2i(mdx), \
94 94 istate->method()->method_data()->dp_to_di((address)mdx) \
95 95 ); \
96 96 }; \
97 97 istate->set_mdx(mdx);
98 98
99 99
100 100 // Dumps the profiling method data for the current method.
101 101 #ifdef PRODUCT
102 102 #define BI_PROFILE_PRINT_METHOD_DATA()
103 103 #else // PRODUCT
104 104 #define BI_PROFILE_PRINT_METHOD_DATA() \
105 105 { \
106 106 ttyLocker ttyl; \
107 107 MethodData *md = istate->method()->method_data(); \
108 108 tty->cr(); \
109 109 tty->print("method data at mdx " PTR_FORMAT "(0) for", \
110 - md->data_layout_at(md->bci_to_di(0))); \
110 + p2i(md->data_layout_at(md->bci_to_di(0)))); \
111 111 istate->method()->print_short_name(tty); \
112 112 tty->cr(); \
113 113 if (md != NULL) { \
114 114 md->print_data_on(tty); \
115 115 address mdx = (address) MDX(); \
116 116 if (mdx != NULL) { \
117 117 tty->print_cr("current mdx " PTR_FORMAT "(%d)", \
118 - mdx, \
118 + p2i(mdx), \
119 119 istate->method()->method_data()->dp_to_di(mdx)); \
120 120 } \
121 121 } else { \
122 122 tty->print_cr("no method data"); \
123 123 } \
124 124 }
125 125 #endif // PRODUCT
126 126
127 127
128 128 // Gets or creates the profiling method data and initializes mdx.
129 129 #define BI_PROFILE_GET_OR_CREATE_METHOD_DATA(exception_handler) \
130 130 if (ProfileInterpreter && MDX() == NULL) { \
131 131 /* Mdx is not yet initialized for this activation. */ \
132 132 MethodData *md = istate->method()->method_data(); \
133 133 if (md == NULL) { \
134 134 MethodCounters* mcs; \
135 135 GET_METHOD_COUNTERS(mcs); \
136 136 /* The profiling method data doesn't exist for this method, */ \
137 137 /* create it if the counters have overflowed. */ \
138 138 if (mcs->invocation_counter() \
139 139 ->reached_ProfileLimit(mcs->backedge_counter())) { \
140 140 /* Must use CALL_VM, because an async exception may be pending. */ \
141 141 CALL_VM((InterpreterRuntime::profile_method(THREAD)), \
142 142 exception_handler); \
143 143 md = istate->method()->method_data(); \
144 144 if (md != NULL) { \
145 145 if (TraceProfileInterpreter) { \
146 146 BI_PROFILE_PRINT_METHOD_DATA(); \
147 147 } \
148 148 Method *m = istate->method(); \
149 149 int bci = m->bci_from(pc); \
150 150 jint di = md->bci_to_di(bci); \
151 151 SET_MDX(md->data_layout_at(di)); \
152 152 } \
153 153 } \
154 154 } else { \
155 155 /* The profiling method data exists, align the method data pointer */ \
156 156 /* mdx to the current bytecode index. */ \
157 157 if (TraceProfileInterpreter) { \
158 158 BI_PROFILE_PRINT_METHOD_DATA(); \
159 159 } \
160 160 SET_MDX(md->data_layout_at(md->bci_to_di(BCI()))); \
161 161 } \
162 162 }
163 163
164 164
165 165 // Asserts that the current method data pointer mdx corresponds
166 166 // to the current bytecode.
167 167 #if defined(CC_INTERP_PROFILE_WITH_ASSERTIONS)
168 168 #define BI_PROFILE_CHECK_MDX() \
169 169 { \
170 170 MethodData *md = istate->method()->method_data(); \
171 171 address mdx = (address) MDX(); \
172 172 address mdx2 = (address) md->data_layout_at(md->bci_to_di(BCI())); \
173 173 guarantee(md != NULL, "1"); \
174 174 guarantee(mdx != NULL, "2"); \
175 175 guarantee(mdx2 != NULL, "3"); \
176 176 if (mdx != mdx2) { \
177 177 BI_PROFILE_PRINT_METHOD_DATA(); \
178 178 fatal3("invalid mdx at bci %d:" \
179 179 " was " PTR_FORMAT \
180 180 " but expected " PTR_FORMAT, \
181 181 BCI(), \
182 182 mdx, \
183 183 mdx2); \
184 184 } \
185 185 }
186 186 #else
187 187 #define BI_PROFILE_CHECK_MDX()
188 188 #endif
189 189
190 190
191 191 // Aligns the method data pointer mdx to the current bytecode index.
192 192 #define BI_PROFILE_ALIGN_TO_CURRENT_BCI() \
193 193 if (ProfileInterpreter && MDX() != NULL) { \
194 194 MethodData *md = istate->method()->method_data(); \
195 195 SET_MDX(md->data_layout_at(md->bci_to_di(BCI()))); \
196 196 }
197 197
198 198
199 199 // Updates profiling data for a jump.
200 200 #define BI_PROFILE_UPDATE_JUMP() \
201 201 if (ProfileInterpreter && MDX() != NULL) { \
202 202 BI_PROFILE_CHECK_MDX(); \
203 203 JumpData::increment_taken_count_no_overflow(MDX()); \
204 204 /* Remember last branch taken count. */ \
205 205 mdo_last_branch_taken_count = JumpData::taken_count(MDX()); \
206 206 SET_MDX(JumpData::advance_taken(MDX())); \
207 207 }
208 208
209 209
210 210 // Updates profiling data for a taken/not taken branch.
211 211 #define BI_PROFILE_UPDATE_BRANCH(is_taken) \
212 212 if (ProfileInterpreter && MDX() != NULL) { \
213 213 BI_PROFILE_CHECK_MDX(); \
214 214 if (is_taken) { \
215 215 BranchData::increment_taken_count_no_overflow(MDX()); \
216 216 /* Remember last branch taken count. */ \
217 217 mdo_last_branch_taken_count = BranchData::taken_count(MDX()); \
218 218 SET_MDX(BranchData::advance_taken(MDX())); \
219 219 } else { \
220 220 BranchData::increment_not_taken_count_no_overflow(MDX()); \
221 221 SET_MDX(BranchData::advance_not_taken(MDX())); \
222 222 } \
223 223 }
224 224
225 225
226 226 // Updates profiling data for a ret with given bci.
227 227 #define BI_PROFILE_UPDATE_RET(bci) \
228 228 if (ProfileInterpreter && MDX() != NULL) { \
229 229 BI_PROFILE_CHECK_MDX(); \
230 230 MethodData *md = istate->method()->method_data(); \
231 231 /* FIXME: there is more to do here than increment and advance(mdx)! */ \
232 232 CounterData::increment_count_no_overflow(MDX()); \
233 233 SET_MDX(RetData::advance(md, bci)); \
234 234 }
235 235
236 236 // Decrement counter at checkcast if the subtype check fails (as template
237 237 // interpreter does!).
238 238 #define BI_PROFILE_SUBTYPECHECK_FAILED(receiver) \
239 239 if (ProfileInterpreter && MDX() != NULL) { \
240 240 BI_PROFILE_CHECK_MDX(); \
241 241 ReceiverTypeData::increment_receiver_count_no_overflow(MDX(), receiver); \
242 242 ReceiverTypeData::decrement_count(MDX()); \
243 243 }
244 244
245 245 // Updates profiling data for a checkcast (was a null seen? which receiver?).
246 246 #define BI_PROFILE_UPDATE_CHECKCAST(null_seen, receiver) \
247 247 if (ProfileInterpreter && MDX() != NULL) { \
248 248 BI_PROFILE_CHECK_MDX(); \
249 249 if (null_seen) { \
250 250 ReceiverTypeData::set_null_seen(MDX()); \
251 251 } else { \
252 252 /* Template interpreter doesn't increment count. */ \
253 253 /* ReceiverTypeData::increment_count_no_overflow(MDX()); */ \
254 254 ReceiverTypeData::increment_receiver_count_no_overflow(MDX(), receiver); \
255 255 } \
256 256 SET_MDX(ReceiverTypeData::advance(MDX())); \
257 257 }
258 258
259 259
260 260 // Updates profiling data for an instanceof (was a null seen? which receiver?).
261 261 #define BI_PROFILE_UPDATE_INSTANCEOF(null_seen, receiver) \
262 262 BI_PROFILE_UPDATE_CHECKCAST(null_seen, receiver)
263 263
264 264
265 265 // Updates profiling data for a call.
266 266 #define BI_PROFILE_UPDATE_CALL() \
267 267 if (ProfileInterpreter && MDX() != NULL) { \
268 268 BI_PROFILE_CHECK_MDX(); \
269 269 CounterData::increment_count_no_overflow(MDX()); \
270 270 SET_MDX(CounterData::advance(MDX())); \
271 271 }
272 272
273 273
274 274 // Updates profiling data for a final call.
275 275 #define BI_PROFILE_UPDATE_FINALCALL() \
276 276 if (ProfileInterpreter && MDX() != NULL) { \
277 277 BI_PROFILE_CHECK_MDX(); \
278 278 VirtualCallData::increment_count_no_overflow(MDX()); \
279 279 SET_MDX(VirtualCallData::advance(MDX())); \
280 280 }
281 281
282 282
283 283 // Updates profiling data for a virtual call with given receiver Klass.
284 284 #define BI_PROFILE_UPDATE_VIRTUALCALL(receiver) \
285 285 if (ProfileInterpreter && MDX() != NULL) { \
286 286 BI_PROFILE_CHECK_MDX(); \
287 287 VirtualCallData::increment_receiver_count_no_overflow(MDX(), receiver); \
288 288 SET_MDX(VirtualCallData::advance(MDX())); \
289 289 }
290 290
291 291
292 292 // Updates profiling data for a switch (tabelswitch or lookupswitch) with
293 293 // given taken index (-1 means default case was taken).
294 294 #define BI_PROFILE_UPDATE_SWITCH(switch_index) \
295 295 if (ProfileInterpreter && MDX() != NULL) { \
296 296 BI_PROFILE_CHECK_MDX(); \
297 297 MultiBranchData::increment_count_no_overflow(MDX(), switch_index); \
298 298 SET_MDX(MultiBranchData::advance(MDX(), switch_index)); \
299 299 }
300 300
301 301
302 302 // The end /////////////////////////////////////////////////////////////////////
303 303
304 304 #endif // CC_INTERP_PROFILE
305 305
306 306 #endif // CC_INTERP
307 307
308 308 #endif // SHARE_VM_INTERPRETER_BYTECODECINTERPRETERPROFILING_HPP
↓ open down ↓ |
180 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX