Expanding a software program by insertion of statements
First Claim
1. A computer-implemented method for expanding a software program by insertion of statements, the method comprising:
- inserting at entry of a function (“
called function”
) a label;
inserting at entry of the called function a first statement to define at least a new variable (“
argument variable”
), if the called function receives at least an argument;
automatically replacing each return statement in the called function with at least a statement that assigns to another new variable (“
return value variable”
) a value to be returned to a calling function, if the called function returns a value; and
inserting at the end of the called function, a second statement to use the return value variable, provided the called function returns a value;
wherein said software program comprises said called function and said calling function.
6 Assignments
0 Petitions
Accused Products
Abstract
Every function that is called (“called function”) is expanded by insertion of several statements at the entry and exit thereof. Moreover, a calling function may also be expanded, by insertion of statements prior to and/or subsequent to a statement in which a called function is invoked. Many of the statements that are inserted contain new variables (called “synthetic variables”) to which registers are allocated during register allocation; the synthetic variables are not part of the originally-written software but are introduced during expansion, e.g. to transfer arguments to and return value from the called functions. Statements that are inserted can be either statements that are translated into assembly code in the normal manner, or alternatively dummy statements that contain instructions which are never translated into assembly code (i.e. ignored by the assembler. Use of dummy statements ensures that a web is established for new variables. After expansion, register allocation is performed.
-
Citations
14 Claims
-
1. A computer-implemented method for expanding a software program by insertion of statements, the method comprising:
-
inserting at entry of a function (“
called function”
) a label;inserting at entry of the called function a first statement to define at least a new variable (“
argument variable”
), if the called function receives at least an argument;automatically replacing each return statement in the called function with at least a statement that assigns to another new variable (“
return value variable”
) a value to be returned to a calling function, if the called function returns a value; andinserting at the end of the called function, a second statement to use the return value variable, provided the called function returns a value; wherein said software program comprises said called function and said calling function. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer programmed to expand a software program by insertion of statements, the computer comprising:
-
means for inserting at entry of a function (“
called function”
) a label;means for inserting at entry of the called function a dummy statement to define at least a new variable (“
argument variable”
), if the called function receives at least an argument;means for replacing each return statement in the called function with a statement that assigns to another new variable (“
return value variable”
) a value to be returned to a calling function, if the called function returns a value; andmeans for inserting at the end of the called function, another dummy statement to use the return value variable, provided the called function returns a value; wherein said software program comprises said called function and said calling function. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
Specification