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

Stop setting known object index in findOrCreateStaticSymbol() #21009

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

Conversation

jdmpapin
Copy link
Contributor

SymbolReferenceTable::findOrCreateStaticSymbol() is used only when generating IL for putstatic and getstatic.

For putstatic, if it attempts to store to a static final field, it's very likely that the store is illegal, in which case it will be treated as unresolved. But even if the store is legal, the known object index is useless.

For getstatic, the IL generator will use foldReliableStaticFinalField() from TransformUtil to get the same effect anyway, so setting the known object index here is redundant.

SymbolReferenceTable::findOrCreateStaticSymbol() is used only when
generating IL for putstatic and getstatic.

For putstatic, if it attempts to store to a static final field, it's
very likely that the store is illegal, in which case it will be treated
as unresolved. But even if the store is legal, the known object index is
useless.

For getstatic, the IL generator will use foldReliableStaticFinalField()
from TransformUtil to get the same effect anyway, so setting the known
object index here is redundant.
@jdmpapin jdmpapin requested a review from 0xdaryl January 24, 2025 17:19
@jdmpapin
Copy link
Contributor Author

@0xdaryl, could you please review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant