Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

my test PR #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

my test PR #1

wants to merge 1 commit into from

Conversation

llxia
Copy link
Owner

@llxia llxia commented Aug 13, 2020

No description provided.

llxia pushed a commit that referenced this pull request May 31, 2023
Disable CLassLookahead because it is possible for static final field
value to be changes via reflection or the unsafe API.

1. Disable ClassLookahead. Similar to GVP, ClassLookahead is using
static analysis of static final field initialization code to provide
field information that is later used to make assumptions about the
field contents which might not be true if reflection or the unsafe
API is used to change static final field values. An environment
variable is introduced to allow ClassLookahead to be re-enable.

2. Apply a fix to ClassLookahead so that it does not not generate field
information for static final fields that can be initialized with
different values on different code paths. This fix is being applied in
case the ClassLookahead code is resurrected in the future since `#1`
above has disabled it globally.

3.Remove the code in IlGen what would replace array length checks with
hard coded obj array length values. This code would look for static
final fields that contain ClassLookahead fieldInfo and use the existence
of that information to permit the inspection of a heap object and
replace array length checks with a constant based on the current heap
object's array length. This fix is also applied as a safety measure
because the disabling of ClassLookahead (`eclipse-openj9#2` above) would effectively
disable this code path.

In general the only safe way to inspect at compile time heap objects
pointed to by static final fields is to us the "Static Final Field
Folding" optimization which uses OSR to invalidate any code which made
an assumptions based on the contents of a static final field when that
fields contents may have been modified by reflection.

Signed-off-by: Kevin Langman <langman@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant