I have an implementation question that I'm having trouble figuring out.

I have a HIR pass that instruments method calls for some stats gathering that I'd like to do. I collect a complete call trace (compressed), but need a way to dump out the compressed trace when the VM exits.

I've tried declaring a class that inherits from Action and redefines the deinit() method to suit my purposes (and I used the DEFINE_SESSION_ACTION_WITH_ACTION macro to register it with the session action for my pass). The problem is that deinit() does not seem to be called every time the VM exits. If I run "java - showversion" for example, deinit() is called. If I run the DaCapo antlr benchmark it isn't called.

Is this correct behavior?

Or, am I going about this all wrong? I've noticed that deinit() is called once for each JIT pipeline my pass is a part of (2 in server.emconf derivative). I really want a way to call a method once when the VM exits, but if such a thing doesn't exist I can manage with something like deinit().

Thanks,
Naveen

Reply via email to