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

Improve lazy instrumentation mechanism #553

Open
6 tasks
eupp opened this issue Mar 3, 2025 · 0 comments
Open
6 tasks

Improve lazy instrumentation mechanism #553

eupp opened this issue Mar 3, 2025 · 0 comments

Comments

@eupp
Copy link
Collaborator

eupp commented Mar 3, 2025

As an optimization, we currently use lazy instrumentation logic to re-transform only those classes related to the test.
This lazy instrumentation mechanism utilizes the fact that managed strategy can intercept object initialization, reads/writes of fields, and other related events, to invoke class bytecode transformation at certain points, mimicking the semantics of Java class initialization:
https://docs.oracle.com/javase/specs/jls/se23/html/jls-12.html#jls-12.4

However, there several bugs and problems currently with this feature. Because of these bugs we sometimes have to use hacks to trigger eager transformation of classes, see examples:

Under this issue we aim to fix these problems.

Implementation:

Testing:

  • Implement infrastructure for fine-grained unit tests to check what classes are instrumented during the test.
  • Add unit tests to check that JLS-12.4 semantics is covered.
  • Add unit tests to check interaction with ignored sections mechanism.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant