3 ms·
It’s an emulator too though, right? Otherwise things like Chrome (which has a Javascript JIT) would never work in Rosetta.
by Wowfunhappy 6y ago
It’s an emulator too though, right? Otherwise things like Chrome (which has a Javascript JIT) would never work in Rosetta.
- AndrewStephens 6y agoRosetta does work with JIT'ed code. I think the way it works is that any code in memory gets the Rosetta magic applied as soon as it is marked executable.
- OJFord 6y agoSo it's sort of adding latency, as a trade-off for speed (once it starts). That makes so much sense and seems so obvious in a 'huh, probably never would have thought of that' sort of way!
- Someone 6y agoRosetta compiles JITted code ahead of time, once the OS detects the code exists. From what I understand, the OS enforces W^X (memory pages that are writable cannot be executable). That means the OS can use the “set page read-only and executable” system calls to detect the existence of JITted code.
- gok 6y agoPretty sure if it’s done ahead of time we can’t really call it “JIT” can we? :)
- konschubert 6y agoI think what get's cross-compiled is the Javascript JIT-Compiler itself. (The V8)
- Wowfunhappy 6y agoThat wouldn't do much, because the JIT would still be producing Intel code, no?
- m_mueller 6y agoSee other answers, it does sort of a JIT cross compile once a page is marked executable.
- konschubert 6y agoHmm, I guess you have a point.