The invention relates to the technical field of computers, and discloses a
byte code optimization method and device of an
executable file and
electronic equipment. The method comprises the following steps: partitioning
byte codes of a function of an
executable file to obtain a plurality of program blocks; when the
register assignment constant instruction is searched in the program block, judging whether a register in a subsequent instruction of the
register assignment constant instruction is replaced by a preset assignment constant or not; if the first register is replaced, judging whether an instruction taking the first register as a source register or a target register exists after the
register assignment constant instruction in the program block, and obtaining a preliminary deletion optimization judgment result; judging whether an instruction of
jumping out of the program block by a
branch exists after the register assignment constant instruction in the program block; if yes, judging whether an instruction taking the first register as a source register exists in the skipped program block or not; if the instruction taking the first register as the source register exists in the skipped program block, marking the register assignment constant instruction as an undeleted optimization instruction, otherwise, marking the register assignment constant instruction as a target deleted optimization instruction; and traversing each program block until each register assignment constant instruction is judged and the register assignment constant instruction marked as the target deletion optimization instruction is deleted. The register assignment constant instruction is deleted and optimized for the
byte code of each function, and the compiled
byte code is directly optimized, so that the size of an
executable file is reduced, and the execution speed is increased.