1. A method of partial inlining called blocks of code into calling blocks of code of a computer program, comprising data processing system implemented steps of: selecting a subset of blocks of the called blocks of code for inlining into the calling blocks of code; creating a restart block to restart the called blocks of code in place of non-selected blocks of the called blocks of code, wherein the restart block contains instructions to exit from the selected blocks of code and call a previously compiled version of the called blocks of code; sanitizing global side effects in the selected subset of blocks in order to preserve a correct global state of the computer program if a restart of the called blocks of code occurs; and inlining the restart block and the selected blocks into the calling blocks of code of the computer program.