Patent ID: 7130972

Claim:
A function execution method comprising steps of: stacking, in a stack area of a memory, a function record area according to a format of a first function which is invoked by executing a first invoking function, wherein the first invoking function includes a process to invoke at least one other function; invoking the first function utilizing the stacked function record area; executing the first function which has been invoked; discarding the stacked function record area; compiling source-codes of the first invoking function into an execution format; analyzing the execution format of the first invoking function obtained from compiled source-codes; executing the first invoking function in the function record area; judging if the first invoking function is tail recursive by determining if an execution result of the first function is an execution result of the first invoking function; and if the first invoking function is judged to be tail recursive, then executing a second invoking function as an alternative function; wherein the second invoking function, which is different from the first invoking function, includes utilizing the function record area to invoke the first function.