From: Will B. <wi...@cs...> - 2008-03-26 20:58:54
|
On Mar 25, 2008, at 4:33 PM, Michael Bond wrote: > Perhaps the best example of adding code to the VM is write barriers > (used > by generational GC, for example). Check out VM_Compiler (see uses of > VM_Barriers) for write barriers in the baseline compiler. Check out > OPT_ExpandRuntimeServices (see case PUTFIELD_opcode) for write > barriers in > the opt compiler and for an example of how to inline the write > barrier. > I think the main difference between these examples and what you want > to do > is that you want to add code at prologues (rather than at writes). Mike, thanks for the advice and references. As an aside, it seems the approach I outlined in my initial message would be adequate (if clunky) to add code to the beginning of every method body, even if it is impossible to add code to the prologue that way. Thanks again for pointing me to the appropriate parts of the system. best, wb --- Will Benton <wi...@cs...> http://pages.cs.wisc.edu/~willb/ |