8258553: Limit number of fields in instance to be considered for scalar replacement
Reviewed-by: kvn, vlivanov
This commit is contained in:
parent
adf0e23aa2
commit
7f92d187b1
src/hotspot/share/opto
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user