1. A method for defining an instruction path to be compiled by a just-in-time compiler, comprising: interpreting a first non-native instruction to generate a first instruction code; creating a shadow memory having at least one entry, wherein the at least one entry includes one partition for storing a pointer and a plurality of partitions for storing instruction codes; identifying a plurality of instruction codes reachable by the first instruction code; updating the pointer to associate the first instruction code and the identified plurality of instruction codes; assigning a first group of instruction codes to the at least one entry of the shadow memory, wherein the first group of instruction codes include the pointer and the identified plurality of instruction codes; compiling the first group of instruction codes to generate a native instruction path; and identifying a second instruction code from the plurality of instruction codes that satisfy a criteria for terminating an instruction code path, wherein no instruction code in the plurality of instruction codes branched to after the second instruction code is assigned to the first group of instructions.