A system and method for processing virtual machine instructions which
supports the software trap methodology. An application programming
interface (API) prescribes additional functionality for software traps
that remove the processing of recursive virtual machine instructions from
virtual machine hardware and instead process recursive virtual machine
instructions using software. The additional functionality includes the
configuration of a context for processing recursive virtual machine
instructions, which enables the virtual machine instructions to access
CPU registers to retrieve and modify the values of variables as required,
the release of the configured context when processing of recursive
virtual machine instructions is completed, and the return of control to a
virtual machine for processing non-recursive virtual machine
instructions.