News for hackers. Stuff that matters.
Re:macOS Sonoma 14.4 might break Java on your machine by vardump on Monday March 18, 2024 @04:03AM (#39741400)
That's actually a pretty normal way to do things. Optimization for JITting, let the CPU hardware to do the heavy lifting instead of putting conditional jumps everywhere.

It's useful for other things as well. I've used SIGSEGV to emulate hardware interrupts. Normal execution wouldn't trap and there's no need for tests + branches (= normally no slowdown), but when an interrupt occurs a specific often accessed page is marked unreadable.

Re:macOS Sonoma 14.4 might break Java on your machine by mort96 on Monday March 18, 2024 @04:47AM (#39741607)
Which other JITs behave like this? AFAIK neither V8 nor Spidermonkey nor LuaJIT rely on segfaults as a normal part of their operation?
Re:macOS Sonoma 14.4 might break Java on your machine by silon42 on Monday March 18, 2024 @05:35AM (#39741889)
Personally I'd expect this would affect the GC more than the JIT. But I'm not surprised that the JVM uses every trick for speed.
Re:macOS Sonoma 14.4 might break Java on your machine by quotemstr on Monday March 18, 2024 @06:22AM (#39742141)
Android ART uses this mode of operation too. There's absolutely nothing wrong with relying on SIGSEGV and other synchronous signals in this manner and POSIX should make it easier and safer instead of trying to pretend signals are bad and useless.
Re:macOS Sonoma 14.4 might break Java on your machine by fransje26 on Monday March 18, 2024 @05:30AM (#39741865)
That you can doesn't necessarily mean that you should.

https://xkcd.com/1172/