示例#1
0
void JVMState::dump() const {
    if (_map && !((uintptr_t)_map & 1)) {
        if (_map->len() > _map->req()) {  // _map->has_exceptions()
            Node* ex = _map->in(_map->req());  // _map->next_exception()
            // skip the first one; it's already being printed
            while (ex != NULL && ex->len() > ex->req()) {
                ex = ex->in(ex->req());  // ex->next_exception()
                ex->dump(1);
            }
        }
        _map->dump(2);
    }
    tty->print("JVMS depth=%d loc=%d stk=%d mon=%d end=%d mondepth=%d sp=%d bci=%d method=",
               depth(), locoff(), stkoff(), monoff(), endoff(), monitor_depth(), sp(), bci());
    if (_method == NULL) {
        tty->print_cr("(none)");
    } else {
        _method->print_name();
        tty->cr();
        if (bci() >= 0 && bci() < _method->code_size()) {
            tty->print("    bc: ");
            _method->print_codes(bci(), bci()+1);
        }
    }
    if (caller() != NULL) {
        caller()->dump();
    }
}
int monitor_obj_offset(int idx)const{return monoff()+idx;}