[m-rev.] for review: put almost all layout structures in arrays
Julien Fischer
juliensf at csse.unimelb.edu.au
Fri Nov 6 02:33:13 AEDT 2009
On Wed, 28 Oct 2009, Zoltan Somogyi wrote:
> Move all the frequently occurring layout structures and components of layout
> structures into arrays where possible. By replacing N global variables holding
> individual layout structures or layout structure components with one global
> variable holding an array of them, we reduce the sizes of the symbol tables
> stored in object files, which should speed up both the C compiler and the
> linker.
>
> Measured on the modules of the library, mdbcomp and compiler directories
> compiled in grade asm_fast.gc.debug, this diff reduces the size of the
> generated C source files by 7.8%, the size of the generated object files
> by 10.4%, and the number of symbols in the symbol tables of those object files
> by a whopping 42.8%. (These improvements include, and are not on top of,
> the improvements in my previous similar diff.)
The standard library now compiles in none.gc.debug on eris in 2 hours,
11 minutes -- prior to this change it took just over three hours.
Most of the actual time is being consumed while compiling (C to object
file) just a handful of the library modules, e.g. io, list, tree234,
tree_bitset, string. (Compiling list.c -> list.o takes ~8 minutes).
> runtime/mercury_stack_layout.h:
> Each label layout structure has information about the type and
> location of every variable that is live at that label. We store
> this information in three arrays: an array of pseudo-typeinfos giving
> the types of all these variables, and two arrays MR_ShortLvals and
> MR_LongLvals respectively giving their locations. (Most of the time,
> the location's encoded form fits into one byte (the MR_ShortLval)
> but sometimes it needs more bits (this is when we use MR_LongLval)).
>
...
> runtime/mercury_accurate_gc.c:
> runtime/mercury_agc_debug.c:
> runtime/mercury_layout_util.c:
> runtime/mercury_stack_trace.c:
> runtime/mercury_types.h:
> trace/mercury_trace.c:
> trace/mercury_trace_vars.c:
> Conform to the changes in mercury_stack_layout.h.
Also, the runtime no longer compiles cleanly on 64-bit machines due to:
mercury_layout_util.c: In function `MR_lookup_closure_long_lval':
mercury_layout_util.c:349: warning: cast to pointer from integer of
different size
mercury_layout_util.c: In function `MR_lookup_typeclass_info_long_lval':
mercury_layout_util.c:468: warning: cast to pointer from integer of
different size
mercury_layout_util.c: In function `MR_lookup_answer_block_long_lval':
mercury_layout_util.c:584: warning: cast to pointer from integer of
different size
mercury_layout_util.c: In function `MR_lookup_long_lval_base':
mercury_layout_util.c:704: warning: cast to pointer from integer of
different size
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list