Bytecode Instrumentation

| 2004 JavaOne
SM
Conference | Session 3042 Copyright Hewlett Packard Co., 2004.
22
java_crw_demo BCI Library
C library in 5.0 JRE used by HPROF and other JVMTI agents
BCI support: [O’Hair]
Class initialization
Entry to the java.lang.Object init method (signature "()V")
Inject invokestatic call to tclass.obj_init_method(object)
Method instrumentation
Entry
Inject invokestatic call to
tclass.call_method(class_num,method_num)
Map the class_num and method_num using the crw library
Return (each site)
Inject invokestatic call to
tclass.return_method(class_num,method_num)
newarray type opcode
Duplicate array object on the stack
Inject invokestatic call to tclass.newarray_method(object)