[m-rev.] for review: use bytecode for procedure body representations

Julien Fischer juliensf at cs.mu.OZ.AU
Thu Mar 31 18:00:40 AEST 2005


On Wed, 30 Mar 2005, Zoltan Somogyi wrote:

> Change the mechanism we use to transmit a representation of procedure bodies
> from the compiler to the declarative debugger from Mercury terms to a bytecode.
> This achieves two objectives.
>
> First, the code for Mercury terms worked only as long as the compiler used
> the same data representation as the program being compiled; it generated
> incorrect term representations when e.g. the compiler generating code in
> reserve tag grades.
>
> Second, the new representation is significantly smaller. The total size of the
> .c files in the compiler directory in grade asm_fast.gc.decldebug.tr is now
> only 213 Mb compared with 313 Mb previously (a reduction of almost one third).
> The executable file size of a compiler compiled in asm_fast.gc.decldebug.tr is
> now only 59 Mb, compare with 64 Mb previously (a reduction of almost 8%, and
> there is room for further reductions). The overhead of the decldebug grade
> when compared with a plain debug grade now only about 25%, compared to
> about 36% before.
>
> The downside is that the procedure body representation must now be constructed
> by the declarative debugger from the bytecode instead of being available
> directly. We minimize this effect by using a cache to ensure that each
> procedure's body representation is constructed at most once.
>

This change causes the C compiler to spit out a large number of warnings
about structure initialization from incompatible pointer types.   (This
is occurring when compiling the runtime/library in the .decldebug grades).

The C compiler is complains about the line marked #### below.  The type
of this field was changed in this diff from `MR_Word *' to
`const MR_uint_least8_t *' but as far as I can tell MR_TAG_COMMON(0,279)
will still have type `MR_Word *'.

static MR_STATIC_CODE_CONST MR_Exec_Trace
	mercury_data__proc_layout_exec_trace__fn__float__multiply_by_pow_3_0 = {
MR_LABEL_LAYOUT_REF(fn__float__multiply_by_pow_3_0_i2),
(const MR_Module_Layout *) &mercury_data__module_layout__float,
MR_TAG_COMMON(0,279),		####
NULL,
{ NULL },
mercury_data__head_var_nums__fn__float__multiply_by_pow_3_0,
mercury_data__var_names__fn__float__multiply_by_pow_3_0,
4,
8,
3,
-1,
4,
5,
-1,
MR_EVAL_METHOD_NORMAL,
-1,
MR_TRACE_LEVEL_DECL_REP,
0
};

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list