[m-dev.] Performance of collect

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Sep 25 22:55:21 AEDT 2000


On 25-Sep-2000, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> | On 25-Sep-2000, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> | > | On 24-Sep-2000, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> | > | > | You're calling from C to Mercury.  In our current implementation (LLDS back-end),
> | > | > | this is fairly expensive.  
> | > | > 
> | > | > So what about the HLDS back-end then?
> | > | > 
> | > | > Is it ready to use?
> | > | 
> | > | Yes, but not for tracing -- currently it doesn't support the debugger.
> | > 
> | > Well currently, you can not use the debugger to debug collect programs anyway
> | > (it is dynamically linked code). So ...
> | 
> | Currently the MLDS back-end doesn't generate *any* calls to MR_trace().
> | So it can't be used for any kind of tracing, whether it be mdb, Morphine,
> | the declarative debugger, or collect.
> 
> Yes, I have understood that. My idea was to use the LLDS back-end (or whatever
> back-end) to compile the Mercury program to be monitored, and to use the MLDS
> back-end to compile the monitor (the collect module).

Oh, I see what you mean.  Hmm...

> Currently, it seems to be impossible to mix code that have been compiled in
> different grades; what are the reasons for that? Do those reasons still hold for
> the MLDS back-end?

The reasons vary a bit.  The main reason is that the linkage (naming)
convention and calling conventions differ between different grades.
That doesn't apply *directly* in your case, since the collect code is
only called from C, not from Mercury.  However, the collect code calls
the Mercury standard library.  To make your idea work, you'd therefore
need to link with two different copies of the standard library and
runtime, one in an LLDS grade and one in an MLDS grade.  That would
almost certainly cause problems.  I don't think it is going to work.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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