Skip to content

Single pp OP for "if(ref($self) eq 'REFTYPE')" ? #23395

Open
@richardleach

Description

@richardleach

#23391 points out some inefficiencies around
getting the ref value of an SV. This issue is to break out the specific idea
of converting if ( ref($x) eq 'REFTYPE') into a single, efficient pp OP.

The currently generated optree looks like:

4     <;> nextstate(main 9 -e:1) v:%,us,{,fea=15 ->5
-     <1> null vK/1 ->d
9        <|> cond_expr(other->a) vK/1 ->e
8           <2> seq sK/2 ->9
6              <1> ref[t15] sK/1 ->7
5                 <0> padsv[$x:8,15] s ->6
7              <$> const(PV "HASH") s/BARE ->8

It could conceivably be transformed into something like:

4     <;> nextstate(main 9 -e:1) v:%,us,{,fea=15 ->5
-     <1> null vK/1 ->d
7        <|> cond_expr(other->a) vK/1 ->e
6              <2> ref_eq [... ] sK/1 ->7
5                 <0> padsv[$x:8,15] s ->6

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions