< prev index next >
src/hotspot/share/code/nmethod.cpp
Print this page
*** 596,605 ****
--- 596,607 ----
_nmethod_end_offset = _nul_chk_table_offset;
_compile_id = compile_id;
_comp_level = CompLevel_none;
_entry_point = code_begin() + offsets->value(CodeOffsets::Entry);
_verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry);
+ _verified_value_entry_point = _verified_entry_point;
+ _verified_value_ro_entry_point = _verified_entry_point;
_osr_entry_point = NULL;
_exception_cache = NULL;
_pc_desc_container.reset_to(NULL);
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
*** 756,765 ****
--- 758,769 ----
_handler_table_offset = _dependencies_offset + align_up((int)dependencies->size_in_bytes (), oopSize);
_nul_chk_table_offset = _handler_table_offset + align_up(handler_table->size_in_bytes(), oopSize);
_nmethod_end_offset = _nul_chk_table_offset + align_up(nul_chk_table->size_in_bytes(), oopSize);
_entry_point = code_begin() + offsets->value(CodeOffsets::Entry);
_verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry);
+ _verified_value_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Value_Entry);
+ _verified_value_ro_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Value_Entry_RO);
_osr_entry_point = code_begin() + offsets->value(CodeOffsets::OSR_Entry);
_exception_cache = NULL;
_scopes_data_begin = (address) this + scopes_data_offset;
*** 2222,2232 ****
PcDesc* pd = pc_desc_at(nativeCall_at(call_site)->return_address());
assert(pd != NULL, "PcDesc must exist");
for (ScopeDesc* sd = new ScopeDesc(this, pd->scope_decode_offset(),
pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
! pd->return_oop());
!sd->is_top(); sd = sd->sender()) {
sd->verify();
}
}
--- 2226,2236 ----
PcDesc* pd = pc_desc_at(nativeCall_at(call_site)->return_address());
assert(pd != NULL, "PcDesc must exist");
for (ScopeDesc* sd = new ScopeDesc(this, pd->scope_decode_offset(),
pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
! pd->return_oop(), pd->return_vt());
!sd->is_top(); sd = sd->sender()) {
sd->verify();
}
}
*** 2567,2636 ****
ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
PcDesc* p = pc_desc_near(begin+1);
if (p != NULL && p->real_pc(this) <= end) {
return new ScopeDesc(this, p->scope_decode_offset(),
p->obj_decode_offset(), p->should_reexecute(), p->rethrow_exception(),
! p->return_oop());
}
return NULL;
}
void nmethod::print_nmethod_labels(outputStream* stream, address block_begin) const {
! if (block_begin == entry_point()) stream->print_cr("[Entry Point]");
! if (block_begin == verified_entry_point()) stream->print_cr("[Verified Entry Point]");
! if (JVMCI_ONLY(_exception_offset >= 0 &&) block_begin == exception_begin()) stream->print_cr("[Exception Handler]");
! if (block_begin == stub_begin()) stream->print_cr("[Stub Code]");
! if (JVMCI_ONLY(_deopt_handler_begin != NULL &&) block_begin == deopt_handler_begin()) stream->print_cr("[Deopt Handler Code]");
!
! if (has_method_handle_invokes())
! if (block_begin == deopt_mh_handler_begin()) stream->print_cr("[Deopt MH Handler Code]");
!
! if (block_begin == consts_begin()) stream->print_cr("[Constants]");
!
! if (block_begin == entry_point()) {
methodHandle m = method();
if (m.not_null()) {
stream->print(" # ");
m->print_value_on(stream);
stream->cr();
}
if (m.not_null() && !is_osr_method()) {
ResourceMark rm;
! int sizeargs = m->size_of_parameters();
! BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, sizeargs);
! VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, sizeargs);
! {
! int sig_index = 0;
! if (!m->is_static())
! sig_bt[sig_index++] = T_OBJECT; // 'this'
! for (SignatureStream ss(m->signature()); !ss.at_return_type(); ss.next()) {
BasicType t = ss.type();
! sig_bt[sig_index++] = t;
if (type2size[t] == 2) {
! sig_bt[sig_index++] = T_VOID;
} else {
assert(type2size[t] == 1, "size is 1 or 2");
}
}
- assert(sig_index == sizeargs, "");
- }
const char* spname = "sp"; // make arch-specific?
! intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs, false);
int stack_slot_offset = this->frame_size() * wordSize;
int tab1 = 14, tab2 = 24;
int sig_index = 0;
! int arg_index = (m->is_static() ? 0 : -1);
bool did_old_sp = false;
! for (SignatureStream ss(m->signature()); !ss.at_return_type(); ) {
bool at_this = (arg_index == -1);
bool at_old_sp = false;
BasicType t = (at_this ? T_OBJECT : ss.type());
assert(t == sig_bt[sig_index], "sigs in sync");
! if (at_this)
stream->print(" # this: ");
! else
stream->print(" # parm%d: ", arg_index);
stream->move_to(tab1);
VMReg fst = regs[sig_index].first();
VMReg snd = regs[sig_index].second();
if (fst->is_reg()) {
stream->print("%s", fst->name());
--- 2571,2637 ----
ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
PcDesc* p = pc_desc_near(begin+1);
if (p != NULL && p->real_pc(this) <= end) {
return new ScopeDesc(this, p->scope_decode_offset(),
p->obj_decode_offset(), p->should_reexecute(), p->rethrow_exception(),
! p->return_oop(), p->return_vt());
}
return NULL;
}
void nmethod::print_nmethod_labels(outputStream* stream, address block_begin) const {
! address low = MIN4(entry_point(), verified_entry_point(), verified_value_entry_point(), verified_value_ro_entry_point());
! assert(low != 0, "sanity");
! if (block_begin == low) {
! // Print method arguments before the method entry
methodHandle m = method();
if (m.not_null()) {
stream->print(" # ");
m->print_value_on(stream);
stream->cr();
}
if (m.not_null() && !is_osr_method()) {
ResourceMark rm;
! int sizeargs = 0;
! BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, 256);
! VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, 256);
! Symbol* sig = m->signature();
! const GrowableArray<SigEntry>* sig_cc = m->adapter()->get_sig_cc();
! if (m->has_scalarized_args()) {
! // Use extended signature if value type arguments are passed as fields
! assert(sig_cc != NULL, "must have scalarized signature");
! sig = SigEntry::create_symbol(sig_cc);
! } else if (!m->is_static()) {
! sig_bt[sizeargs++] = T_OBJECT; // 'this'
! }
! for (SignatureStream ss(sig); !ss.at_return_type(); ss.next()) {
BasicType t = ss.type();
! sig_bt[sizeargs++] = t;
if (type2size[t] == 2) {
! sig_bt[sizeargs++] = T_VOID;
} else {
assert(type2size[t] == 1, "size is 1 or 2");
}
}
const char* spname = "sp"; // make arch-specific?
! SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs, false);
int stack_slot_offset = this->frame_size() * wordSize;
int tab1 = 14, tab2 = 24;
int sig_index = 0;
! int sig_index_cc = 0;
! int arg_index = ((m->is_static() || m->has_scalarized_args()) ? 0 : -1);
bool did_old_sp = false;
! for (SignatureStream ss(sig); !ss.at_return_type(); ) {
bool at_this = (arg_index == -1);
bool at_old_sp = false;
BasicType t = (at_this ? T_OBJECT : ss.type());
assert(t == sig_bt[sig_index], "sigs in sync");
! if (at_this) {
stream->print(" # this: ");
! } else {
stream->print(" # parm%d: ", arg_index);
+ }
stream->move_to(tab1);
VMReg fst = regs[sig_index].first();
VMReg snd = regs[sig_index].second();
if (fst->is_reg()) {
stream->print("%s", fst->name());
*** 2659,2668 ****
--- 2660,2678 ----
}
}
if (!did_name)
stream->print("%s", type2name(t));
}
+ if (m->has_scalarized_args()) {
+ while (!SigEntry::skip_value_delimiters(sig_cc, sig_index_cc)) {
+ sig_index_cc++;
+ }
+ if (SigEntry::is_reserved_entry(sig_cc, sig_index_cc)) {
+ stream->print(" [RESERVED]");
+ }
+ sig_index_cc += type2size[t];
+ }
if (at_old_sp) {
stream->print(" (%s of caller)", spname);
did_old_sp = true;
}
stream->cr();
*** 2677,2686 ****
--- 2687,2709 ----
stream->print(" (%s of caller)", spname);
stream->cr();
}
}
}
+
+ if (block_begin == entry_point()) stream->print_cr("[Entry Point]");
+ if (block_begin == verified_entry_point()) stream->print_cr("[Verified Entry Point]");
+ if (block_begin == verified_value_entry_point()) stream->print_cr("[Verified Value Entry Point]");
+ if (block_begin == verified_value_ro_entry_point()) stream->print_cr("[Verified Value Entry Point (RO)]");
+ if (JVMCI_ONLY(_exception_offset >= 0 &&) block_begin == exception_begin()) stream->print_cr("[Exception Handler]");
+ if (block_begin == stub_begin()) stream->print_cr("[Stub Code]");
+ if (JVMCI_ONLY(_deopt_handler_begin != NULL &&) block_begin == deopt_handler_begin()) stream->print_cr("[Deopt Handler Code]");
+
+ if (has_method_handle_invokes())
+ if (block_begin == deopt_mh_handler_begin()) stream->print_cr("[Deopt MH Handler Code]");
+
+ if (block_begin == consts_begin() && consts_begin() != low) stream->print_cr("[Constants]");
}
void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin, u_char* end) {
// First, find an oopmap in (begin, end].
// We use the odd half-closed interval so that oop maps and scope descs
*** 2755,2765 ****
}
default:
break;
}
}
! st->print(" {reexecute=%d rethrow=%d return_oop=%d}", sd->should_reexecute(), sd->rethrow_exception(), sd->return_oop());
}
// Print all scopes
for (;sd != NULL; sd = sd->sender()) {
st->move_to(column);
--- 2778,2788 ----
}
default:
break;
}
}
! st->print(" {reexecute=%d rethrow=%d return_oop=%d return_vt=%d}", sd->should_reexecute(), sd->rethrow_exception(), sd->return_oop(), sd->return_vt());
}
// Print all scopes
for (;sd != NULL; sd = sd->sender()) {
st->move_to(column);
< prev index next >