bytecodeTracer.cpp revision 2027
0N/A/*
2027N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#include "precompiled.hpp"
1879N/A#include "interpreter/bytecodeHistogram.hpp"
1879N/A#include "interpreter/bytecodeTracer.hpp"
1879N/A#include "interpreter/bytecodes.hpp"
1879N/A#include "interpreter/interpreter.hpp"
1879N/A#include "interpreter/interpreterRuntime.hpp"
1879N/A#include "memory/resourceArea.hpp"
1879N/A#include "oops/methodDataOop.hpp"
1879N/A#include "oops/methodOop.hpp"
1879N/A#include "runtime/mutexLocker.hpp"
1879N/A#include "runtime/timer.hpp"
0N/A
0N/A
0N/A#ifndef PRODUCT
0N/A
0N/A// Standard closure for BytecodeTracer: prints the current bytecode
0N/A// and its attributes using bytecode-specific information.
0N/A
0N/Aclass BytecodePrinter: public BytecodeClosure {
0N/A private:
0N/A // %%% This field is not GC-ed, and so can contain garbage
0N/A // between critical sections. Use only pointer-comparison
0N/A // operations on the pointer, except within a critical section.
0N/A // (Also, ensure that occasional false positives are benign.)
0N/A methodOop _current_method;
0N/A bool _is_wide;
1485N/A Bytecodes::Code _code;
0N/A address _next_pc; // current decoding position
0N/A
0N/A void align() { _next_pc = (address)round_to((intptr_t)_next_pc, sizeof(jint)); }
0N/A int get_byte() { return *(jbyte*) _next_pc++; } // signed
0N/A short get_short() { short i=Bytes::get_Java_u2(_next_pc); _next_pc+=2; return i; }
0N/A int get_int() { int i=Bytes::get_Java_u4(_next_pc); _next_pc+=4; return i; }
0N/A
1485N/A int get_index_u1() { return *(address)_next_pc++; }
1485N/A int get_index_u2() { int i=Bytes::get_Java_u2(_next_pc); _next_pc+=2; return i; }
1522N/A int get_index_u1_cpcache() { return get_index_u1() + constantPoolOopDesc::CPCACHE_INDEX_TAG; }
1485N/A int get_index_u2_cpcache() { int i=Bytes::get_native_u2(_next_pc); _next_pc+=2; return i + constantPoolOopDesc::CPCACHE_INDEX_TAG; }
1485N/A int get_index_u4() { int i=Bytes::get_native_u4(_next_pc); _next_pc+=4; return i; }
1485N/A int get_index_special() { return (is_wide()) ? get_index_u2() : get_index_u1(); }
0N/A methodOop method() { return _current_method; }
0N/A bool is_wide() { return _is_wide; }
1485N/A Bytecodes::Code raw_code() { return Bytecodes::Code(_code); }
0N/A
0N/A
1485N/A bool check_index(int i, int& cp_index, outputStream* st = tty);
0N/A void print_constant(int i, outputStream* st = tty);
726N/A void print_field_or_method(int i, outputStream* st = tty);
1522N/A void print_field_or_method(int orig_i, int i, outputStream* st = tty);
1485N/A void print_attributes(int bci, outputStream* st = tty);
0N/A void bytecode_epilog(int bci, outputStream* st = tty);
0N/A
0N/A public:
0N/A BytecodePrinter() {
0N/A _is_wide = false;
1485N/A _code = Bytecodes::_illegal;
0N/A }
0N/A
0N/A // This method is called while executing the raw bytecodes, so none of
0N/A // the adjustments that BytecodeStream performs applies.
0N/A void trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) {
0N/A ResourceMark rm;
0N/A if (_current_method != method()) {
0N/A // Note 1: This code will not work as expected with true MT/MP.
0N/A // Need an explicit lock or a different solution.
0N/A // It is possible for this block to be skipped, if a garbage
0N/A // _current_method pointer happens to have the same bits as
0N/A // the incoming method. We could lose a line of trace output.
0N/A // This is acceptable in a debug-only feature.
0N/A st->cr();
0N/A st->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
0N/A method->print_name(st);
0N/A st->cr();
0N/A _current_method = method();
0N/A }
0N/A Bytecodes::Code code;
0N/A if (is_wide()) {
0N/A // bcp wasn't advanced if previous bytecode was _wide.
2027N/A code = Bytecodes::code_at(method(), bcp+1);
0N/A } else {
2027N/A code = Bytecodes::code_at(method(), bcp);
0N/A }
1485N/A _code = code;
1485N/A int bci = bcp - method->code_base();
0N/A st->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
0N/A if (Verbose) {
0N/A st->print("%8d %4d " INTPTR_FORMAT " " INTPTR_FORMAT " %s",
0N/A BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
0N/A } else {
0N/A st->print("%8d %4d %s",
0N/A BytecodeCounter::counter_value(), bci, Bytecodes::name(code));
0N/A }
0N/A _next_pc = is_wide() ? bcp+2 : bcp+1;
1485N/A print_attributes(bci);
0N/A // Set is_wide for the next one, since the caller of this doesn't skip
0N/A // the next bytecode.
0N/A _is_wide = (code == Bytecodes::_wide);
1485N/A _code = Bytecodes::_illegal;
0N/A }
0N/A
0N/A // Used for methodOop::print_codes(). The input bcp comes from
0N/A // BytecodeStream, which will skip wide bytecodes.
0N/A void trace(methodHandle method, address bcp, outputStream* st) {
0N/A _current_method = method();
0N/A ResourceMark rm;
2027N/A Bytecodes::Code code = Bytecodes::code_at(method(), bcp);
0N/A // Set is_wide
0N/A _is_wide = (code == Bytecodes::_wide);
0N/A if (is_wide()) {
2027N/A code = Bytecodes::code_at(method(), bcp+1);
0N/A }
1485N/A _code = code;
0N/A int bci = bcp - method->code_base();
0N/A // Print bytecode index and name
0N/A if (is_wide()) {
0N/A st->print("%d %s_w", bci, Bytecodes::name(code));
0N/A } else {
0N/A st->print("%d %s", bci, Bytecodes::name(code));
0N/A }
0N/A _next_pc = is_wide() ? bcp+2 : bcp+1;
1485N/A print_attributes(bci, st);
0N/A bytecode_epilog(bci, st);
0N/A }
0N/A};
0N/A
0N/A
0N/A// Implementation of BytecodeTracer
0N/A
0N/A// %%% This set_closure thing seems overly general, given that
0N/A// nobody uses it. Also, if BytecodePrinter weren't hidden
0N/A// then methodOop could use instances of it directly and it
0N/A// would be easier to remove races on _current_method and bcp.
0N/A// Since this is not product functionality, we can defer cleanup.
0N/A
0N/ABytecodeClosure* BytecodeTracer::_closure = NULL;
0N/A
0N/Astatic BytecodePrinter std_closure;
0N/ABytecodeClosure* BytecodeTracer::std_closure() {
0N/A return &::std_closure;
0N/A}
0N/A
0N/A
0N/Avoid BytecodeTracer::trace(methodHandle method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) {
0N/A if (TraceBytecodes && BytecodeCounter::counter_value() >= TraceBytecodesAt) {
0N/A ttyLocker ttyl; // 5065316: keep the following output coherent
0N/A // The ttyLocker also prevents races between two threads
0N/A // trying to use the single instance of BytecodePrinter.
0N/A // Using the ttyLocker prevents the system from coming to
0N/A // a safepoint within this code, which is sensitive to methodOop
0N/A // movement.
0N/A //
0N/A // There used to be a leaf mutex here, but the ttyLocker will
0N/A // work just as well, as long as the printing operations never block.
0N/A //
0N/A // We put the locker on the static trace method, not the
0N/A // virtual one, because the clients of this module go through
0N/A // the static method.
0N/A _closure->trace(method, bcp, tos, tos2, st);
0N/A }
0N/A}
0N/A
0N/Avoid BytecodeTracer::trace(methodHandle method, address bcp, outputStream* st) {
0N/A ttyLocker ttyl; // 5065316: keep the following output coherent
0N/A _closure->trace(method, bcp, st);
0N/A}
0N/A
1522N/Avoid print_symbol(symbolOop sym, outputStream* st) {
1522N/A char buf[40];
1522N/A int len = sym->utf8_length();
1522N/A if (len >= (int)sizeof(buf)) {
1522N/A st->print_cr(" %s...[%d]", sym->as_C_string(buf, sizeof(buf)), len);
1522N/A } else {
1522N/A st->print(" ");
1522N/A sym->print_on(st); st->cr();
1522N/A }
1522N/A}
1522N/A
0N/Avoid print_oop(oop value, outputStream* st) {
0N/A if (value == NULL) {
0N/A st->print_cr(" NULL");
1522N/A } else if (java_lang_String::is_instance(value)) {
0N/A EXCEPTION_MARK;
0N/A Handle h_value (THREAD, value);
0N/A symbolHandle sym = java_lang_String::as_symbol(h_value, CATCH);
1522N/A print_symbol(sym(), st);
1522N/A } else if (value->is_symbol()) {
1522N/A print_symbol(symbolOop(value), st);
1522N/A } else {
1522N/A st->print_cr(" " PTR_FORMAT, (intptr_t) value);
0N/A }
0N/A}
0N/A
1485N/Abool BytecodePrinter::check_index(int i, int& cp_index, outputStream* st) {
726N/A constantPoolOop constants = method()->constants();
726N/A int ilimit = constants->length(), climit = 0;
1485N/A Bytecodes::Code code = raw_code();
726N/A
726N/A constantPoolCacheOop cache = NULL;
1485N/A if (Bytecodes::uses_cp_cache(code)) {
726N/A cache = constants->cache();
726N/A if (cache != NULL) {
726N/A //climit = cache->length(); // %%% private!
726N/A size_t size = cache->size() * HeapWordSize;
726N/A size -= sizeof(constantPoolCacheOopDesc);
726N/A size /= sizeof(ConstantPoolCacheEntry);
726N/A climit = (int) size;
726N/A }
726N/A }
726N/A
1485N/A if (cache != NULL && constantPoolCacheOopDesc::is_secondary_index(i)) {
726N/A i = constantPoolCacheOopDesc::decode_secondary_index(i);
726N/A st->print(" secondary cache[%d] of", i);
726N/A if (i >= 0 && i < climit) {
726N/A if (!cache->entry_at(i)->is_secondary_entry()) {
726N/A st->print_cr(" not secondary entry?", i);
726N/A return false;
726N/A }
726N/A i = cache->entry_at(i)->main_entry_index();
726N/A goto check_cache_index;
726N/A } else {
726N/A st->print_cr(" not in cache[*]?", i);
726N/A return false;
726N/A }
726N/A }
726N/A
726N/A if (cache != NULL) {
726N/A goto check_cache_index;
726N/A }
726N/A
726N/A check_cp_index:
726N/A if (i >= 0 && i < ilimit) {
726N/A if (WizardMode) st->print(" cp[%d]", i);
726N/A cp_index = i;
726N/A return true;
726N/A }
726N/A
726N/A st->print_cr(" CP[%d] not in CP", i);
726N/A return false;
726N/A
726N/A check_cache_index:
1485N/A#ifdef ASSERT
1485N/A {
1485N/A const int CPCACHE_INDEX_TAG = constantPoolOopDesc::CPCACHE_INDEX_TAG;
1485N/A if (i >= CPCACHE_INDEX_TAG && i < climit + CPCACHE_INDEX_TAG) {
1485N/A i -= CPCACHE_INDEX_TAG;
1485N/A } else {
1485N/A st->print_cr(" CP[%d] missing bias?", i);
1485N/A return false;
1485N/A }
1485N/A }
1485N/A#endif //ASSERT
726N/A if (i >= 0 && i < climit) {
726N/A if (cache->entry_at(i)->is_secondary_entry()) {
726N/A st->print_cr(" secondary entry?");
726N/A return false;
726N/A }
726N/A i = cache->entry_at(i)->constant_pool_index();
726N/A goto check_cp_index;
726N/A }
726N/A st->print_cr(" not in CP[*]?", i);
726N/A return false;
726N/A}
726N/A
0N/Avoid BytecodePrinter::print_constant(int i, outputStream* st) {
726N/A int orig_i = i;
1485N/A if (!check_index(orig_i, i, st)) return;
726N/A
0N/A constantPoolOop constants = method()->constants();
0N/A constantTag tag = constants->tag_at(i);
0N/A
0N/A if (tag.is_int()) {
0N/A st->print_cr(" " INT32_FORMAT, constants->int_at(i));
0N/A } else if (tag.is_long()) {
0N/A st->print_cr(" " INT64_FORMAT, constants->long_at(i));
0N/A } else if (tag.is_float()) {
0N/A st->print_cr(" %f", constants->float_at(i));
0N/A } else if (tag.is_double()) {
0N/A st->print_cr(" %f", constants->double_at(i));
0N/A } else if (tag.is_string()) {
1522N/A oop string = constants->pseudo_string_at(i);
0N/A print_oop(string, st);
0N/A } else if (tag.is_unresolved_string()) {
1522N/A const char* string = constants->string_at_noresolve(i);
1522N/A st->print_cr(" %s", string);
0N/A } else if (tag.is_klass()) {
0N/A st->print_cr(" %s", constants->resolved_klass_at(i)->klass_part()->external_name());
0N/A } else if (tag.is_unresolved_klass()) {
0N/A st->print_cr(" <unresolved klass at %d>", i);
1138N/A } else if (tag.is_object()) {
1522N/A st->print(" <Object>");
1522N/A print_oop(constants->object_at(i), st);
1522N/A } else if (tag.is_method_type()) {
1522N/A int i2 = constants->method_type_index_at(i);
1522N/A st->print(" <MethodType> %d", i2);
1522N/A print_oop(constants->symbol_at(i2), st);
1522N/A } else if (tag.is_method_handle()) {
1522N/A int kind = constants->method_handle_ref_kind_at(i);
1522N/A int i2 = constants->method_handle_index_at(i);
1522N/A st->print(" <MethodHandle of kind %d>", kind, i2);
1522N/A print_field_or_method(-i, i2, st);
726N/A } else {
726N/A st->print_cr(" bad tag=%d at %d", tag.value(), i);
726N/A }
726N/A}
726N/A
726N/Avoid BytecodePrinter::print_field_or_method(int i, outputStream* st) {
726N/A int orig_i = i;
1485N/A if (!check_index(orig_i, i, st)) return;
1522N/A print_field_or_method(orig_i, i, st);
1522N/A}
726N/A
1522N/Avoid BytecodePrinter::print_field_or_method(int orig_i, int i, outputStream* st) {
726N/A constantPoolOop constants = method()->constants();
726N/A constantTag tag = constants->tag_at(i);
726N/A
1580N/A bool has_klass = true;
1059N/A
726N/A switch (tag.value()) {
726N/A case JVM_CONSTANT_InterfaceMethodref:
726N/A case JVM_CONSTANT_Methodref:
726N/A case JVM_CONSTANT_Fieldref:
1580N/A break;
1059N/A case JVM_CONSTANT_NameAndType:
1580N/A case JVM_CONSTANT_InvokeDynamic:
1918N/A case JVM_CONSTANT_InvokeDynamicTrans:
1580N/A has_klass = false;
726N/A break;
726N/A default:
726N/A st->print_cr(" bad tag=%d at %d", tag.value(), i);
726N/A return;
726N/A }
726N/A
1059N/A symbolOop name = constants->uncached_name_ref_at(i);
1059N/A symbolOop signature = constants->uncached_signature_ref_at(i);
1522N/A const char* sep = (tag.is_field() ? "/" : "");
1580N/A if (has_klass) {
1580N/A symbolOop klass = constants->klass_name_at(constants->uncached_klass_ref_index_at(i));
1580N/A st->print_cr(" %d <%s.%s%s%s> ", i, klass->as_C_string(), name->as_C_string(), sep, signature->as_C_string());
1580N/A } else {
1580N/A if (tag.is_invoke_dynamic()) {
1580N/A int bsm = constants->invoke_dynamic_bootstrap_method_ref_index_at(i);
1580N/A st->print(" bsm=%d", bsm);
1580N/A }
1580N/A st->print_cr(" %d <%s%s%s>", i, name->as_C_string(), sep, signature->as_C_string());
1580N/A }
0N/A}
0N/A
0N/A
1485N/Avoid BytecodePrinter::print_attributes(int bci, outputStream* st) {
0N/A // Show attributes of pre-rewritten codes
1485N/A Bytecodes::Code code = Bytecodes::java_code(raw_code());
0N/A // If the code doesn't have any fields there's nothing to print.
0N/A // note this is ==1 because the tableswitch and lookupswitch are
0N/A // zero size (for some reason) and we want to print stuff out for them.
0N/A if (Bytecodes::length_for(code) == 1) {
0N/A st->cr();
0N/A return;
0N/A }
0N/A
0N/A switch(code) {
0N/A // Java specific bytecodes only matter.
0N/A case Bytecodes::_bipush:
0N/A st->print_cr(" " INT32_FORMAT, get_byte());
0N/A break;
0N/A case Bytecodes::_sipush:
0N/A st->print_cr(" " INT32_FORMAT, get_short());
0N/A break;
0N/A case Bytecodes::_ldc:
1522N/A if (Bytecodes::uses_cp_cache(raw_code())) {
1522N/A print_constant(get_index_u1_cpcache(), st);
1522N/A } else {
1522N/A print_constant(get_index_u1(), st);
1522N/A }
0N/A break;
0N/A
0N/A case Bytecodes::_ldc_w:
0N/A case Bytecodes::_ldc2_w:
1522N/A if (Bytecodes::uses_cp_cache(raw_code())) {
1522N/A print_constant(get_index_u2_cpcache(), st);
1522N/A } else {
1522N/A print_constant(get_index_u2(), st);
1522N/A }
0N/A break;
0N/A
0N/A case Bytecodes::_iload:
0N/A case Bytecodes::_lload:
0N/A case Bytecodes::_fload:
0N/A case Bytecodes::_dload:
0N/A case Bytecodes::_aload:
0N/A case Bytecodes::_istore:
0N/A case Bytecodes::_lstore:
0N/A case Bytecodes::_fstore:
0N/A case Bytecodes::_dstore:
0N/A case Bytecodes::_astore:
0N/A st->print_cr(" #%d", get_index_special());
0N/A break;
0N/A
0N/A case Bytecodes::_iinc:
0N/A { int index = get_index_special();
0N/A jint offset = is_wide() ? get_short(): get_byte();
0N/A st->print_cr(" #%d " INT32_FORMAT, index, offset);
0N/A }
0N/A break;
0N/A
0N/A case Bytecodes::_newarray: {
1485N/A BasicType atype = (BasicType)get_index_u1();
0N/A const char* str = type2name(atype);
0N/A if (str == NULL || atype == T_OBJECT || atype == T_ARRAY) {
0N/A assert(false, "Unidentified basic type");
0N/A }
0N/A st->print_cr(" %s", str);
0N/A }
0N/A break;
0N/A case Bytecodes::_anewarray: {
1485N/A int klass_index = get_index_u2();
0N/A constantPoolOop constants = method()->constants();
0N/A symbolOop name = constants->klass_name_at(klass_index);
0N/A st->print_cr(" %s ", name->as_C_string());
0N/A }
0N/A break;
0N/A case Bytecodes::_multianewarray: {
1485N/A int klass_index = get_index_u2();
1485N/A int nof_dims = get_index_u1();
0N/A constantPoolOop constants = method()->constants();
0N/A symbolOop name = constants->klass_name_at(klass_index);
0N/A st->print_cr(" %s %d", name->as_C_string(), nof_dims);
0N/A }
0N/A break;
0N/A
0N/A case Bytecodes::_ifeq:
0N/A case Bytecodes::_ifnull:
0N/A case Bytecodes::_iflt:
0N/A case Bytecodes::_ifle:
0N/A case Bytecodes::_ifne:
0N/A case Bytecodes::_ifnonnull:
0N/A case Bytecodes::_ifgt:
0N/A case Bytecodes::_ifge:
0N/A case Bytecodes::_if_icmpeq:
0N/A case Bytecodes::_if_icmpne:
0N/A case Bytecodes::_if_icmplt:
0N/A case Bytecodes::_if_icmpgt:
0N/A case Bytecodes::_if_icmple:
0N/A case Bytecodes::_if_icmpge:
0N/A case Bytecodes::_if_acmpeq:
0N/A case Bytecodes::_if_acmpne:
0N/A case Bytecodes::_goto:
0N/A case Bytecodes::_jsr:
0N/A st->print_cr(" %d", bci + get_short());
0N/A break;
0N/A
0N/A case Bytecodes::_goto_w:
0N/A case Bytecodes::_jsr_w:
0N/A st->print_cr(" %d", bci + get_int());
0N/A break;
0N/A
0N/A case Bytecodes::_ret: st->print_cr(" %d", get_index_special()); break;
0N/A
0N/A case Bytecodes::_tableswitch:
0N/A { align();
0N/A int default_dest = bci + get_int();
0N/A int lo = get_int();
0N/A int hi = get_int();
0N/A int len = hi - lo + 1;
0N/A jint* dest = NEW_RESOURCE_ARRAY(jint, len);
0N/A for (int i = 0; i < len; i++) {
0N/A dest[i] = bci + get_int();
0N/A }
0N/A st->print(" %d " INT32_FORMAT " " INT32_FORMAT " ",
0N/A default_dest, lo, hi);
0N/A int first = true;
0N/A for (int ll = lo; ll <= hi; ll++, first = false) {
0N/A int idx = ll - lo;
0N/A const char *format = first ? " %d:" INT32_FORMAT " (delta: %d)" :
0N/A ", %d:" INT32_FORMAT " (delta: %d)";
0N/A st->print(format, ll, dest[idx], dest[idx]-bci);
0N/A }
0N/A st->cr();
0N/A }
0N/A break;
0N/A case Bytecodes::_lookupswitch:
0N/A { align();
0N/A int default_dest = bci + get_int();
0N/A int len = get_int();
0N/A jint* key = NEW_RESOURCE_ARRAY(jint, len);
0N/A jint* dest = NEW_RESOURCE_ARRAY(jint, len);
0N/A for (int i = 0; i < len; i++) {
0N/A key [i] = get_int();
0N/A dest[i] = bci + get_int();
0N/A };
0N/A st->print(" %d %d ", default_dest, len);
0N/A bool first = true;
0N/A for (int ll = 0; ll < len; ll++, first = false) {
0N/A const char *format = first ? " " INT32_FORMAT ":" INT32_FORMAT :
0N/A ", " INT32_FORMAT ":" INT32_FORMAT ;
0N/A st->print(format, key[ll], dest[ll]);
0N/A }
0N/A st->cr();
0N/A }
0N/A break;
0N/A
0N/A case Bytecodes::_putstatic:
0N/A case Bytecodes::_getstatic:
0N/A case Bytecodes::_putfield:
726N/A case Bytecodes::_getfield:
1485N/A print_field_or_method(get_index_u2_cpcache(), st);
0N/A break;
0N/A
0N/A case Bytecodes::_invokevirtual:
0N/A case Bytecodes::_invokespecial:
0N/A case Bytecodes::_invokestatic:
1485N/A print_field_or_method(get_index_u2_cpcache(), st);
0N/A break;
0N/A
0N/A case Bytecodes::_invokeinterface:
1485N/A { int i = get_index_u2_cpcache();
1485N/A int n = get_index_u1();
1485N/A get_byte(); // ignore zero byte
726N/A print_field_or_method(i, st);
0N/A }
0N/A break;
0N/A
726N/A case Bytecodes::_invokedynamic:
1485N/A print_field_or_method(get_index_u4(), st);
726N/A break;
726N/A
0N/A case Bytecodes::_new:
0N/A case Bytecodes::_checkcast:
0N/A case Bytecodes::_instanceof:
1485N/A { int i = get_index_u2();
0N/A constantPoolOop constants = method()->constants();
0N/A symbolOop name = constants->klass_name_at(i);
0N/A st->print_cr(" %d <%s>", i, name->as_C_string());
0N/A }
0N/A break;
0N/A
0N/A case Bytecodes::_wide:
0N/A // length is zero not one, but printed with no more info.
0N/A break;
0N/A
0N/A default:
0N/A ShouldNotReachHere();
0N/A break;
0N/A }
0N/A}
0N/A
0N/A
0N/Avoid BytecodePrinter::bytecode_epilog(int bci, outputStream* st) {
0N/A methodDataOop mdo = method()->method_data();
0N/A if (mdo != NULL) {
0N/A ProfileData* data = mdo->bci_to_data(bci);
0N/A if (data != NULL) {
0N/A st->print(" %d", mdo->dp_to_di(data->dp()));
0N/A st->fill_to(6);
0N/A data->print_data_on(st);
0N/A }
0N/A }
0N/A}
0N/A#endif // PRODUCT