When we consider programs executed on top of a virtual machine (VM), as it is the case with the JAVA??? platform, we have to mention another alternative to code instrumentation: VM-generated events, or ???VM hooks.??? The VM itself can be instrumented to generate events such as method entry/exit, object allocation, monitor enter, etc.