Type inference optimization
AssigneeOracle Intemnational 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 computer readable media storing instructions which, when executed by one or more hardware processors, cause:
- identifying a set of methods comprising a nested method and an outer method, wherein the nested method is nested inside the outer method, the nested method is associated with a nested method invocation context, and the outer method is associated with an outer method invocation context;
- identifying a plurality of inference variables associated with the nested method invocation context, the plurality of inference variables comprising a first inference variable and a second inference variable;
- responsive at least to determining that the first inference variable does not depend on a type of an object returned by the nested method:
- refraining from propagating bounds for the first inference variable from the nested method invocation context to the outer method invocation context;
- propagating bounds for at least the second inference variable of the plurality of inference variables from the nested method invocation context to the outer method invocation context;
- determining, by a compiler, a resolution for the second inference variable based on a set of constraints associated with the outer method invocation context;
- and
- determining, by the compiler, a resolution for the first inference variable without using the set of constraints associated with the outer method invocation context.
A method, comprising:
- identifying a set of methods comprising a nested method and an outer method, wherein the nested method is nested inside the outer method, the nested method is associated with a nested method invocation context, and the outer method is associated with an outer method invocation context;
- identifying a plurality of inference variables associated with the nested method invocation context, the plurality of inference variables comprising a first inference variable and a second inference variable;
- responsive at least to determining that the first inference variable does not depend on a type of an object returned by the nested method:
- refraining from propagating bounds for the first inference variable from the nested method invocation context to the outer method invocation context;
- propagating bounds for at least the second inference variable of the plurality of inference variables from the nested method invocation context to the outer method invocation context;
- determining, by a compiler, a resolution for the second inference variable based on a set of constraints associated with the outer method invocation context;
- and
- determining, by the compiler, a resolution for the first inference variable without using the set of constraints associated with the outer method invocation context;
- wherein the method is performed by one or more devices, each including one or more hardware processors.
A system, comprising:
- one or more devices, each including one or more hardware processors;
- the system being configured to perform operations comprising:
- identifying a set of methods comprising a nested method and an outer method, wherein the nested method is nested inside the outer method, the nested method is associated with a nested method invocation context, and the outer method is associated with an outer method invocation context;
- identifying a plurality of inference variables associated with the nested method invocation context, the plurality of inference variables comprising a first inference variable and a second inference variable;
- responsive at least to determining that the first inference variable does not depend on a type of an object returned by the nested method:
- refraining from propagating bounds for the first inference variable from the nested method invocation context to the outer method invocation context;
- propagating bounds for at least the second inference variable of the plurality of inference variables from the nested method invocation context to the outer method invocation context;
- determining, by a compiler, a resolution for the second inference variable based on a set of constraints associated with the outer method invocation context;
- and
- determining, by the compiler, a resolution for the first inference variable without using the set of constraints associated with the outer method invocation context.
Dependencies are inferred from the claim text.