[m-dev.] compiling minizinc tools with java grade
Julien Fischer
juliensf at csse.unimelb.edu.au
Tue Jun 2 14:01:02 AEST 2009
On Tue, 2 Jun 2009, Peter Wang wrote:
> On 2009-06-02, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>>
>> minizinc_to_flatzinc.java is 66,833 lines of Java generated from
>> about 9400 lines of Mercury. Searching for the above error message
>> on the web indicates that this is a result of the class file format
>> limiting each method to 64Kb of bytecode.
>
> I guess we'll have to break up large methods somehow. But 9400 lines of
> Mercury is.. I assume it's generated, so the generator can be changed.
No, it's handwritten ... by Ralph. I looked a bit further, the actual
culprit is the 157 clause predicate at the heart of the converter.
>> (2) FlatZinc-to-XML converter (fzn2xml)
>>
>> Compiles and "links". Aborts with an exception, due to
>> NYI RTTI by the looks of it.
>>
>> (3) FlatZinc solution post-processor (solns2dzn)
>>
>> As above.
>
> I have an incomplete patch that fixes some RTTI problems so that getopt
> works. Maybe that's the problem here? I'll send it to you later.
It looks as though that is the case since the stack dump mentions
getopt_io.
>> (4) XML-to-FlatZinc converter (xml2fzn)
>>
>> This fails to compile because Mercury function names are not
>> being mangled into Java method names correctly, e.g.
>>
>> :- func ('7') = int.
>>
>> ('7') = 0x37.
>>
> ...
>> Actually, the problem here is that mlds_to_java.m just re-uses the name
>> mangler for the C backends and that assumes that the module name will be
>> prefixed to the function name in the target language. Since the Java
>> backend doesn't do that ...
>
> Yes. The same problem occurs with the name '', which appears in moose
> (unused).
I think the fix to the name mangler, at least for numeric ids, is fairly
simple. (Actually the first fix is to _not_ use the C name mangler for
Java code -- I will try to sort this out later today.)
Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions: mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the developers
mailing list