in reply to Analyzing opcodes of lvalue-subs...
I'm a little bit confused about line j, what means "rv2cv"?
I believe rv2cv gets the CV (code value, the code reference) from the specified glob (symbol table entry). Basically, foo() is implemented as something conceptually similar to *{"foo"}{CODE}->().
You'll find something similar for all other kinds of package variables: rv2sv for scalars, rv2av for arrays, rv2hv for hashes, etc.
>perl -MO=Concise -e"$s" 4 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v ->3 - <1> ex-rv2sv vK/1 ->4 3 <#> gvsv[*s] s ->4 -e syntax OK >perl -MO=Concise -e"@a" 5 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v ->3 4 <1> rv2av[t2] vK/1 ->5 3 <#> gv[*a] s ->4 -e syntax OK
I'm a little bit confused about line j, what means "rv2cv"?
Opcodes are defined in pp*.c. Search for pp_opcode. pp_rv2cv is in pp.c.
|
|---|