previous index next

Now, our page protection scheme breaks down when the write instruction is on the same page as its target -- no forward progress is made. Here we use a second strategy: we sandbox all code in the writable region with a check at the top of each fragment that compares the code cache code to a copy of the application code, and a check after each write to see if it modified the current fragment. As you can imagine these checks are expensive, and we use this sandboxing only for cases of self-modifying code, relying on our page protection scheme whenever possible.

  Copyright © 2004 Derek Bruening