[0.46.0] Inline Class.getComponentType and refactor IL generation to access classDepthAndFlags field of j9Class #19606
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change generates inline IL in Value Propagation for references to
Class.getComponentType()
. That method was previously only inlined if the Class was known at compile-time. If the Class is known to be an array class at compile-time, the generated IL will load the<componentClass>
from thej9ArrayClass
; otherwise, it will generate a run-time test of whether the Class is an array class before returning the<componentClass>
or a null reference.Calls to
Object.getClass()
are also marked as non-null during IL generation as that method is known to always return a non-null reference. That exposes opportunities to optimize uses ofClass
objects that require the reference to be known to be non-null, including inlining calls toClass.getComponentType()
in Value Propagation.Also, there are several places in the JIT compiler that generate IL to access the
classDepthAndFlags
field ofj9class
. This introduces methods inTR_J9VMBase
to do that, as has previously been done with some methods that generate IL to access theclassFlags
field.Finally, this change also deals with some typos in methods that refer to
classDepthAndFlags
incorrectly asclassAndDepthFlags
. One instance,J9::SymbolReferenceTable::findOrCreateClassAndDepthFlagsSymbolRef
, will remain until its upstream use inJ9_PROJECT_SPECIFIC
code in OMR is removed in pull request eclipse-omr/omr#7334.This pull request is a port of pull request #19558 to the v0.46.0-release branch.