Our strategy is to use use page protection. We have an invariant that for every code fragment in the code cache, its original application code is read-only.