[m-dev.] for review: Java backend

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Feb 25 03:09:13 AEDT 2001


> +output_rval(mem_addr(_Lval)) -->
> +	{ unexpected(this_file, "output_rval: mem_addr(_) no supported") }.

s/no/not/

> +++ compiler/java_util.m	Wed Feb 21 17:49:24 2001
> +% XXX I'm not sure what the first six of these should be
> +%     for the Java backend.
> +java_util__unary_prefix_op(mktag,		"").
> +java_util__unary_prefix_op(tag,			"").
> +java_util__unary_prefix_op(unmktag,		"").
> +java_util__unary_prefix_op(mkbody,		"").
> +java_util__unary_prefix_op(unmkbody,		"").
> +java_util__unary_prefix_op(hash_string,		"").

Returning "" here is not the right thing to do.

For the first five, you can call unexpected/2;
Java implies `--tags none', so the front-end shouldn't
generate any of these tag-related operators.

For the sixth, you should call sorry/2.  Currently the MLDS code
generator will only generate hash_string operators for string hash
table switches, and currently it will only generate string hash table
switches if the target supports gotos, which Java doesn't.  However,
that may change in the future, e.g. the MLDS code generator may be
changed to generate string hash table switches even if the target
doesn't support gotos (e.g. using a boolean variable rather than a
goto to exit the hash table search loop).


Much of the code in java_util.m is very similar to the code
in c_util.m; I think it is worth mentioning this in a comment
in both files, to help future maintainers to remember to check
both places if they change it.

Anyway, that completes this review.  I would like to see a relative
diff (e.g. produced using `interdiff -h') next time, please.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list