1. A method, comprising: protecting an output of a just-in-time (JIT) compiler against attacks during application execution at least by intervening from outside the application into a JIT page generated by the JIT compiler in a memory element of a host; generating a shadow page corresponding to the JIT page; randomly choosing at least one block of instructions in the JIT page; moving the at least one block of instructions to the shadow page; and replacing the at least one block of instructions in the JIT page with at least one of invalid opcodes and halt instructions.