> 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?

This sounds like having also 'basic block' entry/exit opcodes.  Hmmm.

BLB = block begin
BBB = basic block begin
SE  = statement end
BBE = basic block end
BLE = block end

sub foo {
        BLB
        BBB
        my ($a, $b) = @_;
        SE
        my $c = bar($a + $b);
        SE
        my $d = bar($a - $b);
        SE
        BBE
        BLB
        if (BBB $c < $d BBE) {
                BLB
                my $e = $c * $d;
                SE
                return ($e + 1)/($e - 1);
                SE
                BLE
        } else {
                BLB
                ($c, $d) = ($d, $c);
                SE
                BLE
        }
        BBB
        return ($c + $d)/($c - $d);
        SE
        BBE
        BLE
}

Looking at this example I also see potential for 'on-exit-from-code'
opcode... (basically, after "return")

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Reply via email to