Program conversion apparatus
AssigneeMatsushita Electric Industrial Co., Ltd.
InventorHirohisa Tanaka
Life of this patent
Estimating the term…
Abstract
An optimization information attaching apparatus 100 stores a source program including class definitions and a class instruction. The class definitions each include a class, a virtual function and a base class, and the call instruction calls one of the virtual functions. The optimization information attaching apparatus detects a class that is not inherited by another class, and attaches optimization information to the class definition including the detected class. A compiling apparatus 110 reads the call instruction from the source program, judges whether the virtual function belongs to a class that is not inherited by another class by referring to the optimization information in the source program, and generates an executable instruction group for calling the virtual function directly.
Claims20
A program conversion apparatus that generates at least one executable instruction from a source program written in an object-orientated programming language, and comprises:
- a storage means for storing the source program including a plurality of class definitions and a call instruction having a function name, each class definition defining a class, an inheritance relationship between the class and another class, and a virtual function belonging to the class and identified by the function name,
- only one of the virtual functions defined in the plurality of class definitions being executed when the call instruction is executed;
- a judging means for judging whether a single virtual function from the virtual functions can be determined as the virtual function identified by the function name in the call instruction, judgement performed by referring to the source program without executing the call instruction;
- a generating means for generating, when a single function is determined, an executable instruction for calling directly an executable instruction group corresponding to the single virtual function.
A program conversion method used in a program conversion apparatus that generates at least one executable instruction from a source program written in an object-orientated programming language, and includes a storage means that stores the source program including a plurality of class definitions and a call instruction having a function name,
- wherein each class definition defines a class, an inheritance relationship between the class and another class, and a virtual function belonging to the class and identified by the function name, and only one of the virtual functions defined in the plurality of class definitions is executed when the call instruction is executed, and the program conversion method comprises:
- a judging step judging whether a single virtual function from the virtual functions can be determined as the virtual function identified by the function name in the call instruction, judgement performed by referring to the source program without executing the call instruction;
- and
- a generating step generating, when a single function is determined, an executable instruction for calling directly an executable instruction group corresponding to the single virtual function.
A computer-readable recording medium storing a program conversion program used in a computer that generates at least one executable instruction from a source program written in an object-orientated programming language, and includes a storage means that stores the source program including a plurality of class definitions and a call instruction having a function name, wherein:
- each class definition defines a class, an inheritance relationship between the class and another class, and a virtual function belonging to the class and identified by the function name,
- only one of the virtual functions defined in the plurality of class definitions being executed when the call instruction is executed;
- and the program conversion program comprises:
- a judging step judging whether a single virtual function from the virtual functions can be determined as the virtual function identified by the function name in the call instruction, judgement performed by referring to the source program without executing the call instruction;
- and
- a generating step generating, when a single function is determined, an executable instruction for calling directly an executable instruction group corresponding to the single virtual function.
Dependencies are inferred from the claim text.