On Sat, Jul 07, 2001 at 09:58:54PM -0400, Uri Guttman wrote:
> >>>>> "PJ" == Paul Johnson <[EMAIL PROTECTED]> writes:
>
> PJ> Some method of attaching a callback function to arbitrary opcodes would
> PJ> be very useful.
>
> how would you propose those callbacks be attached without op codes to do
> the callback? :)
Well I was specifying requirements rather than proposing solutions, but
with this being the internals list I suppose I should have been thinking
more about the implementation. I'm not aware of any firm decisions
having been made in this area though.
> PJ> For example, in a code coverage tool a callback would be desirable
> PJ> not only at the exit (or entry) of a block, or more accurately a
> PJ> linear code sequence, but also at various points throughout a
> PJ> conditional, so that it is possible to determine not only the
> PJ> truth value of the conditional, but also why. As a trivial
> PJ> example, in $x = $y || $z, was $y true, was it $z, or were they
> PJ> both false?
>
> i think that is best done with inserting special op codes when enabled
> by a profiling or debug flag.
Done by what? Adding opcodes at all conceivable positions could be
unnecessarily expensive for most applications, and you're bound to miss
something that someone wants. I would imagine this is best done on a
case by case basis, but maybe you were thinking that way too.
How is this going to work? Imagine I have a C function or Perl sub I
want to call at the end of a block. Would I insert an opcode to call my
sub, or would there be room to tack a number of pointers onto the
existing block end opcode? Or something else? "No one knows yet" is
fine as an answer (provided it's correct).
> what dan is trying to do (and i am supporting) is keeping the dispatch
> loop as small as possible. it is easier and faster to insert and
> dispatch special op codes than to check more flags.
I have plenty of sympathy with this view. I just want to ensure there
is sufficient power and flexibility to do all sorts of exciting things.
But everything I've heard so far seems to show that everyone else is
after that too.
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net