mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 05:45:11 +02:00
6921352: JSR 292 needs its own deopt handler
We need to introduce a new MH deopt handler so we can easily determine if the deopt happened at a MH call site or not. Reviewed-by: never, jrose
This commit is contained in:
parent
8cc63249e9
commit
918c7a2e33
15 changed files with 253 additions and 133 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -593,6 +593,7 @@ nmethod::nmethod(
|
|||
// values something that will never match a pc like the nmethod vtable entry
|
||||
_exception_offset = 0;
|
||||
_deoptimize_offset = 0;
|
||||
_deoptimize_mh_offset = 0;
|
||||
_orig_pc_offset = 0;
|
||||
#ifdef HAVE_DTRACE_H
|
||||
_trap_offset = 0;
|
||||
|
@ -683,6 +684,7 @@ nmethod::nmethod(
|
|||
// values something that will never match a pc like the nmethod vtable entry
|
||||
_exception_offset = 0;
|
||||
_deoptimize_offset = 0;
|
||||
_deoptimize_mh_offset = 0;
|
||||
_trap_offset = offsets->value(CodeOffsets::Dtrace_trap);
|
||||
_orig_pc_offset = 0;
|
||||
_stub_offset = data_offset();
|
||||
|
@ -795,6 +797,7 @@ nmethod::nmethod(
|
|||
// Exception handler and deopt handler are in the stub section
|
||||
_exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions);
|
||||
_deoptimize_offset = _stub_offset + offsets->value(CodeOffsets::Deopt);
|
||||
_deoptimize_mh_offset = _stub_offset + offsets->value(CodeOffsets::DeoptMH);
|
||||
_consts_offset = instructions_offset() + code_buffer->total_offset_of(code_buffer->consts()->start());
|
||||
_scopes_data_offset = data_offset();
|
||||
_scopes_pcs_offset = _scopes_data_offset + round_to(debug_info->data_size (), oopSize);
|
||||
|
@ -2037,9 +2040,21 @@ void nmethodLocker::unlock_nmethod(nmethod* nm) {
|
|||
guarantee(nm->_lock_count >= 0, "unmatched nmethod lock/unlock");
|
||||
}
|
||||
|
||||
bool nmethod::is_deopt_pc(address pc) {
|
||||
bool ret = pc == deopt_handler_begin();
|
||||
return ret;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// nmethod::get_deopt_original_pc
|
||||
//
|
||||
// Return the original PC for the given PC if:
|
||||
// (a) the given PC belongs to a nmethod and
|
||||
// (b) it is a deopt PC
|
||||
address nmethod::get_deopt_original_pc(const frame* fr) {
|
||||
if (fr->cb() == NULL) return NULL;
|
||||
|
||||
nmethod* nm = fr->cb()->as_nmethod_or_null();
|
||||
if (nm != NULL && nm->is_deopt_pc(fr->pc()))
|
||||
return nm->get_original_pc(fr);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2410,6 +2425,8 @@ void nmethod::print_nmethod_labels(outputStream* stream, address block_begin) {
|
|||
if (block_begin == verified_entry_point()) stream->print_cr("[Verified Entry Point]");
|
||||
if (block_begin == exception_begin()) stream->print_cr("[Exception Handler]");
|
||||
if (block_begin == stub_begin()) stream->print_cr("[Stub Code]");
|
||||
if (block_begin == deopt_handler_begin()) stream->print_cr("[Deopt Handler Code]");
|
||||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue