Type inference optimization
AssigneeOracle International Corporation
InventorsMaurizio Cimadamore, Daniel Smith
Life of this patent
Estimating the term…
Abstract
Operations include (a) identifying bounds corresponding to two or more inference variables corresponding to a nested method invocation context, (b) determining that resolution of a first inference variable can be determined as a function of a resolution of a second inference variable, (c) propagating bounds corresponding to the second inference variable from the nested method invocation context to an outer method invocation context without propagating bounds corresponding to the first inference variable, (d) resolving a constraint set to resolve the second inference variable, and (e) resolving the first inference variable based on the resolution of the second inference variable.
Claims20
One or more non-transitory machine-readable media storing instructions which, when executed by one or more processors, cause:
- identifying one or more instructions:
- (a) to invoke a first method associated with a first set of inputs comprising a first argument of a first type and a second argument of a second type;
- and
- (b) to invoke a second method associated with a second set of inputs comprising a first return value from the first method and a third argument of a third type;
- wherein the first type is resolved for a first inference variable, associated with the first method, based at least on a set of bounds for a third inference variable, associated with the second method, that is resolved into the third type;
- wherein the second type is resolved for a second inference variable, associated with the first method, based at least on the first type having been resolved for the first inference variable, associated with the first method;
- wherein the second type is resolved for the second inference variable, associated with the first method, without being dependent upon any set of bounds for any inference variable associated with the second method;
- based on the one or more instructions:
- executing the first method, based at least on the first argument of the first type and the second argument of the second type, to obtain the first return value;
- executing the second method, based at least on the first return value and the third argument of the third type, to obtain a second return value.
A system, comprising:
- one or more devices including one or more hardware processors;
- and
- the system being configured to perform operations comprising:
- identifying one or more instructions:
- (a) to invoke a first method associated with a first set of inputs comprising a first argument of a first type and a second argument of a second type;
- and
- (b) to invoke a second method associated with a second set of inputs comprising a first return value from the first method and a third argument of a third type;
- wherein the first type is resolved for a first inference variable, associated with the first method, based at least on a set of bounds for a third inference variable, associated with the second method, that is resolved into the third type;
- wherein the second type is resolved for a second inference variable, associated with the first method, based at least on the first type having been resolved for the first inference variable, associated with the first method;
- wherein the second type is resolved for the second inference variable, associated with the first method, without being dependent upon any set of bounds for any inference variable associated with the second method;
- based on the one or more instructions:
- executing the first method, based at least on the first argument of the first type and the second argument of the second type, to obtain the first return value;
- executing the second method, based at least on the first return value and the third argument of the third type, to obtain a second return value.
A method, comprising:
- identifying one or more instructions:
- (a) to invoke a first method associated with a first set of inputs comprising a first argument of a first type and a second argument of a second type;
- and
- (b) to invoke a second method associated with a second set of inputs comprising a first return value from the first method and a third argument of a third type;
- wherein the first type is resolved for a first inference variable, associated with the first method, based at least on a set of bounds for a third inference variable, associated with the second method, that is resolved into the third type;
- wherein the second type is resolved for a second inference variable, associated with the first method, based at least on the first type having been resolved for the first inference variable, associated with the first method;
- wherein the second type is resolved for the second inference variable, associated with the first method, without being dependent upon any set of bounds for any inference variable associated with the second method;
- based on the one or more instructions:
- executing the first method, based at least on the first argument of the first type and the second argument of the second type, to obtain the first return value;
- executing the second method, based at least on the first return value and the third argument of the third type, to obtain a second return value;
- wherein the method is executed by one or more devices including one or more hardware processors.
Dependencies are inferred from the claim text.