1. A method for compressing instruction, comprising: analyzing a program code to be executed by a processor to find one or more instruction groups in the program code according to a preset condition, wherein each of the instruction groups comprises one or more instructions in sequential order; sorting the one or more instruction groups according to a cost function of each of the one or more instruction groups; putting the first X of the sorted one or more instruction groups into an instruction table, wherein X is a value determined according to the cost function; and replacing each of the one or more instruction groups in the program code that are put into the instruction table with a corresponding execution-on-instruction-table (EIT) instruction, wherein the EIT instruction has a parameter referring to the corresponding instruction group in the instruction table.