[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Julia

Julia

Posted Jul 30, 2024 8:56 UTC (Tue) by khim (subscriber, #9252)
In reply to: Julia by willy
Parent article: May the FOLL_FORCE not be with you

> But editing code while it's still cached by another CPU is a very 90s approach to JIT.

And walking on Earth is so last millennium, right?

People are using the best approach that's available. JITs are editing code that's currently executing and there are no plans to change that.

Usually JITs are using two mappings (one readable, one writable) nowadays, but they absolutely do that, because there are no better approach invented yet.

P.S. And yes, code editing is limited in most JITs: they are rewriting jump target addresses and add new code in place where previously there were just NOPs. But these two are not going away any time soon, because they are tightly coupled with the nature of JIT: it's name, quite literally, means “Just In Time” which means, essentially:

  1. We are compiling small pieces of code at time, thus couldn't afford waste the whole page for a tiny amount of code produced.
  2. We are stitching together code “on the fly” which means that calls to “compile-that-code-and-run-it” in the already finished code are replaced with calls to finished, recompiled, code regularly.

If you find a way to beat Oracle Java's JIT, Google's ART JIT, Chrome V8's JIT, Firefox's Warp JIT and all other JITs that are using that approach with something better then it would be time to say that everyone should switch. Saying that everyone should stop doing what they are doing just because you don't like it — without offering any alternative, on the other hand, is just irresponsible.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds