Patent ID: 8555264

Claim:
A system for generating efficient code for function type calls in a Java virtual machine or similar environment, comprising: a computer which includes a virtual machine for executing a software application thereon; a memory space which stores software application bytecode that includes callsites, compiled machine code, and software objects, as parts of the software application; and a bytecode to machine code compiler, which optimizes function reference invocations for use within the software application, including, during compilation of the bytecode and prior to execution of a particular callsite, acquiring a function reference that references a target function and that has a function type signature associated therewith, determining that the target function is co/contra variant with respect to the callsite, determining that the target function type is a type that can be safely called from the particular callsite, and if the target function type is determined to be a type that can be safely called from the particular callsite then creating the function type carrier and its associated callsite.