1. A method of global scope basic-block reordering, comprising: profiling an application having a source code decomposable into a plurality of basic-blocks, wherein the profiling yields a global basic-block sequence; generating a hierarchical locality model according to the global basic-block sequence; and generating a target code according to the hierarchical locality model.