Optimized execution of dynamic languages
First Claim
1. A machine-implemented method comprising:
- receiving a code block of dynamic language code, the code block including one or more variables;
generating a control flow graph of the code block, the control flow graph including one or more operations;
performing forward data flow analysis for the control flow graph of the code block, the forward data flow analysis for each operation of the one or more operations of the control flow graph comprising;
determining if the operation provides an update regarding a type of one or more of the one or more operations or one or more variables, the update being based on one or more rules of type inference, wherein the one or more rules of type inference comprise at least one of;
information including a signature of a builtin, a return type computed for a user function, an argument type from call-time function specialization, or a rule of language of the code block;
updating a type set of each of the one or more operations when the operation provides the update regarding the type of each of the one or more operations, wherein the update regarding the type of at least one of the one or more operations is determined independently of the one or more variables; and
updating a type set of each of the one or more variables when the operation provides the update regarding the type of each of the one or more variables; and
returning the type set for the one or more of the one or more operations or the one or more variables of the code block determined in response to the forward data flow analysis, wherein the type set of each of the one or more operations or the one or more variables defines possible types for each of the one or more operations or the one or more variables.
2 Assignments
0 Petitions
Accused Products
Abstract
In one aspect, a method includes receiving a code block including one or more variables, performing forward data flow analysis for the code block including generating a control flow graph of the code block and for each operation in the control flow graph determining if the operation provides an update regarding the type of one or more of the operations or variables of the code block, the update being based on one or more rules of type inference, updating a type set of each of the operations or variables where the operation provides an update regarding the type, determining if the operation provides an update regarding the location of the variables, the update being based on one or more rules of location inference and updating a location set of each of the variables where the operation provides an update regarding the location set.
45 Citations
18 Claims
-
1. A machine-implemented method comprising:
-
receiving a code block of dynamic language code, the code block including one or more variables; generating a control flow graph of the code block, the control flow graph including one or more operations; performing forward data flow analysis for the control flow graph of the code block, the forward data flow analysis for each operation of the one or more operations of the control flow graph comprising; determining if the operation provides an update regarding a type of one or more of the one or more operations or one or more variables, the update being based on one or more rules of type inference, wherein the one or more rules of type inference comprise at least one of;
information including a signature of a builtin, a return type computed for a user function, an argument type from call-time function specialization, or a rule of language of the code block;updating a type set of each of the one or more operations when the operation provides the update regarding the type of each of the one or more operations, wherein the update regarding the type of at least one of the one or more operations is determined independently of the one or more variables; and updating a type set of each of the one or more variables when the operation provides the update regarding the type of each of the one or more variables; and returning the type set for the one or more of the one or more operations or the one or more variables of the code block determined in response to the forward data flow analysis, wherein the type set of each of the one or more operations or the one or more variables defines possible types for each of the one or more operations or the one or more variables. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
-
-
14. A system comprising:
-
one or more processors; and a machine-readable medium comprising instructions stored therein, which when executed by the processors, cause the processors to perform operations comprising; generating a control flow graph of a code block, the control flow graph comprising one or more operations and one or more variables; performing forward data flow analysis for the code block until the forward data flow analysis converges, the forward data flow analysis for each operation of the one or more operations of the control flow graph comprising; determining if the operation provides an update regarding a type of one or more of the one or more operations or one or more variables, the update being based on one or more rules of type inference, wherein the one or more rules of type inference comprise at least one of;
information including a signature of a builtin, a return type computed for a user function, an argument type from call-time function specialization, or a rule of language of the code block;updating a type set of each of the one or more of the one or more operations or one or more variables where the operation provides the update regarding the type; determining if the operation provides an update regarding a scope of the one or more variables, the update being based on one or more rules of location inference; and updating, prior to executing the code block, a location set of each of the one or more variables where the operation provides the update regarding the scope of the one or more variables; and storing the type sets and location sets generated in response to the forward data flow analysis with respect to the code block. - View Dependent Claims (15, 16)
-
-
17. A non-transitory machine-readable medium comprising instructions stored therein, which when executed by a machine, cause the machine to perform operations comprising:
-
receiving a code block, the code block including one or more variables; generating a control flow graph of the code block including one or more operations; performing forward data flow analysis for the control flow graph of the code block, the forward data flow analysis for each operation of the one or more operations of the control flow graph comprising; determining if the operation provides an update regarding a type of one or more of the one or more operations or one or more variables, the update being based on one or more rules of type inference, wherein the one or more rules of type inference comprise at least one of;
information including a signature of a builtin, a return type computed for a user function, an argument type from call-time function specialization, or a rule of language of the code block;updating a type set of each of the one or more of the one or more operations or one or more variables where the operation provides the update regarding the type; determining if the operation provides an update regarding a scope of the one or more variables, the update being based on one or more rules of location inference; and updating, prior to executing the code block, a location set of each of the one or more variables where the operation provides the update regarding the scope of each of the one or more variables; and returning the type set for each of the one or more of the one or more operations or the one or more variables of the code block determined in response to the forward data flow analysis, wherein the type set of each of the one or more operations or the one or more variables defines possible types for each of the one or more operations or the one or more variables. - View Dependent Claims (18)
-
Specification