Information processing apparatus and compilation method
AssigneeFujitsu Limited
InventorsKuninori Ishii, Masanori Yamanaka, Masaki Arai
Life of this patent
Estimating the term…
Abstract
A storage unit stores source code including loop processing that is written with an array referenced by an index, a loop variable, and a parameter. A computing unit generates a conditional expression indicating that the index of the array satisfies a predetermined condition, using the loop variable and the parameter. The computing unit generates determination information on the parameter, by eliminating the loop variable from the conditional expression through formula manipulation. Then, the computing unit generates object code corresponding to the source code in accordance with the determination information.
Claims7
An information processing apparatus comprising:
- a memory configured to store source code including loop processing, the loop processing being written with an array referenced by an index including a loop variable and a parameter whose value is dynamically determined before the loop processing and remains constant during the loop processing;
- and
- a processor configured to execute a process including:
- generating a conditional expression indicating that the index of the array satisfies a predetermined condition, using the loop variable and the parameter,
- generating a determination expression that gives an allowable range of the parameter, by eliminating the loop variable from the conditional expression through formula manipulation,
- generating object code corresponding to the source code, and
- inserting check code before the loop processing in the object code, so as to test whether the value of the parameter at run time falls within the allowable range given by the determination expression.
A compilation method comprising:
- acquiring, by a processor, source code including loop processing, the loop processing being written with an array referenced by an index including a loop variable and a parameter whose value is dynamically determined before the loop processing and remains constant during the loop processing;
- generating, by the processor, a conditional expression indicating that the index of the array satisfies a predetermined condition, using the loop variable and the parameter;
- generating, by the processor, a determination expression that gives an allowable range of the parameter, by eliminating the loop variable from the conditional expression through formula manipulation;
- generating, by the processor, object code corresponding to the source code;
- and
- inserting, by the processor, check code before the loop processing in the object code, so as to test whether the value of the parameter at run time falls within the allowable range given by the determination expression.
A computer-readable storage medium storing a computer program that causes a computer to execute a process comprising:
- acquiring source code including loop processing, the loop processing being written with an array referenced by an index including a loop variable and a parameter whose value is dynamically determined before the loop processing and remains constant during the loop processing;
- generating a conditional expression indicating that the index of the array satisfies a predetermined condition, using the loop variable and the parameter;
- generating a determination expression that gives an allowable range of the parameter, by eliminating the loop variable from the conditional expression through formula manipulation;
- generating object code corresponding to the source code;
- and
- inserting check code before the loop processing in the object code, so as to test whether the value of the parameter at run time falls within the allowable range given by the determination expression.
Dependencies are inferred from the claim text.