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

Offline instrumentation and external field holder #19

Open
tvale opened this issue Oct 29, 2012 · 1 comment
Open

Offline instrumentation and external field holder #19

tvale opened this issue Oct 29, 2012 · 1 comment

Comments

@tvale
Copy link

tvale commented Oct 29, 2012

Hi Guy,

Can you provide insight as to why you use an external class to hold the bytecode-injected fields in the offline instrumentation?

Thanks,
Tiago.

@fmcarvalho
Copy link
Contributor

The “bytecode-injected fields” that you are referring to, are static final fields initialized with fields’ addresses obtained through the sun.misc.Unsafe.

Yet, remember that you cannot invoke the sun.misc.Unsafe on the JVM bootstrap.

So, if you had the “bytecode-injected fields” in the own transactional class, then you could not instrument any of the Java RT classes that are loaded during the bootstrap, otherwise it would crash.

So, the external class is a workaround to avoid this situation, because it is only referred by transactional methods that are not invoked during the JVM bootstrap.

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

No branches or pull requests

2 participants