Going to the next statement, which would be performed in any case, clears the prefetch queue of instructions on any Intel x86 processor that has one. This was commonplace in self-modifying code to ensure that the modified code was actually executed. Intel went so far as to document the use of jump as a means of ensuring the correct execution of self-modified code, even on modern processors.
From Intel 64 and IA-32 Software Developer's Guide Volume 3: System Programming Guide :
8.1.3 Self-learning and cross-modification code processing
...
While processor microarchitters become more complex and start speculatively executing code before retirement (as in P6 and later processor families), the rules for which code must be executed, pre- or after modification, become blurry. To write self-modifying code and make sure that it matches current and future versions of IA-32 architectures, use one of the following encoding options:
(* OPTION 1 *) Store modified code (as data) into code segment; Jump to new code or an intermediate location; Execute new code;
(Option 2 is to use the serialization instruction instead of the jump, but they do not exist on earlier x86 processors.)
source share