rebooting OpenJDK mobile
Johan Vos
johan.vos at gluonhq.com
Tue Jul 2 09:47:26 UTC 2019
The Apple specific restrictions are still valid: you can not compile code
at runtime. Hence, sending Java bytecode to a running app, and have it
compiled there won't work.
The classes need to be compiled before runtime, and part of the executable.
I believe that in theory, it should be possible with e.g. Zero interpreter
to interpret new bytecode, as that is not generating new native code.
Can you elaborate on your use case so that we can see how we can handle
this?
Thanks,
- Johan
On Sun, Jun 30, 2019 at 1:45 PM Rony <rony.flatscher at wu.ac.at> wrote:
> Hi Johan,
>
> would it still be possible to compile Java classes and load them at
> runtime?
>
> —-rony
>
> Rony G. Flatscher (mobil/e)
>
> > Am 28.06.2019 um 16:09 schrieb Johan Vos <johan.vos at gluonhq.com>:
> >
> > Hi,
> >
> > After a long time, it is a good moment now to restart the public work in
> > the OpenJDK Mobile project.
> > In the past, we had a repository with code based on OpenJDK 9 that allows
> > to build the class libraries (including native code) and one or more
> VM's,
> > for Android and iOS.
> >
> > While this works, we still have the limitation on iOS where dynamic code
> is
> > not allowed, hence a JIT is not an option. The Zero VM works there
> > (interpreter mode) but is slow.
> >
> > Today, we can use the GraalVM AOT compiler to compile the code at build
> > time. We can link the compiled Java code with native libraries compiled
> for
> > the target OS, and create executables. Most of the VM functionality is
> > provided by a very small set of files in SubstrateVM (linked to by
> GraalVM
> > native image)
> >
> > We already did this for iOS, based on Java 11 (see
> > https://github.com/johanvos/openjdk-mobile11/tree/mobile) and JavaFX 13.
> > (see our announcement at https://gluonhq.com/java-on-ios-for-real/) The
> > diff to the upstream code is remarkably small.
> >
> > It is my goal now to use project Skara to create a synchronized fork of
> the
> > OpenJDK master, and to push the changes required to build the native libs
> > for the core libraries in there.
> > Ultimately, it would be ideal if all required changes can go upstream.
> >
> > At this moment, this is iOS only, but there are no showstoppers to do
> this
> > for Android as well. The architectures are pretty similar.
> >
> > - Johan
>
>
More information about the mobile-dev
mailing list