Skip to content
Permalink
Browse files
8258553: Limit number of fields in instance to be considered for scal…
…ar replacement

Reviewed-by: kvn, vlivanov
  • Loading branch information
Igor Veresov committed Dec 18, 2020
1 parent adf0e23 commit 7f92d187b14f190659f7373c66a55fc727d25ffc
Showing 2 changed files with 10 additions and 0 deletions.
@@ -536,6 +536,10 @@
"Array size (number of elements) limit for scalar replacement") \
range(0, max_jint) \
\
product(intx, EliminateAllocationFieldsLimit, 512, DIAGNOSTIC, \
"Number of fields in instance limit for scalar replacement") \
range(0, max_jint) \
\
product(bool, OptimizePtrCompare, true, \
"Use escape analysis to optimize pointers compare") \
\
@@ -906,6 +906,12 @@ void ConnectionGraph::add_call_node(CallNode* call) {
!cik->as_instance_klass()->can_be_instantiated() ||
cik->as_instance_klass()->has_finalizer()) {
es = PointsToNode::GlobalEscape;
} else {
int nfields = cik->as_instance_klass()->nof_nonstatic_fields();
if (nfields > EliminateAllocationFieldsLimit) {
// Not scalar replaceable if there are too many fields.
scalar_replaceable = false;
}
}
}
add_java_object(call, es);

1 comment on commit 7f92d18

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 7f92d18 Dec 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.