A method for dynamic recompilation of source software instructions for execution
by a target processor, which considers not only the specific source instructions,
but also the intent and purpose of the instructions, to translate and optimize
a set of equivalent code for the target processor. The dynamic recompiler determines
what the source operation code is trying to accomplish and the optimum way of doing
it at the target processor, in an "interpolative" and context sensitive fashion.
The source instructions are processed in blocks of varying sizes by the dynamic
recompiler, which considers the instructions that come before and after a current
instruction to determine the most efficient approach out of several available approaches
for encoding the operation code for the target processor to perform the equivalent
tasks specified by the source instructions. The dynamic compiler comprises a decoding
stage, an optimization stage and an encoding stage.