6667042: PrintAssembly option does not work without special plugin

Remove old private plugin interface, simplify, rework old plugin to use unchanged Gnu sources

Reviewed-by: kvn, rasbold
This commit is contained in:
John R Rose 2008-04-02 12:09:59 -07:00
parent 0530e0d854
commit 0d27a8639f
43 changed files with 1675 additions and 629 deletions

View file

@ -707,7 +707,9 @@ nmethod::nmethod(
" entry points must be same for static methods and vice versa");
}
bool printnmethods = PrintNMethods || CompilerOracle::has_option_string(_method, "PrintNMethods");
bool printnmethods = PrintNMethods
|| CompilerOracle::should_print(_method)
|| CompilerOracle::has_option_string(_method, "PrintNMethods");
if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) {
print_nmethod(printnmethods);
}
@ -798,7 +800,6 @@ void nmethod::print_on(outputStream* st, const char* title) const {
}
#ifndef PRODUCT
void nmethod::print_nmethod(bool printmethod) {
ttyLocker ttyl; // keep the following output all in one block
if (xtty != NULL) {
@ -831,7 +832,6 @@ void nmethod::print_nmethod(bool printmethod) {
xtty->tail("print_nmethod");
}
}
#endif
void nmethod::set_version(int v) {
@ -1870,6 +1870,7 @@ void nmethod::check_store() {
}
}
#endif // PRODUCT
// Printing operations
@ -1948,6 +1949,14 @@ void nmethod::print() const {
oops_size());
}
void nmethod::print_code() {
HandleMark hm;
ResourceMark m;
Disassembler::decode(this);
}
#ifndef PRODUCT
void nmethod::print_scopes() {
// Find the first pc desc for all scopes in the code and print it.
@ -1979,13 +1988,6 @@ void nmethod::print_dependencies() {
}
void nmethod::print_code() {
HandleMark hm;
ResourceMark m;
Disassembler().decode(this);
}
void nmethod::print_relocations() {
ResourceMark m; // in case methods get printed via the debugger
tty->print_cr("relocations:");
@ -2021,6 +2023,7 @@ void nmethod::print_pcs() {
}
}
#endif // PRODUCT
const char* nmethod::reloc_string_for(u_char* begin, u_char* end) {
RelocIterator iter(this, begin, end);
@ -2055,7 +2058,6 @@ const char* nmethod::reloc_string_for(u_char* begin, u_char* end) {
return have_one ? "other" : NULL;
}
// Return a the last scope in (begin..end]
ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
PcDesc* p = pc_desc_near(begin+1);
@ -2078,29 +2080,26 @@ void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin,
address pc = base + om->offset();
if (pc > begin) {
if (pc <= end) {
st->fill_to(column);
if (st == tty) {
st->print("; OopMap ");
om->print();
tty->cr();
} else {
st->print_cr("; OopMap #%d offset:%d", i, om->offset());
}
st->move_to(column);
st->print("; ");
om->print_on(st);
}
break;
}
}
}
// Print any debug info present at this pc.
ScopeDesc* sd = scope_desc_in(begin, end);
if (sd != NULL) {
st->fill_to(column);
st->move_to(column);
if (sd->bci() == SynchronizationEntryBCI) {
st->print(";*synchronization entry");
} else {
if (sd->method().is_null()) {
tty->print("method is NULL");
st->print("method is NULL");
} else if (sd->method()->is_native()) {
tty->print("method is native");
st->print("method is native");
} else {
address bcp = sd->method()->bcp_from(sd->bci());
Bytecodes::Code bc = Bytecodes::java_code_at(bcp);
@ -2137,13 +2136,13 @@ void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin,
}
}
}
st->cr();
// Print all scopes
for (;sd != NULL; sd = sd->sender()) {
st->fill_to(column);
st->move_to(column);
st->print("; -");
if (sd->method().is_null()) {
tty->print("method is NULL");
st->print("method is NULL");
} else {
sd->method()->print_short_name(st);
}
@ -2161,17 +2160,19 @@ void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin,
const char* str = reloc_string_for(begin, end);
if (str != NULL) {
if (sd != NULL) st->cr();
st->fill_to(column);
st->move_to(column);
st->print("; {%s}", str);
}
int cont_offset = ImplicitExceptionTable(this).at(begin - instructions_begin());
if (cont_offset != 0) {
st->fill_to(column);
st->move_to(column);
st->print("; implicit exception: dispatches to " INTPTR_FORMAT, instructions_begin() + cont_offset);
}
}
#ifndef PRODUCT
void nmethod::print_value_on(outputStream* st) const {
print_on(st, "nmethod");
}

View file

@ -485,8 +485,8 @@ class nmethod : public CodeBlob {
void verify_interrupt_point(address interrupt_point);
// printing support
void print() const PRODUCT_RETURN;
void print_code() PRODUCT_RETURN;
void print() const;
void print_code();
void print_relocations() PRODUCT_RETURN;
void print_pcs() PRODUCT_RETURN;
void print_scopes() PRODUCT_RETURN;
@ -495,7 +495,7 @@ class nmethod : public CodeBlob {
void print_calls(outputStream* st) PRODUCT_RETURN;
void print_handler_table() PRODUCT_RETURN;
void print_nul_chk_table() PRODUCT_RETURN;
void print_nmethod(bool print_code) PRODUCT_RETURN;
void print_nmethod(bool print_code);
void print_on(outputStream* st, const char* title) const;
@ -505,7 +505,7 @@ class nmethod : public CodeBlob {
void log_state_change(int state) const;
// Prints a comment for one native instruction (reloc info, pc desc)
void print_code_comment_on(outputStream* st, int column, address begin, address end) PRODUCT_RETURN;
void print_code_comment_on(outputStream* st, int column, address begin, address end);
static void print_statistics() PRODUCT_RETURN;
// Compiler task identification. Note that all OSR methods

View file

@ -36,7 +36,6 @@ const int VMRegImpl::register_count = ConcreteRegisterImpl::number_of_registers;
// Register names
const char *VMRegImpl::regName[ConcreteRegisterImpl::number_of_registers];
#ifndef PRODUCT
void VMRegImpl::print_on(outputStream* st) const {
if( is_reg() ) {
assert( VMRegImpl::regName[value()], "" );
@ -48,4 +47,3 @@ void VMRegImpl::print_on(outputStream* st) const {
st->print("BAD!");
}
}
#endif // PRODUCT

View file

@ -96,7 +96,7 @@ public:
intptr_t value() const {return (intptr_t) this; }
void print_on(outputStream* st) const PRODUCT_RETURN;
void print_on(outputStream* st) const;
void print() const { print_on(tty); }
// bias a stack slot.
@ -156,22 +156,22 @@ public:
_first = ptr;
}
// Return true if single register, even if the pair is really just adjacent stack slots
bool is_single_reg() {
bool is_single_reg() const {
return (_first->is_valid()) && (_first->value() + 1 == _second->value());
}
// Return true if single stack based "register" where the slot alignment matches input alignment
bool is_adjacent_on_stack(int alignment) {
bool is_adjacent_on_stack(int alignment) const {
return (_first->is_stack() && (_first->value() + 1 == _second->value()) && ((_first->value() & (alignment-1)) == 0));
}
// Return true if single stack based "register" where the slot alignment matches input alignment
bool is_adjacent_aligned_on_stack(int alignment) {
bool is_adjacent_aligned_on_stack(int alignment) const {
return (_first->is_stack() && (_first->value() + 1 == _second->value()) && ((_first->value() & (alignment-1)) == 0));
}
// Return true if single register but adjacent stack slots do not count
bool is_single_phys_reg() {
bool is_single_phys_reg() const {
return (_first->is_reg() && (_first->value() + 1 == _second->value()));
}