Nicholas Clark wrote:
> Where does the op for cmp go in this?
> 
> $ perl -MO=Concise -e '@a = sort {$b cmp $a} @b'
> 
> I see:
> 
> c  <@> leave[1 ref] vKP/REFC ->(end)
> 1     <0> enter ->2
> 2     <;> nextstate(main 2 -e:1) v ->3
> b     <2> aassign[t2] vKS ->c
> -        <1> ex-list lK ->8
> 3           <0> pushmark s ->4
> 7           <@> sort lK/DESC ->8
> 4              <0> pushmark s ->5
> 6              <1> rv2av[t3] lK/1 ->7
> 5                 <$> gv(*b) s ->6
> -        <1> ex-list lK ->b
> 8           <0> pushmark s ->9
> a           <1> rv2av[t1] lKRM*/1 ->b
> 9              <$> gv(*a) s ->a
> 
> 
> 
> I expected to see an ex-scmp in there. Is the cmp ever compiled to ops?

yes, but it's freed in S_simplify_sort, called by ck_sort during optree
construction, i.e. before the peephole optimizer is called.

Concise shows the DESC flag on the sort op that indicates this is a reverse
sort.

Reply via email to