[m-dev.] the compiler can't bootstrap in Java
Julien Fischer
jfischer at opturion.com
Fri Jul 12 17:17:14 AEST 2024
On Fri, 12 Jul 2024 at 16:43, Peter Wang <novalazy at gmail.com> wrote:
>
> On Fri, 12 Jul 2024 15:36:48 +1000 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> > I am just testing a diff that changes the representation of builtin ops.
> > Since such a diff affects all the backends, I want to test it on all the backends
> > before sending it for review. But my attempt to do so in the java grade
> > failed for a reason unrelated to my diff: the code of some predicate
> > in options.m has become too large for the JVM to handle.
> >
> > The recent changes to options.m, probably my additions of the options
> > controlling color, or Peter's addition of warn_redundant_coerce, probably
> > were the straw that broke the camel's back. Unfortunately, I have no idea
> > how to get the Java ecosystem to tell where *exactly* the actual problem is.
> > There is an error message with a context, but it seems wrong to me.
> > The message you get when you try to link the stage 2 compiler is:
> >
> > Making Java class files
> > Mercury/javas/jmercury/libs__options.java:15: error: code too large
> > private static final jmercury.runtime.TypeInfo_Struct pair__pti_pair_2__plain_libs__options__type_ctor_info_option_0__plain_builtin__type_ctor_info_string_0 = new jmercury.runtime.TypeInfo_Struct();
> >
> > Line 15 is the first non-comment line in that file (which is attached),
> > but it does not seem like it can itself be considered too big in any respect.
> > Do any of you have any ideas for how to find out exactly *what* is too big,
> > so we can try to slim it down?
> >
>
> I manually edited Mercury/javas/jmercury/libs__options.java.
> It looks like if we break up the first "static" block (currently 8486
> lines long), that is enough to get through libs__options.java.
Static initializers in Java are subject to the same 64kb byte code size
limit that methods are.
Julien.
More information about the developers
mailing list