This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
potential [PATCH] Tru64 crank up strictness
[perl5.git] / ext / B / B / Asmdata.pm
CommitLineData
a798dbf2 1#
a6c40364 2# Copyright (c) 1996-1999 Malcolm Beattie
a798dbf2
MB
3#
4# You may distribute under the terms of either the GNU General Public
5# License or the Artistic License, as specified in the README file.
6#
7#
8#
9# This file is autogenerated from bytecode.pl. Changes made here will be lost.
10#
11package B::Asmdata;
28b605d8 12
a0edd7f8 13our $VERSION = '1.01';
28b605d8 14
a798dbf2
MB
15use Exporter;
16@ISA = qw(Exporter);
17@EXPORT_OK = qw(%insn_data @insn_name @optype @specialsv_name);
17f410f9 18our(%insn_data, @insn_name, @optype, @specialsv_name);
a798dbf2 19
7934575e 20@optype = qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP PADOP PVOP LOOP COP);
059a8bb7 21@specialsv_name = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no pWARN_ALL pWARN_NONE);
a798dbf2
MB
22
23# XXX insn_data is initialised this way because with a large
24# %insn_data = (foo => [...], bar => [...], ...) initialiser
25# I get a hard-to-track-down stack underflow and segfault.
ca04da08 26$insn_data{comment} = [35, \&PUT_comment_t, "GET_comment_t"];
a798dbf2
MB
27$insn_data{nop} = [10, \&PUT_none, "GET_none"];
28$insn_data{ret} = [0, \&PUT_none, "GET_none"];
ca04da08
GS
29$insn_data{ldsv} = [1, \&PUT_svindex, "GET_svindex"];
30$insn_data{ldop} = [2, \&PUT_opindex, "GET_opindex"];
a798dbf2
MB
31$insn_data{stsv} = [3, \&PUT_U32, "GET_U32"];
32$insn_data{stop} = [4, \&PUT_U32, "GET_U32"];
059a8bb7
JH
33$insn_data{stpv} = [5, \&PUT_U32, "GET_U32"];
34$insn_data{ldspecsv} = [6, \&PUT_U8, "GET_U8"];
566ece03
JH
35$insn_data{ldspecsvx} = [7, \&PUT_U8, "GET_U8"];
36$insn_data{newsv} = [8, \&PUT_U8, "GET_U8"];
37$insn_data{newsvx} = [9, \&PUT_U32, "GET_U32"];
38$insn_data{newop} = [11, \&PUT_U8, "GET_U8"];
39$insn_data{newopx} = [12, \&PUT_U16, "GET_U16"];
40$insn_data{newopn} = [13, \&PUT_U8, "GET_U8"];
41$insn_data{newpv} = [14, \&PUT_PV, "GET_PV"];
113d5bd9 42$insn_data{pv_cur} = [15, \&PUT_PADOFFSET, "GET_PADOFFSET"];
566ece03
JH
43$insn_data{pv_free} = [16, \&PUT_none, "GET_none"];
44$insn_data{sv_upgrade} = [17, \&PUT_U8, "GET_U8"];
45$insn_data{sv_refcnt} = [18, \&PUT_U32, "GET_U32"];
46$insn_data{sv_refcnt_add} = [19, \&PUT_I32, "GET_I32"];
47$insn_data{sv_flags} = [20, \&PUT_U32, "GET_U32"];
48$insn_data{xrv} = [21, \&PUT_svindex, "GET_svindex"];
49$insn_data{xpv} = [22, \&PUT_none, "GET_none"];
113d5bd9
JH
50$insn_data{xpv_cur} = [23, \&PUT_PADOFFSET, "GET_PADOFFSET"];
51$insn_data{xpv_len} = [24, \&PUT_PADOFFSET, "GET_PADOFFSET"];
566ece03
JH
52$insn_data{xiv} = [25, \&PUT_IV, "GET_IV"];
53$insn_data{xnv} = [26, \&PUT_NV, "GET_NV"];
113d5bd9
JH
54$insn_data{xlv_targoff} = [27, \&PUT_PADOFFSET, "GET_PADOFFSET"];
55$insn_data{xlv_targlen} = [28, \&PUT_PADOFFSET, "GET_PADOFFSET"];
566ece03
JH
56$insn_data{xlv_targ} = [29, \&PUT_svindex, "GET_svindex"];
57$insn_data{xlv_type} = [30, \&PUT_U8, "GET_U8"];
58$insn_data{xbm_useful} = [31, \&PUT_I32, "GET_I32"];
59$insn_data{xbm_previous} = [32, \&PUT_U16, "GET_U16"];
60$insn_data{xbm_rare} = [33, \&PUT_U8, "GET_U8"];
61$insn_data{xfm_lines} = [34, \&PUT_IV, "GET_IV"];
62$insn_data{xio_lines} = [36, \&PUT_IV, "GET_IV"];
63$insn_data{xio_page} = [37, \&PUT_IV, "GET_IV"];
64$insn_data{xio_page_len} = [38, \&PUT_IV, "GET_IV"];
65$insn_data{xio_lines_left} = [39, \&PUT_IV, "GET_IV"];
66$insn_data{xio_top_name} = [40, \&PUT_pvindex, "GET_pvindex"];
67$insn_data{xio_top_gv} = [41, \&PUT_svindex, "GET_svindex"];
68$insn_data{xio_fmt_name} = [42, \&PUT_pvindex, "GET_pvindex"];
69$insn_data{xio_fmt_gv} = [43, \&PUT_svindex, "GET_svindex"];
70$insn_data{xio_bottom_name} = [44, \&PUT_pvindex, "GET_pvindex"];
71$insn_data{xio_bottom_gv} = [45, \&PUT_svindex, "GET_svindex"];
72$insn_data{xio_subprocess} = [46, \&PUT_U16, "GET_U16"];
73$insn_data{xio_type} = [47, \&PUT_U8, "GET_U8"];
74$insn_data{xio_flags} = [48, \&PUT_U8, "GET_U8"];
75$insn_data{xcv_xsubany} = [49, \&PUT_svindex, "GET_svindex"];
76$insn_data{xcv_stash} = [50, \&PUT_svindex, "GET_svindex"];
77$insn_data{xcv_start} = [51, \&PUT_opindex, "GET_opindex"];
78$insn_data{xcv_root} = [52, \&PUT_opindex, "GET_opindex"];
79$insn_data{xcv_gv} = [53, \&PUT_svindex, "GET_svindex"];
80$insn_data{xcv_file} = [54, \&PUT_pvindex, "GET_pvindex"];
113d5bd9 81$insn_data{xcv_depth} = [55, \&PUT_long, "GET_long"];
566ece03
JH
82$insn_data{xcv_padlist} = [56, \&PUT_svindex, "GET_svindex"];
83$insn_data{xcv_outside} = [57, \&PUT_svindex, "GET_svindex"];
84$insn_data{xcv_outside_seq} = [58, \&PUT_U32, "GET_U32"];
85$insn_data{xcv_flags} = [59, \&PUT_U16, "GET_U16"];
113d5bd9 86$insn_data{av_extend} = [60, \&PUT_PADOFFSET, "GET_PADOFFSET"];
566ece03
JH
87$insn_data{av_pushx} = [61, \&PUT_svindex, "GET_svindex"];
88$insn_data{av_push} = [62, \&PUT_svindex, "GET_svindex"];
113d5bd9
JH
89$insn_data{xav_fill} = [63, \&PUT_PADOFFSET, "GET_PADOFFSET"];
90$insn_data{xav_max} = [64, \&PUT_PADOFFSET, "GET_PADOFFSET"];
566ece03
JH
91$insn_data{xav_flags} = [65, \&PUT_U8, "GET_U8"];
92$insn_data{xhv_riter} = [66, \&PUT_I32, "GET_I32"];
93$insn_data{xhv_name} = [67, \&PUT_pvindex, "GET_pvindex"];
94$insn_data{xhv_pmroot} = [68, \&PUT_opindex, "GET_opindex"];
95$insn_data{hv_store} = [69, \&PUT_svindex, "GET_svindex"];
96$insn_data{sv_magic} = [70, \&PUT_U8, "GET_U8"];
97$insn_data{mg_obj} = [71, \&PUT_svindex, "GET_svindex"];
98$insn_data{mg_private} = [72, \&PUT_U16, "GET_U16"];
99$insn_data{mg_flags} = [73, \&PUT_U8, "GET_U8"];
100$insn_data{mg_name} = [74, \&PUT_pvcontents, "GET_pvcontents"];
101$insn_data{mg_namex} = [75, \&PUT_svindex, "GET_svindex"];
102$insn_data{xmg_stash} = [76, \&PUT_svindex, "GET_svindex"];
103$insn_data{gv_fetchpv} = [77, \&PUT_strconst, "GET_strconst"];
104$insn_data{gv_fetchpvx} = [78, \&PUT_strconst, "GET_strconst"];
105$insn_data{gv_stashpv} = [79, \&PUT_strconst, "GET_strconst"];
106$insn_data{gv_stashpvx} = [80, \&PUT_strconst, "GET_strconst"];
107$insn_data{gp_sv} = [81, \&PUT_svindex, "GET_svindex"];
108$insn_data{gp_refcnt} = [82, \&PUT_U32, "GET_U32"];
109$insn_data{gp_refcnt_add} = [83, \&PUT_I32, "GET_I32"];
110$insn_data{gp_av} = [84, \&PUT_svindex, "GET_svindex"];
111$insn_data{gp_hv} = [85, \&PUT_svindex, "GET_svindex"];
112$insn_data{gp_cv} = [86, \&PUT_svindex, "GET_svindex"];
113$insn_data{gp_file} = [87, \&PUT_pvindex, "GET_pvindex"];
114$insn_data{gp_io} = [88, \&PUT_svindex, "GET_svindex"];
115$insn_data{gp_form} = [89, \&PUT_svindex, "GET_svindex"];
116$insn_data{gp_cvgen} = [90, \&PUT_U32, "GET_U32"];
117$insn_data{gp_line} = [91, \&PUT_U32, "GET_U32"];
118$insn_data{gp_share} = [92, \&PUT_svindex, "GET_svindex"];
119$insn_data{xgv_flags} = [93, \&PUT_U8, "GET_U8"];
120$insn_data{op_next} = [94, \&PUT_opindex, "GET_opindex"];
121$insn_data{op_sibling} = [95, \&PUT_opindex, "GET_opindex"];
122$insn_data{op_ppaddr} = [96, \&PUT_strconst, "GET_strconst"];
ca337316 123$insn_data{op_targ} = [97, \&PUT_PADOFFSET, "GET_PADOFFSET"];
566ece03 124$insn_data{op_type} = [98, \&PUT_U16, "GET_U16"];
2814eb74
PJ
125$insn_data{op_opt} = [99, \&PUT_U8, "GET_U8"];
126$insn_data{op_static} = [100, \&PUT_U8, "GET_U8"];
127$insn_data{op_flags} = [101, \&PUT_U8, "GET_U8"];
128$insn_data{op_private} = [102, \&PUT_U8, "GET_U8"];
129$insn_data{op_first} = [103, \&PUT_opindex, "GET_opindex"];
130$insn_data{op_last} = [104, \&PUT_opindex, "GET_opindex"];
131$insn_data{op_other} = [105, \&PUT_opindex, "GET_opindex"];
132$insn_data{op_pmreplroot} = [106, \&PUT_opindex, "GET_opindex"];
133$insn_data{op_pmreplstart} = [107, \&PUT_opindex, "GET_opindex"];
134$insn_data{op_pmnext} = [108, \&PUT_opindex, "GET_opindex"];
135$insn_data{op_pmstashpv} = [109, \&PUT_pvindex, "GET_pvindex"];
136$insn_data{op_pmreplrootpo} = [110, \&PUT_PADOFFSET, "GET_PADOFFSET"];
137$insn_data{op_pmstash} = [111, \&PUT_svindex, "GET_svindex"];
138$insn_data{op_pmreplrootgv} = [112, \&PUT_svindex, "GET_svindex"];
139$insn_data{pregcomp} = [113, \&PUT_pvcontents, "GET_pvcontents"];
140$insn_data{op_pmflags} = [114, \&PUT_U16, "GET_U16"];
141$insn_data{op_pmpermflags} = [115, \&PUT_U16, "GET_U16"];
142$insn_data{op_pmdynflags} = [116, \&PUT_U8, "GET_U8"];
143$insn_data{op_sv} = [117, \&PUT_svindex, "GET_svindex"];
144$insn_data{op_padix} = [118, \&PUT_PADOFFSET, "GET_PADOFFSET"];
145$insn_data{op_pv} = [119, \&PUT_pvcontents, "GET_pvcontents"];
146$insn_data{op_pv_tr} = [120, \&PUT_op_tr_array, "GET_op_tr_array"];
147$insn_data{op_redoop} = [121, \&PUT_opindex, "GET_opindex"];
148$insn_data{op_nextop} = [122, \&PUT_opindex, "GET_opindex"];
149$insn_data{op_lastop} = [123, \&PUT_opindex, "GET_opindex"];
150$insn_data{cop_label} = [124, \&PUT_pvindex, "GET_pvindex"];
151$insn_data{cop_stashpv} = [125, \&PUT_pvindex, "GET_pvindex"];
152$insn_data{cop_file} = [126, \&PUT_pvindex, "GET_pvindex"];
153$insn_data{cop_stash} = [127, \&PUT_svindex, "GET_svindex"];
154$insn_data{cop_filegv} = [128, \&PUT_svindex, "GET_svindex"];
155$insn_data{cop_seq} = [129, \&PUT_U32, "GET_U32"];
156$insn_data{cop_arybase} = [130, \&PUT_I32, "GET_I32"];
157$insn_data{cop_line} = [131, \&PUT_U32, "GET_U32"];
158$insn_data{cop_io} = [132, \&PUT_svindex, "GET_svindex"];
159$insn_data{cop_warnings} = [133, \&PUT_svindex, "GET_svindex"];
160$insn_data{main_start} = [134, \&PUT_opindex, "GET_opindex"];
161$insn_data{main_root} = [135, \&PUT_opindex, "GET_opindex"];
162$insn_data{main_cv} = [136, \&PUT_svindex, "GET_svindex"];
163$insn_data{curpad} = [137, \&PUT_svindex, "GET_svindex"];
164$insn_data{push_begin} = [138, \&PUT_svindex, "GET_svindex"];
165$insn_data{push_init} = [139, \&PUT_svindex, "GET_svindex"];
166$insn_data{push_end} = [140, \&PUT_svindex, "GET_svindex"];
167$insn_data{curstash} = [141, \&PUT_svindex, "GET_svindex"];
168$insn_data{defstash} = [142, \&PUT_svindex, "GET_svindex"];
169$insn_data{data} = [143, \&PUT_U8, "GET_U8"];
170$insn_data{incav} = [144, \&PUT_svindex, "GET_svindex"];
171$insn_data{load_glob} = [145, \&PUT_svindex, "GET_svindex"];
172$insn_data{regex_padav} = [146, \&PUT_svindex, "GET_svindex"];
173$insn_data{dowarn} = [147, \&PUT_U8, "GET_U8"];
174$insn_data{comppad_name} = [148, \&PUT_svindex, "GET_svindex"];
175$insn_data{xgv_stash} = [149, \&PUT_svindex, "GET_svindex"];
176$insn_data{signal} = [150, \&PUT_strconst, "GET_strconst"];
177$insn_data{formfeed} = [151, \&PUT_svindex, "GET_svindex"];
a798dbf2
MB
178
179my ($insn_name, $insn_data);
180while (($insn_name, $insn_data) = each %insn_data) {
181 $insn_name[$insn_data->[0]] = $insn_name;
182}
183# Fill in any gaps
184@insn_name = map($_ || "unused", @insn_name);
185
1861;
42d3a99d
GS
187
188__END__
189
190=head1 NAME
191
192B::Asmdata - Autogenerated data about Perl ops, used to generate bytecode
193
194=head1 SYNOPSIS
195
4162ffa6 196 use B::Asmdata qw(%insn_data @insn_name @optype @specialsv_name);
42d3a99d
GS
197
198=head1 DESCRIPTION
199
4162ffa6
MS
200Provides information about Perl ops in order to generate bytecode via
201a bunch of exported variables. Its mostly used by B::Assembler and
202B::Disassembler.
203
204=over 4
205
206=item %insn_data
207
208 my($bytecode_num, $put_sub, $get_meth) = @$insn_data{$op_name};
209
210For a given $op_name (for example, 'cop_label', 'sv_flags', etc...)
211you get an array ref containing the bytecode number of the op, a
212reference to the subroutine used to 'PUT', and the name of the method
213used to 'GET'.
214
215=for _private
216Add more detail about what $put_sub and $get_meth are and how to use them.
217
218=item @insn_name
219
220 my $op_name = $insn_name[$bytecode_num];
221
222A simple mapping of the bytecode number to the name of the op.
223Suitable for using with %insn_data like so:
224
225 my $op_info = $insn_data{$insn_name[$bytecode_num]};
226
227=item @optype
228
229 my $op_type = $optype[$op_type_num];
230
231A simple mapping of the op type number to its type (like 'COP' or 'BINOP').
232
233=item @specialsv_name
234
235 my $sv_name = $specialsv_name[$sv_index];
236
237Certain SV types are considered 'special'. They're represented by
238B::SPECIAL and are refered to by a number from the specialsv_list.
239This array maps that number back to the name of the SV (like 'Nullsv'
240or '&PL_sv_undef').
241
242=back
42d3a99d
GS
243
244=head1 AUTHOR
245
246Malcolm Beattie, C<mbeattie@sable.ox.ac.uk>
247
248=cut