mirror of
https://github.com/openjdk/jdk.git
synced 2026-08-03 06:35:31 +00:00
8389235: [lworld] Wrong reason for too_many_traps_or_recompiles check in Parse::speculate_non_flat_array
Reviewed-by: mchevalier, chagedorn
This commit is contained in:
parent
85860bee21
commit
3bfc2b844d
@ -4926,6 +4926,7 @@ bool Compile::final_graph_reshaping() {
|
||||
bool Compile::too_many_traps(ciMethod* method,
|
||||
int bci,
|
||||
Deoptimization::DeoptReason reason) {
|
||||
assert(reason > Deoptimization::Reason_none && reason <= Deoptimization::Reason_LIMIT, "invalid reason");
|
||||
ciMethodData* md = method->method_data();
|
||||
if (md->is_empty()) {
|
||||
// Assume the trap has not occurred, or that it occurred only
|
||||
@ -4951,6 +4952,7 @@ bool Compile::too_many_traps(ciMethod* method,
|
||||
// Less-accurate variant which does not require a method and bci.
|
||||
bool Compile::too_many_traps(Deoptimization::DeoptReason reason,
|
||||
ciMethodData* logmd) {
|
||||
assert(reason > Deoptimization::Reason_none && reason <= Deoptimization::Reason_LIMIT, "invalid reason");
|
||||
if (trap_count(reason) >= Deoptimization::per_method_trap_limit(reason)) {
|
||||
// Too many traps globally.
|
||||
// Note that we use cumulative trap_count, not just md->trap_count.
|
||||
@ -4975,6 +4977,7 @@ bool Compile::too_many_traps(Deoptimization::DeoptReason reason,
|
||||
bool Compile::too_many_recompiles(ciMethod* method,
|
||||
int bci,
|
||||
Deoptimization::DeoptReason reason) {
|
||||
assert(reason > Deoptimization::Reason_none && reason <= Deoptimization::Reason_LIMIT, "invalid reason");
|
||||
ciMethodData* md = method->method_data();
|
||||
if (md->is_empty()) {
|
||||
// Assume the trap has not occurred, or that it occurred only
|
||||
|
||||
@ -772,7 +772,7 @@ class GraphKit : public Phase {
|
||||
}
|
||||
|
||||
bool too_many_traps_or_recompiles(Deoptimization::DeoptReason reason) {
|
||||
return C->too_many_traps_or_recompiles(method(), bci(), reason);
|
||||
return C->too_many_traps_or_recompiles(method(), bci(), reason);
|
||||
}
|
||||
|
||||
// Returns the object (if any) which was created the moment before.
|
||||
|
||||
@ -581,7 +581,7 @@ Node* Parse::speculate_non_flat_array(Node* const array, const TypeAryPtr* const
|
||||
!too_many_traps_or_recompiles(Deoptimization::Reason_speculate_class_check)) {
|
||||
flat_array = false;
|
||||
reason = Deoptimization::Reason_speculate_class_check;
|
||||
} else if (UseArrayLoadStoreProfile && !too_many_traps_or_recompiles(reason)) {
|
||||
} else if (UseArrayLoadStoreProfile && !too_many_traps_or_recompiles(Deoptimization::Reason_class_check)) {
|
||||
ciKlass* profiled_array_type = nullptr;
|
||||
ciKlass* profiled_element_type = nullptr;
|
||||
ProfilePtrKind element_ptr = ProfileMaybeNull;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user