Patent ID: 8479182

Claim:
A computer-implemented method of optimizing a Java object on a target computer program, the method comprising: storing a value of the object and management information on the object in association with each other in a storage unit; generating, by a code generation unit from the target computer program, optimized code that is optimized on the condition that the value of the object is constant, and unoptimized code that is to be executed in a case where the value of the object is changed; switching, by a switching unit from executing the target computer program, by using the optimized code to executing the target computer program by using the unoptimized code in response to an event in which the value of the object is written while the target computer program is executed by using the optimized code; managing the object by a management unit accessing the management information by a non-detection write operation in which writing to the object is performed without being detected; mapping a physical memory area to both a write-disabled virtual area where writing is disabled and a write-enabled virtual area where writing is enabled in a virtual memory space; when switching to executing the target computer program by using the optimized code, placing, by the switching unit, the object into an unprivileged write-disabled area of the storage unit where writing by a privileged write instruction is allowed to be performed without being detected while writing by an unprivileged write instruction is detected; translating, by the code generation unit, the writing to the value of the object by the target computer program into the unprivileged write instruction; and processing, by the management unit, the writing to the management information on the object by using the privileged write instruction; and when switching to executing the target computer program by using the unoptimized code, placing, by the switching unit, the object into a write-enabled area of the storage unit where writing by the privileged write instruction and the unprivileged write instruction are allowed to be performed without being detected.