Hi Martin,
We've recently had a lot of work and refactorings around this topic, which has resulted in a de-facto split of code into Code objects (containing the majority metadata pointers,
crsrc.org/c/v8/src/objects/code.h) and InstructionStream objects (containing the actual assembly, relocation information, and I think copies of some of the metadata pointers,
crsrc.org/c/v8/src/objects/instruction-stream.h).
In the default configuration, InstructionStreams are allocated in a different space to Code objects (in "external code space"), outside of the main V8 sandbox, so your base assumption around sharing heap space doesn't apply; the reason for this is, among other things, specifically to avoid writes near the instruction stream.
If you want to stress writes to the instruction streams, I think a decent approach is to stress moving GC with `--stress-compation`.
Hope that helps.
- Leszek