4 ms·
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 ev
by vardump 3y ago
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.
- mort96 3y agoWhich other JITs behave like this? AFAIK neither V8 nor Spidermonkey nor LuaJIT rely on segfaults as a normal part of their operation?
- silon42 3y agoPersonally 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.
- quotemstr 3y agoAndroid 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.
- fransje26 3y agoThat you can doesn't necessarily mean that you should. https://xkcd.com/1172/ https://xkcd.com/1172/