|View Issue Details [ Jump to Notes ]||[ Issue History ] [ Print ]|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000447||mercury||Feature Request||public||2018-02-06 18:16||2018-02-06 18:16|
|Target Version||Fixed in Version|
|Summary||0000447: direct_arg_switch type representation|
|Description||Some types, such as item and pragma_type in the Mercury compiler,|
consist of many functors of arity 1, each of whose arguments is a structure
represented by an aligned pointer to the heap.
At the moment, on 64 bit machines, we represent the first 7 functors
as tagged pointers to those structures, and the remaining functors
as two-word cells on the heap, with the first word being a secondary tag
and the second being the structure pointer to the argument.
This is probably the best representation we can get *if* the first 7 functors
are the ones that occur most often. However, this may not be the case.
Programmers can reorder the functors to *make* it the case, but this may
not be desirable on software engineering grounds; for example, it may
require that related functors not be put next to each other.
It would be nice to have a pragma that tells the compiler the order of
frequency of occurrence of the functors, so it can optimize the representation
of the most frequently occurring functors. (Specifying the complete order
would make this work regardless of the number of primary tag bits available.)
It would be even better if a profiler generated that information automatically.
This could be done by instrumenting e.g. every complete switch on the type
to record which branch was taken.
|Tags||No tags attached.|
|2018-02-06 18:16||zs||New Issue|
|2018-02-06 18:16||zs||Status||new => assigned|
|2018-02-06 18:16||zs||Assigned To||=> zs|