/
Todo
executable file
·46 lines (41 loc) · 1.88 KB
/
Todo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
* Fixes
CC backend: goto, sort with non-default comparison. last for non-loop blocks.
improve XSUB handling (both static and dynamic)
sv_magic can do SvREFCNT_inc(obj) which messes up precalculated refcounts
allocation of XPV[INAHC]V structures needs fixing: Perl tries to free
them, whereas the compiler expects them to be linked to a xpv[inahc]v_root
list the same as X[IPR]V structures.
ref counts
perl_parse replacement
compile-time initialisation of AvARRAYs
signed/unsigned problems with NV (and IV?) initialisation and elsewhere?
CvOUTSIDE for ordinary subs
DATA filehandle for standalone Bytecode program (easy)
DATA filehandle for multiple bytecode-compiled modules (harder)
DATA filehandle for C-compiled program (yet harder)
* Features
type checking: Devel::TypeCheck
compile time v. runtime initialisation
save PMOPs in compiled form
selection of what to dump
options for cutting out line info (COP elimination) etc.
comment output
shared constants
check module dependencies, vs. link libs static, not via DynaLoader
new Asm, JIT or PIR backend, PLJC ByteLoader magic
check Bytecode op coverage in the tests, should cover all ops 0-142
Disassembler should print the header
ByteLoader compatibility: version, platform. eventually Bytecode version portability
* Optimisations
collect static strings beforehand, such as GvNAMEs, COP FILENAME (for pre 5.10)
and GV method names package::name.
proper static init of PMOP SV's (only works dynamic >= 5.10)
collapse LISTOPs to UNOPs or BASEOPs
compile-time qw(), constant subs
global analysis of variables, type hints etc.
Devel::TypeCheck instead of magic variable _ir, ... suffices
e.g. mark IVonly SV's and magic/flags change functions and
optimize all op subtrees for the compiled backends to use direct ints
demand-loaded bytecode (leader of each basic block replaced by an op
which loads in bytecode for its block)
fast sub calls for CC backend