diff options
author | David Mitchell <davem@iabyn.com> | 2019-09-20 14:43:01 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-09-23 14:52:04 +0100 |
commit | 4df857782a14d0973f58f6a629019d29259b2aad (patch) | |
tree | b2d36c690e1ea63e4e319316ed37b5418407736b /perly.h | |
parent | 64265ceb0b05ed7f7348ea0fa46d968aadb286a2 (diff) | |
download | perl-4df857782a14d0973f58f6a629019d29259b2aad.tar.gz |
put signature ops in their own subtree.
The following code:
sub f ($x,$y) {
study;
}
used to compile as:
a <1> leavesub[1 ref] K/REFC,1 ->(end)
- <@> lineseq KP ->a
1 <;> nextstate(main 5 p:5) v:%,fea=7 ->2
2 <+> argcheck(2,0) v ->3
3 <;> nextstate(main 3 p:5) v:%,fea=7 ->4
4 <+> argelem(0)[$x:3,5] v/SV ->5
5 <;> nextstate(main 4 p:5) v:%,fea=7 ->6
6 <+> argelem(1)[$y:4,5] v/SV ->7
- <;> ex-nextstate(main 5 p:5) v:%,fea=7 ->7
7 <;> nextstate(main 5 p:6) v:%,fea=7 ->8
9 <1> study sK/1 ->a
- <1> ex-rv2sv sK/1 ->9
8 <$> gvsv(*_) s ->9
Following this commit, it compiles as:
a <1> leavesub[1 ref] K/REFC,1 ->(end)
- <@> lineseq KP ->a
- <1> ex-argcheck vK/1 ->7
- <@> lineseq vK ->-
1 <;> nextstate(main 5 p:5) v:%,fea=7 ->2
2 <+> argcheck(2,0) v ->3
3 <;> nextstate(main 3 p:5) v:%,fea=7 ->4
4 <+> argelem(0)[$x:3,5] v/SV ->5
5 <;> nextstate(main 4 p:5) v:%,fea=7 ->6
6 <+> argelem(1)[$y:4,5] v/SV ->7
- <;> ex-nextstate(main 5 p:5) v:%,fea=7 ->-
7 <;> nextstate(main 5 p:6) v:%,fea=7 ->8
9 <1> study sK/1 ->a
- <1> ex-rv2sv sK/1 ->9
8 <#> gvsv[*_] s ->9
All the ops associated with the signature have been put in their own
subtree, with an extra NULL ex-argcheck op "on top". The op on top
serves two purposes: first, it makes it easier for Deparse.pm etc to
spot siganure code; secondly, it may at some point in the future be
upgraded to OP_SIGNATURE when signatures get optimised. It's of type
ex-argcheck only because when being created it needs to be an op type
that's in class UNOP_AUX so that the created op will be suitable for
later optimising, and making it an ex-type associated with signatures
helps flag it as such.
There should be no functional changes apart from the shape of the
optree.
Diffstat (limited to 'perly.h')
-rw-r--r-- | perly.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -189,6 +189,6 @@ int yyparse (void); /* Generated from: - * 2c3a1b30e52b1e872156c881cc6e702a9c0d1be569bfa579632b5eec73ffa9ef perly.y + * c522864236e07231c0a218cecf8cdcd82b74ce082b72f10199de4deeff580100 perly.y * 0947213b55d0ed11693554bea04987e886cf285f5c14cf9075fa1e7acc3f4061 regen_perly.pl * ex: set ro: */ |