Files

32 lines
1.6 KiB
Plaintext

$ java -cp classes:asm-9.11.1.jar... demo.TransformDemo target/instrumented (25.0.5+8-LTS)
original 1488 bytes, naive 1799 bytes, with exception handler 2155 bytes
-- naive: time normal returns only (1799 bytes; verify() problems: 0)
PASS naive: time normal returns only: demo.Target here is a different Class object than the one on the class path
boom() threw java.lang.IllegalStateException: boom
explode() threw ArrayIndexOutOfBoundsException
fib recorded 177 call(s)
sumTo recorded 1 call(s)
greet recorded 1 call(s)
pause recorded 1 call(s)
boom recorded 0 call(s)
explode recorded 0 call(s)
PASS naive version never records the two methods that throw
PASS fib(10) makes 177 calls and 177 timings were recorded (recursion included)
-- full: also time when an exception leaves the method (2155 bytes; verify() problems: 0)
PASS full: also time when an exception leaves the method: demo.Target here is a different Class object than the one on the class path
boom() threw java.lang.IllegalStateException: boom
explode() threw ArrayIndexOutOfBoundsException
fib recorded 177 call(s)
sumTo recorded 1 call(s)
greet recorded 1 call(s)
pause recorded 1 call(s)
boom recorded 1 call(s)
explode recorded 1 call(s)
PASS exception-safe version records boom() and explode() once each
PASS fib still recorded 177 times
PASS sumTo and greet recorded once each
PASS pause(50) was recorded as at least 50 ms (>= 50,000,000 ns)
PASS fib(20) gives the same answer before and after
PASS sumTo(12345) gives the same answer before and after
exit=0