Hacker News new | ask | show | jobs
by gpderetta 2997 days ago
> It's relatively straightforward for self modifying code to manually flush instruction caches when necessary

Barriers are expensive. JITs might need to issue lots of them. Then the next generation of CPUs start tracking modified lines to make barriers cheaper. Then you end up with all the hardware complexity of implicit barriers without simplifying the software side.

> JIT compilers that target other architectures already satisfy this requirement.

they might have different tuning parameters to take into account the cost of the barrier when deciding profitability of JITing a region of code.

> Only backwards compatibility with existing x86 software requires a coherent instruction cache.

Far from it, IIRC the coherency guarantee has actually been strengthened recently. It used to require a far jump as a barrier.

Explicit vs implicit barriers are just an architectural tradeoff.