Dispatch predicate for overloaded functions using type intervals
AssigneeOracle International Corporation
InventorsKarl B. Naden, Justin R. Hilburn, David R. Chase, Guy L. Steele, Victor M. Luchangco, Eric Allen
Life of this patent
Estimating the term…
Abstract
The disclosed embodiments provide a system that facilitates the development and execution of a software program. During runtime of the software program, the system obtains a function call associated with an overloaded function and a generic type hierarchy. Next, the system determines an applicability of an implementation of the overloaded function to the function call. Finally, the system selects the implementation for invocation by the function call based on the determined applicability and a partial order of implementations for the overloaded function.
Claims18
A computer-implemented method for facilitating the development and execution of a software program, comprising:
- during runtime of the software program, obtaining a function call associated with an overloaded function and a generic type hierarchy;
- determining an applicability of an implementation of the overloaded function to the function call;
- selecting the implementation for invocation by the function call based on the determined applicability and a partial order of implementations for the overloaded function;
- and
- performing type inference on one or more generic type parameters of the implementation by:
- applying a constraint-solving technique to a set of initial limits and a set of constraints on the one or more generic type parameters;
- and
- when the constraint-solving technique does not provide a solution to the initial limits and the constraints, determining that the implementation is not applicable to the function call.
A system for facilitating the development and execution of a software program, comprising:
- a compilation manager for the software program;
- and
- a runtime system for the software program,
- wherein the compilation manager and the runtime system are configured to:
- obtain a function call associated with an overloaded function and a generic type hierarchy;
- determine an applicability of an implementation of the overloaded function to the function call;
- select the implementation for invocation by the function call based on the determined applicability and a partial order of implementations for the overloaded function;
- and
- perform type inference on one or more generic type parameters of the implementation by:
- applying a constraint-solving technique to the initial limits and the constraints;
- and
- when the constraint-solving technique does not provide a solution to the initial limits and the constraints, determining that the implementation is not applicable to the function call.
A non-transitory computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for facilitating the development and execution of a software program, the method comprising:
- during runtime of the software program, obtaining a function call associated with an overloaded function and a generic type hierarchy;
- determining an applicability of an implementation of the overloaded function to the function call;
- selecting the implementation for invocation by the function call based on the determined applicability and a partial order of implementations for the overloaded function;
- and
- performing type inference on one or more generic type parameters of the implementation by:
- applying a constraint-solving technique to a set of initial limits and a set of constraints on the one or more generic type parameters;
- and
- when the constraint-solving technique does not provide a solution to the initial limits and the constraints, determining that the implementation is not applicable to the function call.
Dependencies are inferred from the claim text.