<div dir="ltr"><div>Hi Julian, </div><div><br></div><div>See inline.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Dec 16, 2024 at 7:23 AM Julian Waters <<a href="mailto:tanksherman27@gmail.com">tanksherman27@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I'm a little puzzled, mobile has a Pull Request for iOS at<br>
<a href="https://github.com/openjdk/mobile/pull/30" rel="noreferrer" target="_blank">https://github.com/openjdk/mobile/pull/30</a> which uses the minimal<br>
variant. How is minimal possible on iOS since it includes C1 and the<br>
assembly based Interpreter? Or has that one been dropped in favour of<br>
Zero on iOS instead, as the current post seems to imply?<br></blockquote><div><br></div><div>Correct, PR-30 isn't relevant anymore (I closed it). I had this PR so that others could follow my work, and comment on it, which is why it was prefixed with [WIP]</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On the topic of Android, I also remember hearing that all Android<br>
applications, even ones written in C or C++, are actually Android<br>
Runtime apps and all run in the same Android Java VM (Native C and C++<br>
code simply becomes a shared library that is loaded through JNI). I<br>
don't know how true that is since my knowledge of mobile operating<br>
systems, including Android, is rather spotty, but if there really<br>
isn't a way to run an application as a fully native and standalone one<br>
on Android and everything is actually in a Java VM under the hood, how<br>
would the JDK fit on an Android device? Sounds to me like the Java<br>
executables and HotSpot itself would end up ironically running inside<br>
a Java VM, which would probably destroy performance to an epic degree,<br>
among a host of other issues that will likely be present as a result<br>
of this.<br></blockquote><div><br></div><div>Performance is actually pretty good on Android. We use this approach already (at Gluon), with images compiled with GraalVM native-image and SubstrateVM (hence not hotspot). In this approach, we start an Android Activity and invoke a native method immediately which starts the non-Android JVM. So there is little overhead in execution time. The appsize is bigger though, as we bundle a JVM while native Android apps don't do that, as they leverage the pre-installed Android (J)VM on the devices.</div><div>In a next step, I want to use hotspot as the JVM, but the flow would probably still be the same as we do now. I don't see performance as an issue, but rather apk size and appstore specific things (permission management etc). The latter is something we can't avoid, but the rules there are the same for all Android developers (idem for iOS).</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Lastly, how can the mobile port be compiled? What environment is<br>
required? Since iOS seems to be the only working one at the moment,<br>
I'm guessing Xcode? There's no instructions in building.md for either<br>
iOS or Android, and I would submit an enhancement to include<br>
instructions for both, but currently I myself am not sure where to<br>
start even compiling the JDK for mobile devices. It might be helpful<br>
to share that information in the docs files.<br></blockquote><div><br></div><div>I absolutely agree. Keep in mind that this is spare-time, volunteer project at this moment, but even then docs are crucial. Hence, as I said I plan to update the OpenJDK Mobile wiki (or I would be happy of course if someone else does it). The PR itself (<a href="https://github.com/openjdk/mobile/pull/32">https://github.com/openjdk/mobile/pull/32</a>) has information on how to configure/compile -- I'll copy my own configure below, hope that helps.</div><div><br></div><div><pre class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;margin-top:0px;overflow:auto;line-height:1.45;color:rgb(31,35,40);border-radius:6px"><code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0px;margin:0px;background:transparent;border-radius:6px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit">sh configure \
--with-conf-name=zero-ios-aarch64 \
--disable-warnings-as-errors \
--openjdk-target=aarch64-macos-ios \
--with-build-jdk=/opt/jdk-25-jv.jdk \
--with-boot-jdk=/opt/jdk-24.jdk/Contents/Home \
--with-jvm-variants=zero \
--with-libffi-include=/Users/johan/libffi/exp/t2/libffi-3.4.5/build_iphoneos-arm64/include \
--with-libffi-lib=/Users/johan/libffi/exp/t2/libffi-3.4.5/build_iphoneos-arm64/.libs \
--with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \
--with-cups-include=../support/cups-2.3.6</code></pre></div></div><div class="gmail_quote gmail_quote_container"><br></div><div class="gmail_quote gmail_quote_container"><br><div>- Johan</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
best regards,<br>
Julian<br>
</blockquote></div></div>