On Sat, Jul 07, 2001 at 02:49:48PM -0500, Jarkko Hietaniemi wrote:
> On Sat, Jul 07, 2001 at 03:35:04PM -0400, Dan Sugalski wrote:
> > At 02:23 PM 7/7/2001 -0500, Jarkko Hietaniemi wrote:
> > >On Sat, Jul 07, 2001 at 03:07:52PM -0400, Dan Sugalski wrote:
> > > > At 01:00 PM 7/7/2001 -0500, Jarkko Hietaniemi wrote:
> > > > >Would it make sense / be useful to have also distinct "between
> > > > >statements" callbacks?
> > > >
> > > > Yup. For the debugger if nothing else, and it's a good place to put 
> > > cleanup
> > > > code, so... I expect we'll have an "end of statement" opcode
> > >
> > >Maybe just a bit for that on an(y) opcode?
> > 
> > Well, I'd figured we'd have:
> > 
> > *) A 'pending event' bit that would be checked per-opcode.
> > *) An 'end-of-statement' opcode that the compiler would put in at the end 
> > of each statement
> > *) An 'end of block' opcode that the compiler would put in at the end of 
> > each block
> > 
> > The 'end of' opcodes would be able to have extra functions stacked on them 
> > so we could do arbitrary things after the end of every statement or block. 
> > (As well as on an individual block or statement boundary)
> 
> Well, either way (separate end-of opcodes or bits) is fine, depends on
> how 'atomic' you want to keep the opcodes and what kind of metadata
> they carry, if any.

Some method of attaching a callback function to arbitrary opcodes would
be very useful.

For example, in a code coverage tool a callback would be desirable not
only at the exit (or entry) of a block, or more accurately a linear code
sequence,  but also at various points throughout a conditional, so that
it is possible to determine not only the truth value of the conditional,
but also why.  As a trivial example, in $x = $y || $z, was $y true, was
it $z, or were they both false?

Verilog, a Hardware Description Language, is an example of a language in
which this is possible, using the VPI.

> For symmetry a begin-of-block opcode can be imagined, also, but I have
> hard time thinking what would setup the code to run in there unless we
> allow for time travel :-)

See above?

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to