Patent ID: 8806457

Claim:
A computer-implemented method for compiling software code, comprising: generating, at a first stage of a compiler, a byte code representation of a source code, wherein the generating does not include creating a constant pool for the byte code representation of the source code; performing, at a second stage of the compiler, two or more optimizations on the byte code representation of the source code to produce an optimized byte code representation, wherein the two or more optimizations could not be performed if the constant pool had been generated along with the byte code representation at the first stage of the compiler; identifying, at the second stage of the compiler, and using variable type information included in the optimized byte code representation, a pattern of constant value usage in the optimized byte code representation; generating, at the second stage of the compiler, a constant pool based upon the identified pattern of constant value usage; and generating, at a third stage of the compiler, machine code based upon the optimized byte code representation subsequent to generation of the constant pool.