3 ms·
I was surprised Sun/Oracle's JVM (or Apple, after their 3rd architecture migration) never took a page from AS/400's TIMI (Technology Independent Machine Interfa
by KMag 3y ago
I was surprised Sun/Oracle's JVM (or Apple, after their 3rd architecture migration) never took a page from AS/400's TIMI (Technology Independent Machine Interface) and compile an architecture-independent representation to native code at installation time.
As the Android Runtime later demonstrated, nothing prevents you from distributing an architecture-independent representation, AoT-compiling to native code at installation time, instrumenting the native code, and then re-optimizing at runtime and/or in a background batch process if your instrumentation statistics deviate substantially from what was available the last time you re-optimized.
Apart from the extra disk space for both bytecode and native representations, something like TIMI allows for the best of both worlds as far as AoT and JIT. (It's also nice that TIMI doesn't require a garbage collector to be running.)
I'm not aware of modern AS/400 dynamically re-optimizing binaries, but doing so wouldn't break anything. Given the conservative nature of mainframe users, I imagine dynamic re-compilation would need to be an opt-in feature.
- deleted 3y ago[deleted]
- RandallBrown 3y agoIf I'm understanding correctly, Apple actually did do something similar with Bitcode. The developer would submit one app as serialized LLVM intermediate representation, then Apple would recompile it and serve the correct version for your architecture in the App Store.
- skissane 3y ago> I was surprised Sun/Oracle's JVM (or Apple, after their 3rd architecture migration) never took a page from AS/400's TIMI (Technology Independent Machine Interface) and compile an architecture-independent representation to native code at installation time. GraalVM supports AOT compilation – https://www.graalvm.org/latest/reference-manual/native-image/ https://www.graalvm.org/latest/reference-manual/native-image... But, I think "TIMI" has significantly less value today than it once did. Due to PASE (the AIX compatibility environment), there is ever more code on contemporary IBM i systems which runs outside of the MI bytecode layer. Shifting IBM i to something other than POWER would require recompiling all that code from source.
- sillywalk 3y agoBeyond recompiling, wouldn't porting 'i' to another architecture, say x86-64 or ARM64, would require the addition some sort of PowerPC AS tags active mode - instructions to set the "this is a valid pointer bits" ?
- skissane 3y agoARM already has tagged memory support - https://source.android.com/docs/security/test/memory-safety/arm-mte https://source.android.com/docs/security/test/memory-safety/... - although I don’t know if it is sufficiently equivalent to the PowerPC AS feature. And then ARM also has CHERI / Morello, which is still at the research prototype stage, but may be production ready in a few more years