Patent ID: 8732442

Claim:
A method for managing data, comprising: identifying a thread executing on a hardware processor; identifying, in a first memory page corresponding to the thread, a references stack storing a plurality of object references; identifying, in a second memory page corresponding to the thread, an immediates stack storing a plurality of immediate values; obtaining, from the thread, a first instruction for moving a first data item from a first source to a first destination; determining, based on a page table entry of the first source, that the first data item is among the plurality of immediate values and that the first source is located in the immediates stack; determining, based on a page table entry of the first destination, that the first destination is located in the references stack; determining, based on the first source being located in the immediates stack and the first destination being in the references stack, that the first instruction is invalid; and trapping the first instruction in response to determining the first instruction is invalid.