Print this page
Split |
Close |
Expand all |
Collapse all |
--- old/src/share/vm/interpreter/bytecodeTracer.cpp
+++ new/src/share/vm/interpreter/bytecodeTracer.cpp
1 1 /*
2 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 *
5 5 * This code is free software; you can redistribute it and/or modify it
6 6 * under the terms of the GNU General Public License version 2 only, as
7 7 * published by the Free Software Foundation.
8 8 *
9 9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 12 * version 2 for more details (a copy is included in the LICENSE file that
13 13 * accompanied this code).
14 14 *
15 15 * You should have received a copy of the GNU General Public License version
16 16 * 2 along with this work; if not, write to the Free Software Foundation,
17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 18 *
19 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 20 * or visit www.oracle.com if you need additional information or have any
21 21 * questions.
22 22 *
23 23 */
24 24
25 25 #include "precompiled.hpp"
26 26 #include "interpreter/bytecodeHistogram.hpp"
27 27 #include "interpreter/bytecodeTracer.hpp"
28 28 #include "interpreter/bytecodes.hpp"
29 29 #include "interpreter/interpreter.hpp"
30 30 #include "interpreter/interpreterRuntime.hpp"
31 31 #include "memory/resourceArea.hpp"
32 32 #include "oops/methodDataOop.hpp"
33 33 #include "oops/methodOop.hpp"
34 34 #include "runtime/mutexLocker.hpp"
35 35 #include "runtime/timer.hpp"
36 36
37 37
38 38 #ifndef PRODUCT
39 39
40 40 // Standard closure for BytecodeTracer: prints the current bytecode
41 41 // and its attributes using bytecode-specific information.
42 42
43 43 class BytecodePrinter: public BytecodeClosure {
44 44 private:
45 45 // %%% This field is not GC-ed, and so can contain garbage
46 46 // between critical sections. Use only pointer-comparison
47 47 // operations on the pointer, except within a critical section.
48 48 // (Also, ensure that occasional false positives are benign.)
49 49 methodOop _current_method;
50 50 bool _is_wide;
51 51 Bytecodes::Code _code;
52 52 address _next_pc; // current decoding position
53 53
54 54 void align() { _next_pc = (address)round_to((intptr_t)_next_pc, sizeof(jint)); }
55 55 int get_byte() { return *(jbyte*) _next_pc++; } // signed
56 56 short get_short() { short i=Bytes::get_Java_u2(_next_pc); _next_pc+=2; return i; }
57 57 int get_int() { int i=Bytes::get_Java_u4(_next_pc); _next_pc+=4; return i; }
58 58
59 59 int get_index_u1() { return *(address)_next_pc++; }
60 60 int get_index_u2() { int i=Bytes::get_Java_u2(_next_pc); _next_pc+=2; return i; }
61 61 int get_index_u1_cpcache() { return get_index_u1() + constantPoolOopDesc::CPCACHE_INDEX_TAG; }
62 62 int get_index_u2_cpcache() { int i=Bytes::get_native_u2(_next_pc); _next_pc+=2; return i + constantPoolOopDesc::CPCACHE_INDEX_TAG; }
63 63 int get_index_u4() { int i=Bytes::get_native_u4(_next_pc); _next_pc+=4; return i; }
64 64 int get_index_special() { return (is_wide()) ? get_index_u2() : get_index_u1(); }
65 65 methodOop method() { return _current_method; }
66 66 bool is_wide() { return _is_wide; }
67 67 Bytecodes::Code raw_code() { return Bytecodes::Code(_code); }
68 68
69 69
70 70 bool check_index(int i, int& cp_index, outputStream* st = tty);
71 71 void print_constant(int i, outputStream* st = tty);
72 72 void print_field_or_method(int i, outputStream* st = tty);
73 73 void print_field_or_method(int orig_i, int i, outputStream* st = tty);
74 74 void print_attributes(int bci, outputStream* st = tty);
75 75 void bytecode_epilog(int bci, outputStream* st = tty);
76 76
77 77 public:
78 78 BytecodePrinter() {
79 79 _is_wide = false;
80 80 _code = Bytecodes::_illegal;
81 81 }
82 82
83 83 // This method is called while executing the raw bytecodes, so none of
84 84 // the adjustments that BytecodeStream performs applies.
85 85 void trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) {
86 86 ResourceMark rm;
87 87 if (_current_method != method()) {
88 88 // Note 1: This code will not work as expected with true MT/MP.
89 89 // Need an explicit lock or a different solution.
90 90 // It is possible for this block to be skipped, if a garbage
91 91 // _current_method pointer happens to have the same bits as
92 92 // the incoming method. We could lose a line of trace output.
93 93 // This is acceptable in a debug-only feature.
94 94 st->cr();
95 95 st->print("[%ld] ", (long) Thread::current()->osthread()->thread_id());
96 96 method->print_name(st);
97 97 st->cr();
98 98 _current_method = method();
99 99 }
100 100 Bytecodes::Code code;
101 101 if (is_wide()) {
102 102 // bcp wasn't advanced if previous bytecode was _wide.
103 103 code = Bytecodes::code_at(method(), bcp+1);
104 104 } else {
105 105 code = Bytecodes::code_at(method(), bcp);
106 106 }
107 107 _code = code;
108 108 int bci = bcp - method->code_base();
109 109 st->print("[%ld] ", (long) Thread::current()->osthread()->thread_id());
110 110 if (Verbose) {
111 111 st->print("%8d %4d " INTPTR_FORMAT " " INTPTR_FORMAT " %s",
112 112 BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
113 113 } else {
114 114 st->print("%8d %4d %s",
115 115 BytecodeCounter::counter_value(), bci, Bytecodes::name(code));
116 116 }
117 117 _next_pc = is_wide() ? bcp+2 : bcp+1;
118 118 print_attributes(bci);
119 119 // Set is_wide for the next one, since the caller of this doesn't skip
120 120 // the next bytecode.
121 121 _is_wide = (code == Bytecodes::_wide);
122 122 _code = Bytecodes::_illegal;
123 123 }
124 124
125 125 // Used for methodOop::print_codes(). The input bcp comes from
126 126 // BytecodeStream, which will skip wide bytecodes.
127 127 void trace(methodHandle method, address bcp, outputStream* st) {
128 128 _current_method = method();
129 129 ResourceMark rm;
130 130 Bytecodes::Code code = Bytecodes::code_at(method(), bcp);
131 131 // Set is_wide
132 132 _is_wide = (code == Bytecodes::_wide);
133 133 if (is_wide()) {
134 134 code = Bytecodes::code_at(method(), bcp+1);
135 135 }
136 136 _code = code;
137 137 int bci = bcp - method->code_base();
138 138 // Print bytecode index and name
139 139 if (is_wide()) {
140 140 st->print("%d %s_w", bci, Bytecodes::name(code));
141 141 } else {
142 142 st->print("%d %s", bci, Bytecodes::name(code));
143 143 }
144 144 _next_pc = is_wide() ? bcp+2 : bcp+1;
145 145 print_attributes(bci, st);
146 146 bytecode_epilog(bci, st);
147 147 }
148 148 };
149 149
150 150
151 151 // Implementation of BytecodeTracer
152 152
153 153 // %%% This set_closure thing seems overly general, given that
154 154 // nobody uses it. Also, if BytecodePrinter weren't hidden
155 155 // then methodOop could use instances of it directly and it
156 156 // would be easier to remove races on _current_method and bcp.
157 157 // Since this is not product functionality, we can defer cleanup.
158 158
159 159 BytecodeClosure* BytecodeTracer::_closure = NULL;
160 160
161 161 static BytecodePrinter std_closure;
162 162 BytecodeClosure* BytecodeTracer::std_closure() {
163 163 return &::std_closure;
164 164 }
165 165
166 166
167 167 void BytecodeTracer::trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) {
168 168 if (TraceBytecodes && BytecodeCounter::counter_value() >= TraceBytecodesAt) {
169 169 ttyLocker ttyl; // 5065316: keep the following output coherent
170 170 // The ttyLocker also prevents races between two threads
171 171 // trying to use the single instance of BytecodePrinter.
172 172 // Using the ttyLocker prevents the system from coming to
173 173 // a safepoint within this code, which is sensitive to methodOop
174 174 // movement.
175 175 //
176 176 // There used to be a leaf mutex here, but the ttyLocker will
177 177 // work just as well, as long as the printing operations never block.
178 178 //
179 179 // We put the locker on the static trace method, not the
180 180 // virtual one, because the clients of this module go through
181 181 // the static method.
182 182 _closure->trace(method, bcp, tos, tos2, st);
183 183 }
184 184 }
185 185
186 186 void BytecodeTracer::trace(methodHandle method, address bcp, outputStream* st) {
187 187 ttyLocker ttyl; // 5065316: keep the following output coherent
188 188 _closure->trace(method, bcp, st);
189 189 }
190 190
191 191 void print_symbol(Symbol* sym, outputStream* st) {
192 192 char buf[40];
193 193 int len = sym->utf8_length();
194 194 if (len >= (int)sizeof(buf)) {
195 195 st->print_cr(" %s...[%d]", sym->as_C_string(buf, sizeof(buf)), len);
196 196 } else {
197 197 st->print(" ");
198 198 sym->print_on(st); st->cr();
199 199 }
200 200 }
201 201
202 202 void print_oop(oop value, outputStream* st) {
203 203 if (value == NULL) {
204 204 st->print_cr(" NULL");
205 205 } else if (java_lang_String::is_instance(value)) {
206 206 char buf[40];
207 207 int len = java_lang_String::utf8_length(value);
208 208 java_lang_String::as_utf8_string(value, buf, sizeof(buf));
209 209 if (len >= (int)sizeof(buf)) {
210 210 st->print_cr(" %s...[%d]", buf, len);
211 211 } else {
212 212 st->print_cr(" %s", buf);
213 213 }
214 214 } else {
215 215 st->print_cr(" " PTR_FORMAT, (intptr_t) value);
216 216 }
217 217 }
218 218
219 219 bool BytecodePrinter::check_index(int i, int& cp_index, outputStream* st) {
220 220 constantPoolOop constants = method()->constants();
221 221 int ilimit = constants->length(), climit = 0;
222 222 Bytecodes::Code code = raw_code();
223 223
224 224 constantPoolCacheOop cache = NULL;
225 225 if (Bytecodes::uses_cp_cache(code)) {
226 226 cache = constants->cache();
227 227 if (cache != NULL) {
228 228 //climit = cache->length(); // %%% private!
229 229 size_t size = cache->size() * HeapWordSize;
230 230 size -= sizeof(constantPoolCacheOopDesc);
231 231 size /= sizeof(ConstantPoolCacheEntry);
232 232 climit = (int) size;
233 233 }
↓ open down ↓ |
233 lines elided |
↑ open up ↑ |
234 234 }
235 235
236 236 if (cache != NULL && constantPoolCacheOopDesc::is_secondary_index(i)) {
237 237 i = constantPoolCacheOopDesc::decode_secondary_index(i);
238 238 st->print(" secondary cache[%d] of", i);
239 239 if (i >= 0 && i < climit) {
240 240 if (!cache->entry_at(i)->is_secondary_entry()) {
241 241 st->print_cr(" not secondary entry?", i);
242 242 return false;
243 243 }
244 - i = cache->entry_at(i)->main_entry_index();
244 + i = cache->entry_at(i)->main_entry_index() + constantPoolOopDesc::CPCACHE_INDEX_TAG;
245 245 goto check_cache_index;
246 246 } else {
247 247 st->print_cr(" not in cache[*]?", i);
248 248 return false;
249 249 }
250 250 }
251 251
252 252 if (cache != NULL) {
253 253 goto check_cache_index;
254 254 }
255 255
256 256 check_cp_index:
257 257 if (i >= 0 && i < ilimit) {
258 258 if (WizardMode) st->print(" cp[%d]", i);
259 259 cp_index = i;
260 260 return true;
261 261 }
262 262
263 263 st->print_cr(" CP[%d] not in CP", i);
264 264 return false;
265 265
266 266 check_cache_index:
267 267 #ifdef ASSERT
268 268 {
269 269 const int CPCACHE_INDEX_TAG = constantPoolOopDesc::CPCACHE_INDEX_TAG;
270 270 if (i >= CPCACHE_INDEX_TAG && i < climit + CPCACHE_INDEX_TAG) {
271 271 i -= CPCACHE_INDEX_TAG;
272 272 } else {
273 273 st->print_cr(" CP[%d] missing bias?", i);
274 274 return false;
275 275 }
276 276 }
277 277 #endif //ASSERT
278 278 if (i >= 0 && i < climit) {
279 279 if (cache->entry_at(i)->is_secondary_entry()) {
280 280 st->print_cr(" secondary entry?");
281 281 return false;
282 282 }
283 283 i = cache->entry_at(i)->constant_pool_index();
284 284 goto check_cp_index;
285 285 }
286 286 st->print_cr(" not in CP[*]?", i);
287 287 return false;
288 288 }
289 289
290 290 void BytecodePrinter::print_constant(int i, outputStream* st) {
291 291 int orig_i = i;
292 292 if (!check_index(orig_i, i, st)) return;
293 293
294 294 constantPoolOop constants = method()->constants();
295 295 constantTag tag = constants->tag_at(i);
296 296
297 297 if (tag.is_int()) {
298 298 st->print_cr(" " INT32_FORMAT, constants->int_at(i));
299 299 } else if (tag.is_long()) {
300 300 st->print_cr(" " INT64_FORMAT, constants->long_at(i));
301 301 } else if (tag.is_float()) {
302 302 st->print_cr(" %f", constants->float_at(i));
303 303 } else if (tag.is_double()) {
304 304 st->print_cr(" %f", constants->double_at(i));
305 305 } else if (tag.is_string()) {
306 306 oop string = constants->pseudo_string_at(i);
307 307 print_oop(string, st);
308 308 } else if (tag.is_unresolved_string()) {
309 309 const char* string = constants->string_at_noresolve(i);
310 310 st->print_cr(" %s", string);
311 311 } else if (tag.is_klass()) {
312 312 st->print_cr(" %s", constants->resolved_klass_at(i)->klass_part()->external_name());
313 313 } else if (tag.is_unresolved_klass()) {
314 314 st->print_cr(" <unresolved klass at %d>", i);
315 315 } else if (tag.is_object()) {
316 316 st->print(" <Object>");
317 317 print_oop(constants->object_at(i), st);
318 318 } else if (tag.is_method_type()) {
319 319 int i2 = constants->method_type_index_at(i);
320 320 st->print(" <MethodType> %d", i2);
321 321 print_symbol(constants->symbol_at(i2), st);
322 322 } else if (tag.is_method_handle()) {
323 323 int kind = constants->method_handle_ref_kind_at(i);
324 324 int i2 = constants->method_handle_index_at(i);
325 325 st->print(" <MethodHandle of kind %d>", kind, i2);
326 326 print_field_or_method(-i, i2, st);
327 327 } else {
328 328 st->print_cr(" bad tag=%d at %d", tag.value(), i);
329 329 }
330 330 }
331 331
332 332 void BytecodePrinter::print_field_or_method(int i, outputStream* st) {
333 333 int orig_i = i;
334 334 if (!check_index(orig_i, i, st)) return;
335 335 print_field_or_method(orig_i, i, st);
336 336 }
337 337
338 338 void BytecodePrinter::print_field_or_method(int orig_i, int i, outputStream* st) {
339 339 constantPoolOop constants = method()->constants();
340 340 constantTag tag = constants->tag_at(i);
341 341
342 342 bool has_klass = true;
343 343
344 344 switch (tag.value()) {
345 345 case JVM_CONSTANT_InterfaceMethodref:
346 346 case JVM_CONSTANT_Methodref:
347 347 case JVM_CONSTANT_Fieldref:
348 348 break;
349 349 case JVM_CONSTANT_NameAndType:
350 350 case JVM_CONSTANT_InvokeDynamic:
351 351 has_klass = false;
352 352 break;
353 353 default:
354 354 st->print_cr(" bad tag=%d at %d", tag.value(), i);
355 355 return;
356 356 }
357 357
358 358 Symbol* name = constants->uncached_name_ref_at(i);
359 359 Symbol* signature = constants->uncached_signature_ref_at(i);
360 360 const char* sep = (tag.is_field() ? "/" : "");
361 361 if (has_klass) {
362 362 Symbol* klass = constants->klass_name_at(constants->uncached_klass_ref_index_at(i));
363 363 st->print_cr(" %d <%s.%s%s%s> ", i, klass->as_C_string(), name->as_C_string(), sep, signature->as_C_string());
364 364 } else {
365 365 if (tag.is_invoke_dynamic()) {
366 366 int bsm = constants->invoke_dynamic_bootstrap_method_ref_index_at(i);
367 367 st->print(" bsm=%d", bsm);
368 368 }
369 369 st->print_cr(" %d <%s%s%s>", i, name->as_C_string(), sep, signature->as_C_string());
370 370 }
371 371 }
372 372
373 373
374 374 void BytecodePrinter::print_attributes(int bci, outputStream* st) {
375 375 // Show attributes of pre-rewritten codes
376 376 Bytecodes::Code code = Bytecodes::java_code(raw_code());
377 377 // If the code doesn't have any fields there's nothing to print.
378 378 // note this is ==1 because the tableswitch and lookupswitch are
379 379 // zero size (for some reason) and we want to print stuff out for them.
380 380 if (Bytecodes::length_for(code) == 1) {
381 381 st->cr();
382 382 return;
383 383 }
384 384
385 385 switch(code) {
386 386 // Java specific bytecodes only matter.
387 387 case Bytecodes::_bipush:
388 388 st->print_cr(" " INT32_FORMAT, get_byte());
389 389 break;
390 390 case Bytecodes::_sipush:
391 391 st->print_cr(" " INT32_FORMAT, get_short());
392 392 break;
393 393 case Bytecodes::_ldc:
394 394 if (Bytecodes::uses_cp_cache(raw_code())) {
395 395 print_constant(get_index_u1_cpcache(), st);
396 396 } else {
397 397 print_constant(get_index_u1(), st);
398 398 }
399 399 break;
400 400
401 401 case Bytecodes::_ldc_w:
402 402 case Bytecodes::_ldc2_w:
403 403 if (Bytecodes::uses_cp_cache(raw_code())) {
404 404 print_constant(get_index_u2_cpcache(), st);
405 405 } else {
406 406 print_constant(get_index_u2(), st);
407 407 }
408 408 break;
409 409
410 410 case Bytecodes::_iload:
411 411 case Bytecodes::_lload:
412 412 case Bytecodes::_fload:
413 413 case Bytecodes::_dload:
414 414 case Bytecodes::_aload:
415 415 case Bytecodes::_istore:
416 416 case Bytecodes::_lstore:
417 417 case Bytecodes::_fstore:
418 418 case Bytecodes::_dstore:
419 419 case Bytecodes::_astore:
420 420 st->print_cr(" #%d", get_index_special());
421 421 break;
422 422
423 423 case Bytecodes::_iinc:
424 424 { int index = get_index_special();
425 425 jint offset = is_wide() ? get_short(): get_byte();
426 426 st->print_cr(" #%d " INT32_FORMAT, index, offset);
427 427 }
428 428 break;
429 429
430 430 case Bytecodes::_newarray: {
431 431 BasicType atype = (BasicType)get_index_u1();
432 432 const char* str = type2name(atype);
433 433 if (str == NULL || atype == T_OBJECT || atype == T_ARRAY) {
434 434 assert(false, "Unidentified basic type");
435 435 }
436 436 st->print_cr(" %s", str);
437 437 }
438 438 break;
439 439 case Bytecodes::_anewarray: {
440 440 int klass_index = get_index_u2();
441 441 constantPoolOop constants = method()->constants();
442 442 Symbol* name = constants->klass_name_at(klass_index);
443 443 st->print_cr(" %s ", name->as_C_string());
444 444 }
445 445 break;
446 446 case Bytecodes::_multianewarray: {
447 447 int klass_index = get_index_u2();
448 448 int nof_dims = get_index_u1();
449 449 constantPoolOop constants = method()->constants();
450 450 Symbol* name = constants->klass_name_at(klass_index);
451 451 st->print_cr(" %s %d", name->as_C_string(), nof_dims);
452 452 }
453 453 break;
454 454
455 455 case Bytecodes::_ifeq:
456 456 case Bytecodes::_ifnull:
457 457 case Bytecodes::_iflt:
458 458 case Bytecodes::_ifle:
459 459 case Bytecodes::_ifne:
460 460 case Bytecodes::_ifnonnull:
461 461 case Bytecodes::_ifgt:
462 462 case Bytecodes::_ifge:
463 463 case Bytecodes::_if_icmpeq:
464 464 case Bytecodes::_if_icmpne:
465 465 case Bytecodes::_if_icmplt:
466 466 case Bytecodes::_if_icmpgt:
467 467 case Bytecodes::_if_icmple:
468 468 case Bytecodes::_if_icmpge:
469 469 case Bytecodes::_if_acmpeq:
470 470 case Bytecodes::_if_acmpne:
471 471 case Bytecodes::_goto:
472 472 case Bytecodes::_jsr:
473 473 st->print_cr(" %d", bci + get_short());
474 474 break;
475 475
476 476 case Bytecodes::_goto_w:
477 477 case Bytecodes::_jsr_w:
478 478 st->print_cr(" %d", bci + get_int());
479 479 break;
480 480
481 481 case Bytecodes::_ret: st->print_cr(" %d", get_index_special()); break;
482 482
483 483 case Bytecodes::_tableswitch:
484 484 { align();
485 485 int default_dest = bci + get_int();
486 486 int lo = get_int();
487 487 int hi = get_int();
488 488 int len = hi - lo + 1;
489 489 jint* dest = NEW_RESOURCE_ARRAY(jint, len);
490 490 for (int i = 0; i < len; i++) {
491 491 dest[i] = bci + get_int();
492 492 }
493 493 st->print(" %d " INT32_FORMAT " " INT32_FORMAT " ",
494 494 default_dest, lo, hi);
495 495 int first = true;
496 496 for (int ll = lo; ll <= hi; ll++, first = false) {
497 497 int idx = ll - lo;
498 498 const char *format = first ? " %d:" INT32_FORMAT " (delta: %d)" :
499 499 ", %d:" INT32_FORMAT " (delta: %d)";
500 500 st->print(format, ll, dest[idx], dest[idx]-bci);
501 501 }
502 502 st->cr();
503 503 }
504 504 break;
505 505 case Bytecodes::_lookupswitch:
506 506 { align();
507 507 int default_dest = bci + get_int();
508 508 int len = get_int();
509 509 jint* key = NEW_RESOURCE_ARRAY(jint, len);
510 510 jint* dest = NEW_RESOURCE_ARRAY(jint, len);
511 511 for (int i = 0; i < len; i++) {
512 512 key [i] = get_int();
513 513 dest[i] = bci + get_int();
514 514 };
515 515 st->print(" %d %d ", default_dest, len);
516 516 bool first = true;
517 517 for (int ll = 0; ll < len; ll++, first = false) {
518 518 const char *format = first ? " " INT32_FORMAT ":" INT32_FORMAT :
519 519 ", " INT32_FORMAT ":" INT32_FORMAT ;
520 520 st->print(format, key[ll], dest[ll]);
521 521 }
522 522 st->cr();
523 523 }
524 524 break;
525 525
526 526 case Bytecodes::_putstatic:
527 527 case Bytecodes::_getstatic:
528 528 case Bytecodes::_putfield:
529 529 case Bytecodes::_getfield:
530 530 print_field_or_method(get_index_u2_cpcache(), st);
531 531 break;
532 532
533 533 case Bytecodes::_invokevirtual:
534 534 case Bytecodes::_invokespecial:
535 535 case Bytecodes::_invokestatic:
536 536 print_field_or_method(get_index_u2_cpcache(), st);
537 537 break;
538 538
539 539 case Bytecodes::_invokeinterface:
540 540 { int i = get_index_u2_cpcache();
541 541 int n = get_index_u1();
542 542 get_byte(); // ignore zero byte
543 543 print_field_or_method(i, st);
544 544 }
545 545 break;
546 546
547 547 case Bytecodes::_invokedynamic:
548 548 print_field_or_method(get_index_u4(), st);
549 549 break;
550 550
551 551 case Bytecodes::_new:
552 552 case Bytecodes::_checkcast:
553 553 case Bytecodes::_instanceof:
554 554 { int i = get_index_u2();
555 555 constantPoolOop constants = method()->constants();
556 556 Symbol* name = constants->klass_name_at(i);
557 557 st->print_cr(" %d <%s>", i, name->as_C_string());
558 558 }
559 559 break;
560 560
561 561 case Bytecodes::_wide:
562 562 // length is zero not one, but printed with no more info.
563 563 break;
564 564
565 565 default:
566 566 ShouldNotReachHere();
567 567 break;
568 568 }
569 569 }
570 570
571 571
572 572 void BytecodePrinter::bytecode_epilog(int bci, outputStream* st) {
573 573 methodDataOop mdo = method()->method_data();
574 574 if (mdo != NULL) {
575 575 ProfileData* data = mdo->bci_to_data(bci);
576 576 if (data != NULL) {
577 577 st->print(" %d", mdo->dp_to_di(data->dp()));
578 578 st->fill_to(6);
579 579 data->print_data_on(st);
580 580 }
581 581 }
582 582 }
583 583 #endif // PRODUCT
↓ open down ↓ |
329 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX