1. In a system comprising virtualization logic and a virtual machine (VM) running Guest code, a method of sharing memory pages in the virtualized system comprising: monitoring the Guest code; determining whether a portion of Guest code is to be executed identically or not, wherein the portion of Guest code contains one or more instructions for writing first data to a target memory page; and if it is determined that the portion of Guest code is not to be executed identically, then: executing alternate code in place of the portion of Guest code; and continuing execution of the Guest code from a point within the Guest code subsequent to a location of the portion of Guest code, wherein determining whether the portion of Guest code is to be executed identically or not is a function of at least one of: a match between contents of the target memory page and the first data; and a sharing state of the target memory page.