[m-rev.] for treview: global, local and field vars in the MLDS

Zoltan Somogyi zoltan.somogyi at runbox.com
Sat Jul 22 16:38:07 AEST 2017

On Sat, 22 Jul 2017 14:49:38 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
> > The diff passes bootcheck in hlc.gc. For the java and csharp grades, the output
> > of the updated compiler is NOT bit-identical with the output of the previous compiler,
> > as shown by the output of the make_java_csharp_diff tool I committed earlier,
> > which is attached as JAVA_CSHARP_DIFF.
> I'll test the C# and Java backends this evening.

Thank you.

> > There are four kinds of differences.
> >
> > 1. The compiler generates Java/C# code for functions in a different order.
> > To eliminate such differences, I modified both the base and test compilers
> > to sort function definitions before writing them out in mlds_to_{cs,java}.m.
> > Therefore this difference is NOT in JAVA_CSHARP_DIFF. The others are.
> >
> > 2. The new compiler always module-qualifies references to runtime system
> > enum constants that are notionally defined in private_builtin.m.
> As has been noted elsewhere, those enum constants don't really belong
> there.  (I intend to shift them into the runtime at some point.)

The target_prefixes type that this diff added should make that simpler
than it would have been before.
> > The old compiler abused the MLDS (treating those constants as if they
> > were global variables) in a way that module qualified them everywhere
> > *except* in private_builtin.java.
> >
> > 3. Almost *all* of the diff part of JAVA_CSHARP_DIFF consists of the
> > following single difference, repeated in lots and lots of times:
> >
> > - /* generic_type */ java.lang.Object closure = null;
> > + /* generic_type */ java.lang.Object closure = closure_arg;
> > cord.Cord_1 conv0_HeadVar__3_3 = null;
> > - closure = closure_arg;
> I suspect that optimization was not occurring in the past precisely
> because of the things that this diff addresses.

So do I, but it may be that the reason is that in this diff, I rewrote part
of the logic of the convert_assignments_into_initializers predicate
in ml_optimize.m, because the old code offended my sensibilities.
It did this by searching for the definition that defines a variable *twice* in a row,
so I deleted the second search after changing the first to remember the location.

Do you have any objection to committing the diff about writing out mmakefile


More information about the reviews mailing list