I have a question regarding methods that appear on the stack when a Java program executes. I have instrumented the code to log when a method execution starts, and when the method exits (think about AOP before and after). I create a log for each thread. The results are mostly as expected, with some subtle differences.
- When a reflective call is encountered, not only
java.lang.reflect.Method#invoke
is logged, but also additional invocations likesun.reflect.DelegatingMethodAccessorImpl#invoke
show up. I assume this is related to the hidden frames discussed in the StackWalker documentation. - There are additional invocations, mainly of
java.lang.ClassLoader.loadClass
, but alsosun.instrument.InstrumentationImpl.transform
(remember, I instrument the code!). Those are methods that have stack frames, but there are no call sites in the application classes.
I have two questions:
- Is there a list of all methods, or a criterion defining methods for which invocations will be hidden (such as "all methods defined in classes in packages starting with
sun.
)? - Is there a list of all methods, or a criterion defining methods that are invocated by the JVM without a callsite in user code?
Thanks
Aucun commentaire:
Enregistrer un commentaire