mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
8032463: VirtualDispatch test timeout with DeoptimizeALot
Introduce code aging for warm method detection Reviewed-by: kvn, twisti
This commit is contained in:
parent
5938d3d5b9
commit
54db2c2d61
27 changed files with 283 additions and 69 deletions
|
@ -568,6 +568,9 @@ Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses, Pars
|
|||
} else {
|
||||
set_map(entry_map);
|
||||
do_method_entry();
|
||||
if (depth() == 1 && C->age_code()) {
|
||||
decrement_age();
|
||||
}
|
||||
}
|
||||
if (depth() == 1) {
|
||||
// Add check to deoptimize the nmethod if RTM state was changed
|
||||
|
@ -2048,6 +2051,31 @@ void Parse::rtm_deopt() {
|
|||
#endif
|
||||
}
|
||||
|
||||
void Parse::decrement_age() {
|
||||
MethodCounters* mc = method()->ensure_method_counters();
|
||||
if (mc == NULL) {
|
||||
C->record_failure("Must have MCs");
|
||||
return;
|
||||
}
|
||||
assert(!is_osr_parse(), "Not doing this for OSRs");
|
||||
|
||||
// Set starting bci for uncommon trap.
|
||||
set_parse_bci(0);
|
||||
|
||||
const TypePtr* adr_type = TypeRawPtr::make((address)mc);
|
||||
Node* mc_adr = makecon(adr_type);
|
||||
Node* cnt_adr = basic_plus_adr(mc_adr, mc_adr, in_bytes(MethodCounters::nmethod_age_offset()));
|
||||
Node* cnt = make_load(control(), cnt_adr, TypeInt::INT, T_INT, adr_type, MemNode::unordered);
|
||||
Node* decr = _gvn.transform(new (C) SubINode(cnt, makecon(TypeInt::ONE)));
|
||||
store_to_memory(control(), cnt_adr, decr, T_INT, adr_type, MemNode::unordered);
|
||||
Node *chk = _gvn.transform(new (C) CmpINode(decr, makecon(TypeInt::ZERO)));
|
||||
Node* tst = _gvn.transform(new (C) BoolNode(chk, BoolTest::gt));
|
||||
{ BuildCutout unless(this, tst, PROB_ALWAYS);
|
||||
uncommon_trap(Deoptimization::Reason_tenured,
|
||||
Deoptimization::Action_make_not_entrant);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------return_current---------------------------------
|
||||
// Append current _map to _exit_return
|
||||
void Parse::return_current(Node* value) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue