Patent ID: 8006043

Claim:
In a system comprising virtualization logic and a virtual machine (VM) running Guest code, a method comprising: the virtualization logic controlling execution of the Guest code and monitoring the Guest code for a predetermined code pattern; if the virtualization logic detects the predetermined code pattern in a portion of the Guest code, the virtualization logic evaluating a state of at least one memory page; and the virtualization logic determining whether or not to identically execute the portion of the Guest code as a function of the evaluated state of the at least one memory page, wherein the virtualization logic evaluating the state of the at least one memory page comprises: the virtualization logic determining whether or not the at least one memory page is being shared; and if the virtualization logic determines that the at least one memory page is being shared, the virtualization logic determining whether or not to maintain the sharing as a function of contents of the at least one memory page.