From duke at openjdk.org Mon Dec 9 10:47:23 2024 From: duke at openjdk.org (J. Duke) Date: Mon, 9 Dec 2024 10:47:23 GMT Subject: RFR: Merge jdk:master [v2] In-Reply-To: References: Message-ID: > Hi all, > > this is an _automatically_ generated pull request to notify you that there is 1 commit from the branch `jdk:master`that can **not** be merged into the branch `master`: > > The following file contains merge conflicts: > > - src/java.base/macosx/native/libjava/java_props_macosx.c > > All Committers in this [project](https://openjdk.org/census#mobile) have access to my [personal fork](https://github.com/openjdk-bots/mobile) and can therefore help resolve these merge conflicts (you may want to coordinate who should do this). > The following paragraphs will give an example on how to solve these merge conflicts and push the resulting merge commit to this pull request. > The below commands should be run in a local clone of your [personal fork](https://wiki.openjdk.org/display/skara#Skara-Personalforks) of the [openjdk/mobile](https://github.com/openjdk/mobile) repository. > > > # Ensure target branch is up to date > $ git checkout master > $ git pull https://github.com/openjdk/mobile.git master > > # Fetch and checkout the branch for this pull request > $ git fetch https://github.com/openjdk-bots/mobile.git +6:openjdk-bot-6 > $ git checkout openjdk-bot-6 > > # Merge the target branch > $ git merge master > > > When you have resolved the conflicts resulting from the `git merge` command above, run the following commands to create a merge commit: > > > $ git add paths/to/files/with/conflicts > $ git commit -m 'Merge jdk:master' > > > > When you have created the merge commit, run the following command to push the merge commit to this pull request: > > > $ git push https://github.com/openjdk-bots/mobile.git openjdk-bot-6:6 > > > _Note_: if you are using SSH to push commits to GitHub, then change the URL in the above `git push` command accordingly. > > Thanks, > J. Duke J. Duke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11496 additional commits since the last revision: - Merge jdk:master - Automatic merge of jdk:master into master - Automatic merge of jdk:master into master - Automatic merge of jdk:master into master - Automatic merge of jdk:master into master - Automatic merge of jdk:master into master - Automatic merge of jdk:master into master - Automatic merge of jdk:master into master - Automatic merge of jdk:master into master - Automatic merge of jdk:master into master - ... and 11486 more: https://git.openjdk.org/mobile/compare/9e31e78e...647d9ab7 ------------- Changes: - all: https://git.openjdk.org/mobile/pull/31/files - new: https://git.openjdk.org/mobile/pull/31/files/9e31e78e..647d9ab7 Webrevs: - full: https://webrevs.openjdk.org/?repo=mobile&pr=31&range=01 - incr: https://webrevs.openjdk.org/?repo=mobile&pr=31&range=00-01 Stats: 140 lines in 34 files changed: 115 ins; 0 del; 25 mod Patch: https://git.openjdk.org/mobile/pull/31.diff Fetch: git fetch https://git.openjdk.org/mobile.git pull/31/head:pull/31 PR: https://git.openjdk.org/mobile/pull/31 From duke at openjdk.org Mon Dec 9 10:47:23 2024 From: duke at openjdk.org (J. Duke) Date: Mon, 9 Dec 2024 10:47:23 GMT Subject: Integrated: Merge jdk:master In-Reply-To: References: Message-ID: On Thu, 7 Nov 2024 00:51:13 GMT, J. Duke wrote: > Hi all, > > this is an _automatically_ generated pull request to notify you that there is 1 commit from the branch `jdk:master`that can **not** be merged into the branch `master`: > > The following file contains merge conflicts: > > - src/java.base/macosx/native/libjava/java_props_macosx.c > > All Committers in this [project](https://openjdk.org/census#mobile) have access to my [personal fork](https://github.com/openjdk-bots/mobile) and can therefore help resolve these merge conflicts (you may want to coordinate who should do this). > The following paragraphs will give an example on how to solve these merge conflicts and push the resulting merge commit to this pull request. > The below commands should be run in a local clone of your [personal fork](https://wiki.openjdk.org/display/skara#Skara-Personalforks) of the [openjdk/mobile](https://github.com/openjdk/mobile) repository. > > > # Ensure target branch is up to date > $ git checkout master > $ git pull https://github.com/openjdk/mobile.git master > > # Fetch and checkout the branch for this pull request > $ git fetch https://github.com/openjdk-bots/mobile.git +6:openjdk-bot-6 > $ git checkout openjdk-bot-6 > > # Merge the target branch > $ git merge master > > > When you have resolved the conflicts resulting from the `git merge` command above, run the following commands to create a merge commit: > > > $ git add paths/to/files/with/conflicts > $ git commit -m 'Merge jdk:master' > > > > When you have created the merge commit, run the following command to push the merge commit to this pull request: > > > $ git push https://github.com/openjdk-bots/mobile.git openjdk-bot-6:6 > > > _Note_: if you are using SSH to push commits to GitHub, then change the URL in the above `git push` command accordingly. > > Thanks, > J. Duke This pull request has now been integrated. Changeset: e94506b1 Author: J. Duke Committer: Johan Vos URL: https://git.openjdk.org/mobile/commit/e94506b149a142e5a515dd3f6f9d9fa4907011c9 Stats: 43 lines in 1 file changed: 3 ins; 22 del; 18 mod Merge ------------- PR: https://git.openjdk.org/mobile/pull/31 From tanksherman27 at gmail.com Wed Dec 11 07:06:28 2024 From: tanksherman27 at gmail.com (Julian Waters) Date: Wed, 11 Dec 2024 15:06:28 +0800 Subject: What's the progress on the Mobile Port? Message-ID: Hi all, I was rather intrigued to see that the JDK has a mobile port. I have some experience in maintaining a JDK Port ( https://bugs.openjdk.org/browse/JDK-8288293) and while unlikely that the Port will reach master, I believe this experience will allow me to offer some help. Could I ask what the progress of the mobile port is? What are the changes that the mobile port has made to the JDK to allow it to compile and run on phones and operating systems like iOS and Android? Is there a general diff I could view to see what the mobile port has done thus far? What HotSpot variant does mobile use, for instance? Does it use Zero, or any other different VM variant from Server? I'm looking forward to helping out in any way I can to bring Java to phones around the world :) best regards, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: From tanksherman27 at gmail.com Wed Dec 11 07:12:12 2024 From: tanksherman27 at gmail.com (Julian Waters) Date: Wed, 11 Dec 2024 15:12:12 +0800 Subject: What's the progress on the JDK Mobile Port? Message-ID: Hi all, I was rather intrigued to see that the JDK has a mobile port. I have some experience in maintaining a JDK Port ( https://bugs.openjdk.org/browse/JDK-8288293) and while unlikely that the Port will reach master, I believe this experience will allow me to offer some help. Could I ask what the progress of the mobile port is? What are the changes that the mobile port has made to the JDK to allow it to compile and run on phones and operating systems like iOS and Android? Is there a general diff I could view to see what the mobile port has done thus far? What HotSpot variant does mobile use, for instance? Does it use Zero, or any other different VM variant from Server? I'm looking forward to helping out in any way I can to bring Java to phones around the world :) best regards, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: From tanksherman27 at gmail.com Wed Dec 11 07:13:43 2024 From: tanksherman27 at gmail.com (Julian Waters) Date: Wed, 11 Dec 2024 15:13:43 +0800 Subject: What's the progress on the JDK Mobile Port? Message-ID: Sorry, sent twice by mistake. Please ignore the second mail best regards, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.vos at gluonhq.com Wed Dec 11 10:32:06 2024 From: johan.vos at gluonhq.com (Johan Vos) Date: Wed, 11 Dec 2024 11:32:06 +0100 Subject: What's the progress on the Mobile Port? In-Reply-To: References: Message-ID: Hi Julian, The main branch in the mobile repo [1] has a rather small diff from the head of the jdk [2]. With this diff, it is possible to build the native class libs for iOS and Android. I have a local version of hotspot (Zero) that allows to run HelloWorld on iOS, as of yesterday. That requires lots of cleanup, and then I'll create a PR. I'll add a more complete status update soon (within the next few days), always good to hear people want to read about it :) - Johan [1] https://github.com/openjdk/mobile [2] https://github.com/openjdk/jdk On Wed, Dec 11, 2024 at 8:07?AM Julian Waters wrote: > Hi all, > > I was rather intrigued to see that the JDK has a mobile port. I have some > experience in maintaining a JDK Port ( > https://bugs.openjdk.org/browse/JDK-8288293) and while unlikely that the > Port will reach master, I believe this experience will allow me to offer > some help. Could I ask what the progress of the mobile port is? What are > the changes that the mobile port has made to the JDK to allow it to compile > and run on phones and operating systems like iOS and Android? Is there a > general diff I could view to see what the mobile port has done thus far? > What HotSpot variant does mobile use, for instance? Does it use Zero, or > any other different VM variant from Server? > > I'm looking forward to helping out in any way I can to bring Java to > phones around the world :) > > best regards, > Julian > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidalayachew at gmail.com Wed Dec 11 11:40:20 2024 From: davidalayachew at gmail.com (David Alayachew) Date: Wed, 11 Dec 2024 06:40:20 -0500 Subject: What's the progress on the Mobile Port? In-Reply-To: References: Message-ID: Your work is a blessing Johan. I have been tracking mobile for almost a year now, and I can't wait to see what comes from it. Is it currently headless? Or are you jumping straight into things? On Wed, Dec 11, 2024 at 5:32?AM Johan Vos wrote: > Hi Julian, > > The main branch in the mobile repo [1] has a rather small diff from the > head of the jdk [2]. With this diff, it is possible to build the native > class libs for iOS and Android. > I have a local version of hotspot (Zero) that allows to run HelloWorld on > iOS, as of yesterday. That requires lots of cleanup, and then I'll create a > PR. > I'll add a more complete status update soon (within the next few days), > always good to hear people want to read about it :) > > - Johan > > [1] https://github.com/openjdk/mobile > [2] https://github.com/openjdk/jdk > > On Wed, Dec 11, 2024 at 8:07?AM Julian Waters > wrote: > >> Hi all, >> >> I was rather intrigued to see that the JDK has a mobile port. I have some >> experience in maintaining a JDK Port ( >> https://bugs.openjdk.org/browse/JDK-8288293) and while unlikely that the >> Port will reach master, I believe this experience will allow me to offer >> some help. Could I ask what the progress of the mobile port is? What are >> the changes that the mobile port has made to the JDK to allow it to compile >> and run on phones and operating systems like iOS and Android? Is there a >> general diff I could view to see what the mobile port has done thus far? >> What HotSpot variant does mobile use, for instance? Does it use Zero, or >> any other different VM variant from Server? >> >> I'm looking forward to helping out in any way I can to bring Java to >> phones around the world :) >> >> best regards, >> Julian >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tanksherman27 at gmail.com Wed Dec 11 12:20:19 2024 From: tanksherman27 at gmail.com (Julian Waters) Date: Wed, 11 Dec 2024 20:20:19 +0800 Subject: What's the progress on the Mobile Port? In-Reply-To: References: Message-ID: That's awesome, glad to hear that the mobile port is progressing well. Slow but steady, as they say. I'll look more into the mobile port and see if I can help anywhere once I finish up maintenance of my own port. I'll be looking forward to working on mobile Java. Do let me know if help is needed anywhere on the port. Now, it's time I did some catching up on how to compile Java for mobile :) best regards, Julian On Wed, Dec 11, 2024 at 6:32?PM Johan Vos wrote: > Hi Julian, > > The main branch in the mobile repo [1] has a rather small diff from the > head of the jdk [2]. With this diff, it is possible to build the native > class libs for iOS and Android. > I have a local version of hotspot (Zero) that allows to run HelloWorld on > iOS, as of yesterday. That requires lots of cleanup, and then I'll create a > PR. > I'll add a more complete status update soon (within the next few days), > always good to hear people want to read about it :) > > - Johan > > [1] https://github.com/openjdk/mobile > [2] https://github.com/openjdk/jdk > > On Wed, Dec 11, 2024 at 8:07?AM Julian Waters > wrote: > >> Hi all, >> >> I was rather intrigued to see that the JDK has a mobile port. I have some >> experience in maintaining a JDK Port ( >> https://bugs.openjdk.org/browse/JDK-8288293) and while unlikely that the >> Port will reach master, I believe this experience will allow me to offer >> some help. Could I ask what the progress of the mobile port is? What are >> the changes that the mobile port has made to the JDK to allow it to compile >> and run on phones and operating systems like iOS and Android? Is there a >> general diff I could view to see what the mobile port has done thus far? >> What HotSpot variant does mobile use, for instance? Does it use Zero, or >> any other different VM variant from Server? >> >> I'm looking forward to helping out in any way I can to bring Java to >> phones around the world :) >> >> best regards, >> Julian >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tanksherman27 at gmail.com Wed Dec 11 12:47:18 2024 From: tanksherman27 at gmail.com (Julian Waters) Date: Wed, 11 Dec 2024 20:47:18 +0800 Subject: What's the progress on the Mobile Port? In-Reply-To: References: Message-ID: I've also managed to come up with a diff, hope this is helpful to anyone reading in on the conversation best regards, Julian On Wed, Dec 11, 2024 at 3:06?PM Julian Waters wrote: > Hi all, > > I was rather intrigued to see that the JDK has a mobile port. I have some > experience in maintaining a JDK Port ( > https://bugs.openjdk.org/browse/JDK-8288293) and while unlikely that the > Port will reach master, I believe this experience will allow me to offer > some help. Could I ask what the progress of the mobile port is? What are > the changes that the mobile port has made to the JDK to allow it to compile > and run on phones and operating systems like iOS and Android? Is there a > general diff I could view to see what the mobile port has done thus far? > What HotSpot variant does mobile use, for instance? Does it use Zero, or > any other different VM variant from Server? > > I'm looking forward to helping out in any way I can to bring Java to > phones around the world :) > > best regards, > Julian > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mobile.diff Type: application/octet-stream Size: 25531 bytes Desc: not available URL: From jvos at openjdk.org Sat Dec 14 15:15:40 2024 From: jvos at openjdk.org (Johan Vos) Date: Sat, 14 Dec 2024 15:15:40 GMT Subject: RFR: 8346233: [mobile] enable static-libs-image for iOS Message-ID: This PR makes it possible to build hotspot with zero interpreter for ios using `make static-libs-image` This creates, amongst the native classlibs that we already had, a libjvm.a library that can be used on iOS. Configuring the build can be done similar to what I do in my configuration: 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 ------------- Commit messages: - Allow building hotspot zero for ios-aarch64 Changes: https://git.openjdk.org/mobile/pull/32/files Webrev: https://webrevs.openjdk.org/?repo=mobile&pr=32&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346233 Stats: 46 lines in 15 files changed: 34 ins; 2 del; 10 mod Patch: https://git.openjdk.org/mobile/pull/32.diff Fetch: git fetch https://git.openjdk.org/mobile.git pull/32/head:pull/32 PR: https://git.openjdk.org/mobile/pull/32 From ihse at openjdk.org Sat Dec 14 15:15:40 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Sat, 14 Dec 2024 15:15:40 GMT Subject: RFR: 8346233: [mobile] enable static-libs-image for iOS In-Reply-To: References: Message-ID: <0tzWx5Eu94Pe7s0RV7bVMYQsROpASSoWh96Fh5yfWs4=.b0a09018-b44a-4b5c-b980-7aadbe9c0baa@github.com> On Sat, 14 Dec 2024 15:08:29 GMT, Johan Vos wrote: > This PR makes it possible to build hotspot with zero interpreter for ios using > `make static-libs-image` > > This creates, amongst the native classlibs that we already had, a libjvm.a library that can be used on iOS. > > Configuring the build can be done similar to what I do in my configuration: > > 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 Wow! I am surprised the patch was this small. It's hardly doing any changes at all. This is very encouraging! ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/mobile/pull/32#pullrequestreview-2503900734 From jvos at openjdk.org Sun Dec 15 12:22:00 2024 From: jvos at openjdk.org (Johan Vos) Date: Sun, 15 Dec 2024 12:22:00 GMT Subject: Integrated: 8346233: [mobile] enable static-libs-image for iOS In-Reply-To: References: Message-ID: On Sat, 14 Dec 2024 15:08:29 GMT, Johan Vos wrote: > This PR makes it possible to build hotspot with zero interpreter for ios using > `make static-libs-image` > > This creates, amongst the native classlibs that we already had, a libjvm.a library that can be used on iOS. > > Configuring the build can be done similar to what I do in my configuration: > > 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 This pull request has now been integrated. Changeset: ce70629f Author: Johan Vos URL: https://git.openjdk.org/mobile/commit/ce70629f4394184ba517fb99c92ac9374ec8f37a Stats: 46 lines in 15 files changed: 34 ins; 2 del; 10 mod 8346233: [mobile] enable static-libs-image for iOS Reviewed-by: ihse ------------- PR: https://git.openjdk.org/mobile/pull/32 From johan.vos at gluonhq.com Sun Dec 15 20:17:40 2024 From: johan.vos at gluonhq.com (Johan Vos) Date: Sun, 15 Dec 2024 21:17:40 +0100 Subject: hotspot Zero for iOS Message-ID: Hi, With JDK-8346233 [1] being fixed in the openjdk/mobile repo [2], the mobile repo can now build a static version of the jvm (libjvm.a) that works on iOS. This VM implementation is using the Zero interpreter, which means that it is not using runtime-generated assembly code, and it does not violate iOS rules (e.g. no w+x sections). The iOS sdk build can be created using `make static-libs-image` and it builds on top of the latest work in openjdk/jdk that streamlines the build of static libraries and executables (e.g. see JDK-8339480 [3]) Using this in iOS apps requires the iOS app to include the libjvm.a as well as the required native classlibs (e.g. libjava.a, libnet.a, ...) Also, the required classes need to be available so that the interpreter can use them. I will update the OpenJDK-mobile Wiki with an example on how this can be done. For those wondering about the difference with what we previously did at Gluon with mobile Java: in the past, we were using AOT compilers that were linked to their own JVM implementation (e.g. RoboVM or GraalVM Substrate). Those solutions showed that Java (and JavaFX) really works on iOS and Android devices, and especially the GraalVM AOT allowed for a really fast execution. However, those solutions were not using the hotspot code in OpenJDK. With the recent changes, we are now re-enabling the original architecture in the Mobile Project, by using the very latest hotspot code (Zero interpreter) which aligns the project much closer to the upstream OpenJDK. Over the past years, there have been tremendous improvements in both the JVM and the JDK code in OpenJDK, and the fact that we can use this great work to build apps on mobile is a huge opportunity. Using the Zero interpreter allows us to prove that things work, and it might eventually lead to passing the TCK. It won't give us top-performance, which will be needed for mobile applications. That means there is still lots of work to do in a number of areas, including * AOT: compiled methods (ahead of time, not at runtime) will generally run much faster than interpreted methods. I hope that we can leverage experience from GraalVM and Project Leyden. * footprint: we should only bundle code that is really required by a specific app. Also, we need a similar build for Android -- although we can use a JIT there, so we are not limited to Zero. Ultimately, this project will allow existing and new Java libraries and projects to be used on mobile devices. This brings Java back in pole-position for the Write Once Run Anywhere paradigm. This can even be combined with OpenJFX, to have a single codebase for a complete application including a modern UI, all written in Java, and running on different client devices. As I said, there is lots of work to be done, but at least there is Innovation Everywhere. - Johan [1] https://bugs.openjdk.org/browse/JDK-8346233 [2] https://github.com/openjdk/mobile/commit/ce70629f4394184ba517fb99c92ac9374ec8f37a [3] https://bugs.openjdk.org/browse/JDK-8339480 -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidalayachew at gmail.com Sun Dec 15 21:13:26 2024 From: davidalayachew at gmail.com (David Alayachew) Date: Sun, 15 Dec 2024 16:13:26 -0500 Subject: hotspot Zero for iOS In-Reply-To: References: Message-ID: Wonderful, wonderful news. I do not have an IOS device unfortunately, so I cannot test this, but wonderful news all the same. Thank you for your time and efforts on this. This is a huge milestone. On Sun, Dec 15, 2024 at 3:18?PM Johan Vos wrote: > Hi, > > With JDK-8346233 [1] being fixed in the openjdk/mobile repo [2], the > mobile repo can now build a static version of the jvm (libjvm.a) that works > on iOS. This VM implementation is using the Zero interpreter, which means > that it is not using runtime-generated assembly code, and it does not > violate iOS rules (e.g. no w+x sections). > The iOS sdk build can be created using > `make static-libs-image` > and it builds on top of the latest work in openjdk/jdk that streamlines > the build of static libraries and executables (e.g. see JDK-8339480 [3]) > > Using this in iOS apps requires the iOS app to include the libjvm.a as > well as the required native classlibs (e.g. libjava.a, libnet.a, ...) Also, > the required classes need to be available so that the interpreter can use > them. I will update the OpenJDK-mobile Wiki with an example on how this can > be done. > > For those wondering about the difference with what we previously did at > Gluon with mobile Java: in the past, we were using AOT compilers that were > linked to their own JVM implementation (e.g. RoboVM or GraalVM Substrate). > Those solutions showed that Java (and JavaFX) really works on iOS and > Android devices, and especially the GraalVM AOT allowed for a really fast > execution. However, those solutions were not using the hotspot code in > OpenJDK. > > With the recent changes, we are now re-enabling the original architecture > in the Mobile Project, by using the very latest hotspot code (Zero > interpreter) which aligns the project much closer to the upstream OpenJDK. > Over the past years, there have been tremendous improvements in both the > JVM and the JDK code in OpenJDK, and the fact that we can use this great > work to build apps on mobile is a huge opportunity. > > Using the Zero interpreter allows us to prove that things work, and it > might eventually lead to passing the TCK. It won't give us top-performance, > which will be needed for mobile applications. That means there is still > lots of work to do in a number of areas, including > * AOT: compiled methods (ahead of time, not at runtime) will generally run > much faster than interpreted methods. I hope that we can leverage > experience from GraalVM and Project Leyden. > * footprint: we should only bundle code that is really required by a > specific app. > > Also, we need a similar build for Android -- although we can use a JIT > there, so we are not limited to Zero. > > Ultimately, this project will allow existing and new Java libraries and > projects to be used on mobile devices. This brings Java back in > pole-position for the Write Once Run Anywhere paradigm. This can even be > combined with OpenJFX, to have a single codebase for a complete application > including a modern UI, all written in Java, and running on different client > devices. > > As I said, there is lots of work to be done, but at least there is > Innovation Everywhere. > > - Johan > > [1] https://bugs.openjdk.org/browse/JDK-8346233 > [2] > https://github.com/openjdk/mobile/commit/ce70629f4394184ba517fb99c92ac9374ec8f37a > [3] https://bugs.openjdk.org/browse/JDK-8339480 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tanksherman27 at gmail.com Mon Dec 16 06:22:15 2024 From: tanksherman27 at gmail.com (Julian Waters) Date: Mon, 16 Dec 2024 14:22:15 +0800 Subject: hotspot Zero for iOS Message-ID: Hi, I'm a little puzzled, mobile has a Pull Request for iOS at https://github.com/openjdk/mobile/pull/30 which uses the minimal variant. How is minimal possible on iOS since it includes C1 and the assembly based Interpreter? Or has that one been dropped in favour of Zero on iOS instead, as the current post seems to imply? On the topic of Android, I also remember hearing that all Android applications, even ones written in C or C++, are actually Android Runtime apps and all run in the same Android Java VM (Native C and C++ code simply becomes a shared library that is loaded through JNI). I don't know how true that is since my knowledge of mobile operating systems, including Android, is rather spotty, but if there really isn't a way to run an application as a fully native and standalone one on Android and everything is actually in a Java VM under the hood, how would the JDK fit on an Android device? Sounds to me like the Java executables and HotSpot itself would end up ironically running inside a Java VM, which would probably destroy performance to an epic degree, among a host of other issues that will likely be present as a result of this. Lastly, how can the mobile port be compiled? What environment is required? Since iOS seems to be the only working one at the moment, I'm guessing Xcode? There's no instructions in building.md for either iOS or Android, and I would submit an enhancement to include instructions for both, but currently I myself am not sure where to start even compiling the JDK for mobile devices. It might be helpful to share that information in the docs files. best regards, Julian From johan.vos at gluonhq.com Mon Dec 16 08:06:38 2024 From: johan.vos at gluonhq.com (Johan Vos) Date: Mon, 16 Dec 2024 09:06:38 +0100 Subject: hotspot Zero for iOS In-Reply-To: References: Message-ID: Hi Julian, See inline. On Mon, Dec 16, 2024 at 7:23?AM Julian Waters wrote: > Hi, > > I'm a little puzzled, mobile has a Pull Request for iOS at > https://github.com/openjdk/mobile/pull/30 which uses the minimal > variant. How is minimal possible on iOS since it includes C1 and the > assembly based Interpreter? Or has that one been dropped in favour of > Zero on iOS instead, as the current post seems to imply? > 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] > On the topic of Android, I also remember hearing that all Android > applications, even ones written in C or C++, are actually Android > Runtime apps and all run in the same Android Java VM (Native C and C++ > code simply becomes a shared library that is loaded through JNI). I > don't know how true that is since my knowledge of mobile operating > systems, including Android, is rather spotty, but if there really > isn't a way to run an application as a fully native and standalone one > on Android and everything is actually in a Java VM under the hood, how > would the JDK fit on an Android device? Sounds to me like the Java > executables and HotSpot itself would end up ironically running inside > a Java VM, which would probably destroy performance to an epic degree, > among a host of other issues that will likely be present as a result > of this. > 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. 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). > Lastly, how can the mobile port be compiled? What environment is > required? Since iOS seems to be the only working one at the moment, > I'm guessing Xcode? There's no instructions in building.md for either > iOS or Android, and I would submit an enhancement to include > instructions for both, but currently I myself am not sure where to > start even compiling the JDK for mobile devices. It might be helpful > to share that information in the docs files. > 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 (https://github.com/openjdk/mobile/pull/32) has information on how to configure/compile -- I'll copy my own configure below, hope that helps. 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 - Johan > > best regards, > Julian > -------------- next part -------------- An HTML attachment was scrubbed... URL: