| 1 |
|
| /* This file is automatically generated by tool/opcode.PL. |
| 2 |
|
| * ANY CHANGES WILL BE LOST! |
| 3 |
|
| */ |
| 4 |
|
| |
| 5 |
|
| /* forward decl for Xslate opcodes */ |
| 6 |
|
| TXC(noop); |
| 7 |
|
| TXC(move_to_sb); |
| 8 |
|
| TXC(move_from_sb); |
| 9 |
|
| TXC_w_var(save_to_lvar); |
| 10 |
|
| TXC_w_var(load_lvar); |
| 11 |
|
| TXC_w_var(load_lvar_to_sb); |
| 12 |
|
| TXC_w_key(localize_s); |
| 13 |
|
| TXC(localize_vars); |
| 14 |
|
| TXC(push); |
| 15 |
|
| TXC(pushmark); |
| 16 |
|
| TXC(nil); |
| 17 |
|
| TXC_w_sv(literal); |
| 18 |
|
| TXC_w_sviv(literal_i); |
| 19 |
|
| TXC_w_key(fetch_s); /* fetch a field from the top */ |
| 20 |
|
| TXC(fetch_field); /* fetch a field from a variable (bin operator) */ |
| 21 |
|
| TXC_w_key(fetch_field_s); /* fetch a field from a variable (for literal) */ |
| 22 |
|
| TXC(print); |
| 23 |
|
| TXC(print_raw); |
| 24 |
|
| TXC_w_sv(print_raw_s); |
| 25 |
|
| TXC(include); |
| 26 |
|
| TXC(find_file); |
| 27 |
|
| TXC(suffix); |
| 28 |
|
| TXC_w_var(for_start); |
| 29 |
|
| TXC_goto(for_iter); |
| 30 |
|
| TXC(add); |
| 31 |
|
| TXC(sub); |
| 32 |
|
| TXC(mul); |
| 33 |
|
| TXC(div); |
| 34 |
|
| TXC(mod); |
| 35 |
|
| TXC_w_sv(concat); |
| 36 |
|
| TXC_w_sv(repeat); |
| 37 |
|
| TXC(bitor); |
| 38 |
|
| TXC(bitand); |
| 39 |
|
| TXC(bitxor); |
| 40 |
|
| TXC(bitneg); |
| 41 |
|
| TXC_goto(and); |
| 42 |
|
| TXC_goto(dand); |
| 43 |
|
| TXC_goto(or); |
| 44 |
|
| TXC_goto(dor); |
| 45 |
|
| TXC(not); |
| 46 |
|
| TXC(minus); /* unary minus */ |
| 47 |
|
| TXC(max_index); |
| 48 |
|
| TXC(builtin_mark_raw); |
| 49 |
|
| TXC(builtin_unmark_raw); |
| 50 |
|
| TXC(builtin_uri_escape); |
| 51 |
|
| TXC(builtin_is_array_ref); |
| 52 |
|
| TXC(builtin_is_hash_ref); |
| 53 |
|
| TXC(builtin_html_escape); |
| 54 |
|
| TXC(is_code_ref); |
| 55 |
|
| TXC(merge_hash); |
| 56 |
|
| TXC(match); |
| 57 |
|
| TXC(eq); |
| 58 |
|
| TXC(ne); |
| 59 |
|
| TXC(lt); |
| 60 |
|
| TXC(le); |
| 61 |
|
| TXC(gt); |
| 62 |
|
| TXC(ge); |
| 63 |
|
| TXC(ncmp); |
| 64 |
|
| TXC(scmp); |
| 65 |
|
| TXC(range); |
| 66 |
|
| TXC_w_key(fetch_symbol); /* functions, macros, constants */ |
| 67 |
|
| TXC(funcall); /* call a function or a macro */ |
| 68 |
|
| TXC(macro_end); |
| 69 |
|
| TXC_w_key(methodcall_s); |
| 70 |
|
| TXC(make_array); |
| 71 |
|
| TXC(make_hash); |
| 72 |
|
| TXC(enter); |
| 73 |
|
| TXC(leave); |
| 74 |
|
| TXC_goto(goto); |
| 75 |
|
| TXC(vars); |
| 76 |
|
| TXC_w_sv(depend); /* tell the vm to dependent template files */ |
| 77 |
|
| TXC_w_key(macro_begin); |
| 78 |
|
| TXC_w_sviv(macro_nargs); |
| 79 |
|
| TXC_w_sviv(macro_outer); |
| 80 |
|
| TXC(set_opinfo); |
| 81 |
|
| TXC(super); |
| 82 |
|
| TXC(end); |
| 83 |
|
| |
| 84 |
|
| enum tx_opcode_t { |
| 85 |
|
| TXOP_noop, /* 0 */ |
| 86 |
|
| TXOP_move_to_sb, /* 1 */ |
| 87 |
|
| TXOP_move_from_sb, /* 2 */ |
| 88 |
|
| TXOP_save_to_lvar, /* 3 */ |
| 89 |
|
| TXOP_load_lvar, /* 4 */ |
| 90 |
|
| TXOP_load_lvar_to_sb, /* 5 */ |
| 91 |
|
| TXOP_localize_s, /* 6 */ |
| 92 |
|
| TXOP_localize_vars, /* 7 */ |
| 93 |
|
| TXOP_push, /* 8 */ |
| 94 |
|
| TXOP_pushmark, /* 9 */ |
| 95 |
|
| TXOP_nil, /* 10 */ |
| 96 |
|
| TXOP_literal, /* 11 */ |
| 97 |
|
| TXOP_literal_i, /* 12 */ |
| 98 |
|
| TXOP_fetch_s, /* 13 */ |
| 99 |
|
| TXOP_fetch_field, /* 14 */ |
| 100 |
|
| TXOP_fetch_field_s, /* 15 */ |
| 101 |
|
| TXOP_print, /* 16 */ |
| 102 |
|
| TXOP_print_raw, /* 17 */ |
| 103 |
|
| TXOP_print_raw_s, /* 18 */ |
| 104 |
|
| TXOP_include, /* 19 */ |
| 105 |
|
| TXOP_find_file, /* 20 */ |
| 106 |
|
| TXOP_suffix, /* 21 */ |
| 107 |
|
| TXOP_for_start, /* 22 */ |
| 108 |
|
| TXOP_for_iter, /* 23 */ |
| 109 |
|
| TXOP_add, /* 24 */ |
| 110 |
|
| TXOP_sub, /* 25 */ |
| 111 |
|
| TXOP_mul, /* 26 */ |
| 112 |
|
| TXOP_div, /* 27 */ |
| 113 |
|
| TXOP_mod, /* 28 */ |
| 114 |
|
| TXOP_concat, /* 29 */ |
| 115 |
|
| TXOP_repeat, /* 30 */ |
| 116 |
|
| TXOP_bitor, /* 31 */ |
| 117 |
|
| TXOP_bitand, /* 32 */ |
| 118 |
|
| TXOP_bitxor, /* 33 */ |
| 119 |
|
| TXOP_bitneg, /* 34 */ |
| 120 |
|
| TXOP_and, /* 35 */ |
| 121 |
|
| TXOP_dand, /* 36 */ |
| 122 |
|
| TXOP_or, /* 37 */ |
| 123 |
|
| TXOP_dor, /* 38 */ |
| 124 |
|
| TXOP_not, /* 39 */ |
| 125 |
|
| TXOP_minus, /* 40 */ |
| 126 |
|
| TXOP_max_index, /* 41 */ |
| 127 |
|
| TXOP_builtin_mark_raw, /* 42 */ |
| 128 |
|
| TXOP_builtin_unmark_raw, /* 43 */ |
| 129 |
|
| TXOP_builtin_uri_escape, /* 44 */ |
| 130 |
|
| TXOP_builtin_is_array_ref, /* 45 */ |
| 131 |
|
| TXOP_builtin_is_hash_ref, /* 46 */ |
| 132 |
|
| TXOP_builtin_html_escape, /* 47 */ |
| 133 |
|
| TXOP_is_code_ref, /* 48 */ |
| 134 |
|
| TXOP_merge_hash, /* 49 */ |
| 135 |
|
| TXOP_match, /* 50 */ |
| 136 |
|
| TXOP_eq, /* 51 */ |
| 137 |
|
| TXOP_ne, /* 52 */ |
| 138 |
|
| TXOP_lt, /* 53 */ |
| 139 |
|
| TXOP_le, /* 54 */ |
| 140 |
|
| TXOP_gt, /* 55 */ |
| 141 |
|
| TXOP_ge, /* 56 */ |
| 142 |
|
| TXOP_ncmp, /* 57 */ |
| 143 |
|
| TXOP_scmp, /* 58 */ |
| 144 |
|
| TXOP_range, /* 59 */ |
| 145 |
|
| TXOP_fetch_symbol, /* 60 */ |
| 146 |
|
| TXOP_funcall, /* 61 */ |
| 147 |
|
| TXOP_macro_end, /* 62 */ |
| 148 |
|
| TXOP_methodcall_s, /* 63 */ |
| 149 |
|
| TXOP_make_array, /* 64 */ |
| 150 |
|
| TXOP_make_hash, /* 65 */ |
| 151 |
|
| TXOP_enter, /* 66 */ |
| 152 |
|
| TXOP_leave, /* 67 */ |
| 153 |
|
| TXOP_goto, /* 68 */ |
| 154 |
|
| TXOP_vars, /* 69 */ |
| 155 |
|
| TXOP_depend, /* 70 */ |
| 156 |
|
| TXOP_macro_begin, /* 71 */ |
| 157 |
|
| TXOP_macro_nargs, /* 72 */ |
| 158 |
|
| TXOP_macro_outer, /* 73 */ |
| 159 |
|
| TXOP_set_opinfo, /* 74 */ |
| 160 |
|
| TXOP_super, /* 75 */ |
| 161 |
|
| TXOP_end, /* 76 */ |
| 162 |
|
| TXOP_last |
| 163 |
|
| }; /* enum tx_opcode_t */ |
| 164 |
|
| |
| 165 |
|
| static const U8 tx_oparg[] = { |
| 166 |
|
| 0U, /* noop */ |
| 167 |
|
| 0U, /* move_to_sb */ |
| 168 |
|
| 0U, /* move_from_sb */ |
| 169 |
|
| TXCODE_W_VAR, /* save_to_lvar */ |
| 170 |
|
| TXCODE_W_VAR, /* load_lvar */ |
| 171 |
|
| TXCODE_W_VAR, /* load_lvar_to_sb */ |
| 172 |
|
| TXCODE_W_KEY, /* localize_s */ |
| 173 |
|
| 0U, /* localize_vars */ |
| 174 |
|
| 0U, /* push */ |
| 175 |
|
| 0U, /* pushmark */ |
| 176 |
|
| 0U, /* nil */ |
| 177 |
|
| TXCODE_W_SV, /* literal */ |
| 178 |
|
| TXCODE_W_SVIV, /* literal_i */ |
| 179 |
|
| TXCODE_W_KEY, /* fetch_s */ |
| 180 |
|
| 0U, /* fetch_field */ |
| 181 |
|
| TXCODE_W_KEY, /* fetch_field_s */ |
| 182 |
|
| 0U, /* print */ |
| 183 |
|
| 0U, /* print_raw */ |
| 184 |
|
| TXCODE_W_SV, /* print_raw_s */ |
| 185 |
|
| 0U, /* include */ |
| 186 |
|
| 0U, /* find_file */ |
| 187 |
|
| 0U, /* suffix */ |
| 188 |
|
| TXCODE_W_VAR, /* for_start */ |
| 189 |
|
| TXCODE_GOTO, /* for_iter */ |
| 190 |
|
| 0U, /* add */ |
| 191 |
|
| 0U, /* sub */ |
| 192 |
|
| 0U, /* mul */ |
| 193 |
|
| 0U, /* div */ |
| 194 |
|
| 0U, /* mod */ |
| 195 |
|
| TXCODE_W_SV, /* concat */ |
| 196 |
|
| TXCODE_W_SV, /* repeat */ |
| 197 |
|
| 0U, /* bitor */ |
| 198 |
|
| 0U, /* bitand */ |
| 199 |
|
| 0U, /* bitxor */ |
| 200 |
|
| 0U, /* bitneg */ |
| 201 |
|
| TXCODE_GOTO, /* and */ |
| 202 |
|
| TXCODE_GOTO, /* dand */ |
| 203 |
|
| TXCODE_GOTO, /* or */ |
| 204 |
|
| TXCODE_GOTO, /* dor */ |
| 205 |
|
| 0U, /* not */ |
| 206 |
|
| 0U, /* minus */ |
| 207 |
|
| 0U, /* max_index */ |
| 208 |
|
| 0U, /* builtin_mark_raw */ |
| 209 |
|
| 0U, /* builtin_unmark_raw */ |
| 210 |
|
| 0U, /* builtin_uri_escape */ |
| 211 |
|
| 0U, /* builtin_is_array_ref */ |
| 212 |
|
| 0U, /* builtin_is_hash_ref */ |
| 213 |
|
| 0U, /* builtin_html_escape */ |
| 214 |
|
| 0U, /* is_code_ref */ |
| 215 |
|
| 0U, /* merge_hash */ |
| 216 |
|
| 0U, /* match */ |
| 217 |
|
| 0U, /* eq */ |
| 218 |
|
| 0U, /* ne */ |
| 219 |
|
| 0U, /* lt */ |
| 220 |
|
| 0U, /* le */ |
| 221 |
|
| 0U, /* gt */ |
| 222 |
|
| 0U, /* ge */ |
| 223 |
|
| 0U, /* ncmp */ |
| 224 |
|
| 0U, /* scmp */ |
| 225 |
|
| 0U, /* range */ |
| 226 |
|
| TXCODE_W_KEY, /* fetch_symbol */ |
| 227 |
|
| 0U, /* funcall */ |
| 228 |
|
| 0U, /* macro_end */ |
| 229 |
|
| TXCODE_W_KEY, /* methodcall_s */ |
| 230 |
|
| 0U, /* make_array */ |
| 231 |
|
| 0U, /* make_hash */ |
| 232 |
|
| 0U, /* enter */ |
| 233 |
|
| 0U, /* leave */ |
| 234 |
|
| TXCODE_GOTO, /* goto */ |
| 235 |
|
| 0U, /* vars */ |
| 236 |
|
| TXCODE_W_SV, /* depend */ |
| 237 |
|
| TXCODE_W_KEY, /* macro_begin */ |
| 238 |
|
| TXCODE_W_SVIV, /* macro_nargs */ |
| 239 |
|
| TXCODE_W_SVIV, /* macro_outer */ |
| 240 |
|
| 0U, /* set_opinfo */ |
| 241 |
|
| 0U, /* super */ |
| 242 |
|
| 0U, /* end */ |
| 243 |
|
| }; /* tx_oparg[] */ |
| 244 |
|
| |
| 245 |
|
| static void |
| 246 |
188 |
| tx_init_ops(pTHX_ HV* const ops) { |
| 247 |
188 |
| (void)hv_stores(ops, STRINGIFY(noop), newSViv(TXOP_noop)); |
| 248 |
188 |
| (void)hv_stores(ops, STRINGIFY(move_to_sb), newSViv(TXOP_move_to_sb)); |
| 249 |
188 |
| (void)hv_stores(ops, STRINGIFY(move_from_sb), newSViv(TXOP_move_from_sb)); |
| 250 |
188 |
| (void)hv_stores(ops, STRINGIFY(save_to_lvar), newSViv(TXOP_save_to_lvar)); |
| 251 |
188 |
| (void)hv_stores(ops, STRINGIFY(load_lvar), newSViv(TXOP_load_lvar)); |
| 252 |
188 |
| (void)hv_stores(ops, STRINGIFY(load_lvar_to_sb), newSViv(TXOP_load_lvar_to_sb)); |
| 253 |
188 |
| (void)hv_stores(ops, STRINGIFY(localize_s), newSViv(TXOP_localize_s)); |
| 254 |
188 |
| (void)hv_stores(ops, STRINGIFY(localize_vars), newSViv(TXOP_localize_vars)); |
| 255 |
188 |
| (void)hv_stores(ops, STRINGIFY(push), newSViv(TXOP_push)); |
| 256 |
188 |
| (void)hv_stores(ops, STRINGIFY(pushmark), newSViv(TXOP_pushmark)); |
| 257 |
188 |
| (void)hv_stores(ops, STRINGIFY(nil), newSViv(TXOP_nil)); |
| 258 |
188 |
| (void)hv_stores(ops, STRINGIFY(literal), newSViv(TXOP_literal)); |
| 259 |
188 |
| (void)hv_stores(ops, STRINGIFY(literal_i), newSViv(TXOP_literal_i)); |
| 260 |
188 |
| (void)hv_stores(ops, STRINGIFY(fetch_s), newSViv(TXOP_fetch_s)); |
| 261 |
188 |
| (void)hv_stores(ops, STRINGIFY(fetch_field), newSViv(TXOP_fetch_field)); |
| 262 |
188 |
| (void)hv_stores(ops, STRINGIFY(fetch_field_s), newSViv(TXOP_fetch_field_s)); |
| 263 |
188 |
| (void)hv_stores(ops, STRINGIFY(print), newSViv(TXOP_print)); |
| 264 |
188 |
| (void)hv_stores(ops, STRINGIFY(print_raw), newSViv(TXOP_print_raw)); |
| 265 |
188 |
| (void)hv_stores(ops, STRINGIFY(print_raw_s), newSViv(TXOP_print_raw_s)); |
| 266 |
188 |
| (void)hv_stores(ops, STRINGIFY(include), newSViv(TXOP_include)); |
| 267 |
188 |
| (void)hv_stores(ops, STRINGIFY(find_file), newSViv(TXOP_find_file)); |
| 268 |
188 |
| (void)hv_stores(ops, STRINGIFY(suffix), newSViv(TXOP_suffix)); |
| 269 |
188 |
| (void)hv_stores(ops, STRINGIFY(for_start), newSViv(TXOP_for_start)); |
| 270 |
188 |
| (void)hv_stores(ops, STRINGIFY(for_iter), newSViv(TXOP_for_iter)); |
| 271 |
188 |
| (void)hv_stores(ops, STRINGIFY(add), newSViv(TXOP_add)); |
| 272 |
188 |
| (void)hv_stores(ops, STRINGIFY(sub), newSViv(TXOP_sub)); |
| 273 |
188 |
| (void)hv_stores(ops, STRINGIFY(mul), newSViv(TXOP_mul)); |
| 274 |
188 |
| (void)hv_stores(ops, STRINGIFY(div), newSViv(TXOP_div)); |
| 275 |
188 |
| (void)hv_stores(ops, STRINGIFY(mod), newSViv(TXOP_mod)); |
| 276 |
188 |
| (void)hv_stores(ops, STRINGIFY(concat), newSViv(TXOP_concat)); |
| 277 |
188 |
| (void)hv_stores(ops, STRINGIFY(repeat), newSViv(TXOP_repeat)); |
| 278 |
188 |
| (void)hv_stores(ops, STRINGIFY(bitor), newSViv(TXOP_bitor)); |
| 279 |
188 |
| (void)hv_stores(ops, STRINGIFY(bitand), newSViv(TXOP_bitand)); |
| 280 |
188 |
| (void)hv_stores(ops, STRINGIFY(bitxor), newSViv(TXOP_bitxor)); |
| 281 |
188 |
| (void)hv_stores(ops, STRINGIFY(bitneg), newSViv(TXOP_bitneg)); |
| 282 |
188 |
| (void)hv_stores(ops, STRINGIFY(and), newSViv(TXOP_and)); |
| 283 |
188 |
| (void)hv_stores(ops, STRINGIFY(dand), newSViv(TXOP_dand)); |
| 284 |
188 |
| (void)hv_stores(ops, STRINGIFY(or), newSViv(TXOP_or)); |
| 285 |
188 |
| (void)hv_stores(ops, STRINGIFY(dor), newSViv(TXOP_dor)); |
| 286 |
188 |
| (void)hv_stores(ops, STRINGIFY(not), newSViv(TXOP_not)); |
| 287 |
188 |
| (void)hv_stores(ops, STRINGIFY(minus), newSViv(TXOP_minus)); |
| 288 |
188 |
| (void)hv_stores(ops, STRINGIFY(max_index), newSViv(TXOP_max_index)); |
| 289 |
188 |
| (void)hv_stores(ops, STRINGIFY(builtin_mark_raw), newSViv(TXOP_builtin_mark_raw)); |
| 290 |
188 |
| (void)hv_stores(ops, STRINGIFY(builtin_unmark_raw), newSViv(TXOP_builtin_unmark_raw)); |
| 291 |
188 |
| (void)hv_stores(ops, STRINGIFY(builtin_uri_escape), newSViv(TXOP_builtin_uri_escape)); |
| 292 |
188 |
| (void)hv_stores(ops, STRINGIFY(builtin_is_array_ref), newSViv(TXOP_builtin_is_array_ref)); |
| 293 |
188 |
| (void)hv_stores(ops, STRINGIFY(builtin_is_hash_ref), newSViv(TXOP_builtin_is_hash_ref)); |
| 294 |
188 |
| (void)hv_stores(ops, STRINGIFY(builtin_html_escape), newSViv(TXOP_builtin_html_escape)); |
| 295 |
188 |
| (void)hv_stores(ops, STRINGIFY(is_code_ref), newSViv(TXOP_is_code_ref)); |
| 296 |
188 |
| (void)hv_stores(ops, STRINGIFY(merge_hash), newSViv(TXOP_merge_hash)); |
| 297 |
188 |
| (void)hv_stores(ops, STRINGIFY(match), newSViv(TXOP_match)); |
| 298 |
188 |
| (void)hv_stores(ops, STRINGIFY(eq), newSViv(TXOP_eq)); |
| 299 |
188 |
| (void)hv_stores(ops, STRINGIFY(ne), newSViv(TXOP_ne)); |
| 300 |
188 |
| (void)hv_stores(ops, STRINGIFY(lt), newSViv(TXOP_lt)); |
| 301 |
188 |
| (void)hv_stores(ops, STRINGIFY(le), newSViv(TXOP_le)); |
| 302 |
188 |
| (void)hv_stores(ops, STRINGIFY(gt), newSViv(TXOP_gt)); |
| 303 |
188 |
| (void)hv_stores(ops, STRINGIFY(ge), newSViv(TXOP_ge)); |
| 304 |
188 |
| (void)hv_stores(ops, STRINGIFY(ncmp), newSViv(TXOP_ncmp)); |
| 305 |
188 |
| (void)hv_stores(ops, STRINGIFY(scmp), newSViv(TXOP_scmp)); |
| 306 |
188 |
| (void)hv_stores(ops, STRINGIFY(range), newSViv(TXOP_range)); |
| 307 |
188 |
| (void)hv_stores(ops, STRINGIFY(fetch_symbol), newSViv(TXOP_fetch_symbol)); |
| 308 |
188 |
| (void)hv_stores(ops, STRINGIFY(funcall), newSViv(TXOP_funcall)); |
| 309 |
188 |
| (void)hv_stores(ops, STRINGIFY(macro_end), newSViv(TXOP_macro_end)); |
| 310 |
188 |
| (void)hv_stores(ops, STRINGIFY(methodcall_s), newSViv(TXOP_methodcall_s)); |
| 311 |
188 |
| (void)hv_stores(ops, STRINGIFY(make_array), newSViv(TXOP_make_array)); |
| 312 |
188 |
| (void)hv_stores(ops, STRINGIFY(make_hash), newSViv(TXOP_make_hash)); |
| 313 |
188 |
| (void)hv_stores(ops, STRINGIFY(enter), newSViv(TXOP_enter)); |
| 314 |
188 |
| (void)hv_stores(ops, STRINGIFY(leave), newSViv(TXOP_leave)); |
| 315 |
188 |
| (void)hv_stores(ops, STRINGIFY(goto), newSViv(TXOP_goto)); |
| 316 |
188 |
| (void)hv_stores(ops, STRINGIFY(vars), newSViv(TXOP_vars)); |
| 317 |
188 |
| (void)hv_stores(ops, STRINGIFY(depend), newSViv(TXOP_depend)); |
| 318 |
188 |
| (void)hv_stores(ops, STRINGIFY(macro_begin), newSViv(TXOP_macro_begin)); |
| 319 |
188 |
| (void)hv_stores(ops, STRINGIFY(macro_nargs), newSViv(TXOP_macro_nargs)); |
| 320 |
188 |
| (void)hv_stores(ops, STRINGIFY(macro_outer), newSViv(TXOP_macro_outer)); |
| 321 |
188 |
| (void)hv_stores(ops, STRINGIFY(set_opinfo), newSViv(TXOP_set_opinfo)); |
| 322 |
188 |
| (void)hv_stores(ops, STRINGIFY(super), newSViv(TXOP_super)); |
| 323 |
188 |
| (void)hv_stores(ops, STRINGIFY(end), newSViv(TXOP_end)); |
| 324 |
188 |
| } /* tx_register_ops() */ |
| 325 |
|
| |
| 326 |
|
| #ifndef TX_DIRECT_THREADED_CODE |
| 327 |
|
| #define dTX_optable dNOOP |
| 328 |
|
| static const tx_exec_t tx_optable[] = { |
| 329 |
|
| TXCODE_noop, |
| 330 |
|
| TXCODE_move_to_sb, |
| 331 |
|
| TXCODE_move_from_sb, |
| 332 |
|
| TXCODE_save_to_lvar, |
| 333 |
|
| TXCODE_load_lvar, |
| 334 |
|
| TXCODE_load_lvar_to_sb, |
| 335 |
|
| TXCODE_localize_s, |
| 336 |
|
| TXCODE_localize_vars, |
| 337 |
|
| TXCODE_push, |
| 338 |
|
| TXCODE_pushmark, |
| 339 |
|
| TXCODE_nil, |
| 340 |
|
| TXCODE_literal, |
| 341 |
|
| TXCODE_literal_i, |
| 342 |
|
| TXCODE_fetch_s, |
| 343 |
|
| TXCODE_fetch_field, |
| 344 |
|
| TXCODE_fetch_field_s, |
| 345 |
|
| TXCODE_print, |
| 346 |
|
| TXCODE_print_raw, |
| 347 |
|
| TXCODE_print_raw_s, |
| 348 |
|
| TXCODE_include, |
| 349 |
|
| TXCODE_find_file, |
| 350 |
|
| TXCODE_suffix, |
| 351 |
|
| TXCODE_for_start, |
| 352 |
|
| TXCODE_for_iter, |
| 353 |
|
| TXCODE_add, |
| 354 |
|
| TXCODE_sub, |
| 355 |
|
| TXCODE_mul, |
| 356 |
|
| TXCODE_div, |
| 357 |
|
| TXCODE_mod, |
| 358 |
|
| TXCODE_concat, |
| 359 |
|
| TXCODE_repeat, |
| 360 |
|
| TXCODE_bitor, |
| 361 |
|
| TXCODE_bitand, |
| 362 |
|
| TXCODE_bitxor, |
| 363 |
|
| TXCODE_bitneg, |
| 364 |
|
| TXCODE_and, |
| 365 |
|
| TXCODE_dand, |
| 366 |
|
| TXCODE_or, |
| 367 |
|
| TXCODE_dor, |
| 368 |
|
| TXCODE_not, |
| 369 |
|
| TXCODE_minus, |
| 370 |
|
| TXCODE_max_index, |
| 371 |
|
| TXCODE_builtin_mark_raw, |
| 372 |
|
| TXCODE_builtin_unmark_raw, |
| 373 |
|
| TXCODE_builtin_uri_escape, |
| 374 |
|
| TXCODE_builtin_is_array_ref, |
| 375 |
|
| TXCODE_builtin_is_hash_ref, |
| 376 |
|
| TXCODE_builtin_html_escape, |
| 377 |
|
| TXCODE_is_code_ref, |
| 378 |
|
| TXCODE_merge_hash, |
| 379 |
|
| TXCODE_match, |
| 380 |
|
| TXCODE_eq, |
| 381 |
|
| TXCODE_ne, |
| 382 |
|
| TXCODE_lt, |
| 383 |
|
| TXCODE_le, |
| 384 |
|
| TXCODE_gt, |
| 385 |
|
| TXCODE_ge, |
| 386 |
|
| TXCODE_ncmp, |
| 387 |
|
| TXCODE_scmp, |
| 388 |
|
| TXCODE_range, |
| 389 |
|
| TXCODE_fetch_symbol, |
| 390 |
|
| TXCODE_funcall, |
| 391 |
|
| TXCODE_macro_end, |
| 392 |
|
| TXCODE_methodcall_s, |
| 393 |
|
| TXCODE_make_array, |
| 394 |
|
| TXCODE_make_hash, |
| 395 |
|
| TXCODE_enter, |
| 396 |
|
| TXCODE_leave, |
| 397 |
|
| TXCODE_goto, |
| 398 |
|
| TXCODE_vars, |
| 399 |
|
| TXCODE_depend, |
| 400 |
|
| TXCODE_macro_begin, |
| 401 |
|
| TXCODE_macro_nargs, |
| 402 |
|
| TXCODE_macro_outer, |
| 403 |
|
| TXCODE_set_opinfo, |
| 404 |
|
| TXCODE_super, |
| 405 |
|
| TXCODE_end, |
| 406 |
|
| NULL |
| 407 |
|
| }; /* tx_optable[] */ |
| 408 |
|
| |
| 409 |
|
| #else /* TX_DIRECT_THREADED_CODE */ |
| 410 |
|
| #define dTX_optable void const* const* const tx_optable \ |
| 411 |
|
| = tx_runops(aTHX_ NULL) |
| 412 |
|
| #define LABEL(x) CAT2(TX_DTC_, x) |
| 413 |
|
| #define LABEL_PTR(x) &&LABEL(x) |
| 414 |
|
| static void const* const* |
| 415 |
8693 |
| tx_runops(pTHX_ tx_state_t* const st) { |
| 416 |
|
| static const void* const ops_address_table[] = { |
| 417 |
|
| LABEL_PTR(noop), |
| 418 |
|
| LABEL_PTR(move_to_sb), |
| 419 |
|
| LABEL_PTR(move_from_sb), |
| 420 |
|
| LABEL_PTR(save_to_lvar), |
| 421 |
|
| LABEL_PTR(load_lvar), |
| 422 |
|
| LABEL_PTR(load_lvar_to_sb), |
| 423 |
|
| LABEL_PTR(localize_s), |
| 424 |
|
| LABEL_PTR(localize_vars), |
| 425 |
|
| LABEL_PTR(push), |
| 426 |
|
| LABEL_PTR(pushmark), |
| 427 |
|
| LABEL_PTR(nil), |
| 428 |
|
| LABEL_PTR(literal), |
| 429 |
|
| LABEL_PTR(literal_i), |
| 430 |
|
| LABEL_PTR(fetch_s), |
| 431 |
|
| LABEL_PTR(fetch_field), |
| 432 |
|
| LABEL_PTR(fetch_field_s), |
| 433 |
|
| LABEL_PTR(print), |
| 434 |
|
| LABEL_PTR(print_raw), |
| 435 |
|
| LABEL_PTR(print_raw_s), |
| 436 |
|
| LABEL_PTR(include), |
| 437 |
|
| LABEL_PTR(find_file), |
| 438 |
|
| LABEL_PTR(suffix), |
| 439 |
|
| LABEL_PTR(for_start), |
| 440 |
|
| LABEL_PTR(for_iter), |
| 441 |
|
| LABEL_PTR(add), |
| 442 |
|
| LABEL_PTR(sub), |
| 443 |
|
| LABEL_PTR(mul), |
| 444 |
|
| LABEL_PTR(div), |
| 445 |
|
| LABEL_PTR(mod), |
| 446 |
|
| LABEL_PTR(concat), |
| 447 |
|
| LABEL_PTR(repeat), |
| 448 |
|
| LABEL_PTR(bitor), |
| 449 |
|
| LABEL_PTR(bitand), |
| 450 |
|
| LABEL_PTR(bitxor), |
| 451 |
|
| LABEL_PTR(bitneg), |
| 452 |
|
| LABEL_PTR(and), |
| 453 |
|
| LABEL_PTR(dand), |
| 454 |
|
| LABEL_PTR(or), |
| 455 |
|
| LABEL_PTR(dor), |
| 456 |
|
| LABEL_PTR(not), |
| 457 |
|
| LABEL_PTR(minus), |
| 458 |
|
| LABEL_PTR(max_index), |
| 459 |
|
| LABEL_PTR(builtin_mark_raw), |
| 460 |
|
| LABEL_PTR(builtin_unmark_raw), |
| 461 |
|
| LABEL_PTR(builtin_uri_escape), |
| 462 |
|
| LABEL_PTR(builtin_is_array_ref), |
| 463 |
|
| LABEL_PTR(builtin_is_hash_ref), |
| 464 |
|
| LABEL_PTR(builtin_html_escape), |
| 465 |
|
| LABEL_PTR(is_code_ref), |
| 466 |
|
| LABEL_PTR(merge_hash), |
| 467 |
|
| LABEL_PTR(match), |
| 468 |
|
| LABEL_PTR(eq), |
| 469 |
|
| LABEL_PTR(ne), |
| 470 |
|
| LABEL_PTR(lt), |
| 471 |
|
| LABEL_PTR(le), |
| 472 |
|
| LABEL_PTR(gt), |
| 473 |
|
| LABEL_PTR(ge), |
| 474 |
|
| LABEL_PTR(ncmp), |
| 475 |
|
| LABEL_PTR(scmp), |
| 476 |
|
| LABEL_PTR(range), |
| 477 |
|
| LABEL_PTR(fetch_symbol), |
| 478 |
|
| LABEL_PTR(funcall), |
| 479 |
|
| LABEL_PTR(macro_end), |
| 480 |
|
| LABEL_PTR(methodcall_s), |
| 481 |
|
| LABEL_PTR(make_array), |
| 482 |
|
| LABEL_PTR(make_hash), |
| 483 |
|
| LABEL_PTR(enter), |
| 484 |
|
| LABEL_PTR(leave), |
| 485 |
|
| LABEL_PTR(goto), |
| 486 |
|
| LABEL_PTR(vars), |
| 487 |
|
| LABEL_PTR(depend), |
| 488 |
|
| LABEL_PTR(macro_begin), |
| 489 |
|
| LABEL_PTR(macro_nargs), |
| 490 |
|
| LABEL_PTR(macro_outer), |
| 491 |
|
| LABEL_PTR(set_opinfo), |
| 492 |
|
| LABEL_PTR(super), |
| 493 |
|
| LABEL_PTR(end) |
| 494 |
|
| }; /* end of ops_address_table */ |
| 495 |
8693 |
▶ | if(UNLIKELY(st == NULL)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(UNLIKELY(st == NULL)) { |
4353 |
4340 |
8693 |
|
| 496 |
4353 |
| return ops_address_table; |
| 497 |
|
| } |
| 498 |
|
| |
| 499 |
4340 |
| goto *(st->pc->exec_code); /* start */ |
| 500 |
|
| |
| 501 |
|
| /* dispatch */ |
| 502 |
1285 |
| LABEL(noop ): TXCODE_noop (aTHX_ st); goto *(st->pc->exec_code); |
| 503 |
1803 |
| LABEL(move_to_sb ): TXCODE_move_to_sb (aTHX_ st); goto *(st->pc->exec_code); |
| 504 |
66 |
| LABEL(move_from_sb ): TXCODE_move_from_sb (aTHX_ st); goto *(st->pc->exec_code); |
| 505 |
557 |
| LABEL(save_to_lvar ): TXCODE_save_to_lvar (aTHX_ st); goto *(st->pc->exec_code); |
| 506 |
2309 |
| LABEL(load_lvar ): TXCODE_load_lvar (aTHX_ st); goto *(st->pc->exec_code); |
| 507 |
272 |
| LABEL(load_lvar_to_sb ): TXCODE_load_lvar_to_sb (aTHX_ st); goto *(st->pc->exec_code); |
| 508 |
39 |
| LABEL(localize_s ): TXCODE_localize_s (aTHX_ st); goto *(st->pc->exec_code); |
| 509 |
9 |
| LABEL(localize_vars ): TXCODE_localize_vars (aTHX_ st); goto *(st->pc->exec_code); |
| 510 |
6059 |
| LABEL(push ): TXCODE_push (aTHX_ st); goto *(st->pc->exec_code); |
| 511 |
1298 |
| LABEL(pushmark ): TXCODE_pushmark (aTHX_ st); goto *(st->pc->exec_code); |
| 512 |
173 |
| LABEL(nil ): TXCODE_nil (aTHX_ st); goto *(st->pc->exec_code); |
| 513 |
6479 |
| LABEL(literal ): TXCODE_literal (aTHX_ st); goto *(st->pc->exec_code); |
| 514 |
39838986 |
| LABEL(literal_i ): TXCODE_literal_i (aTHX_ st); goto *(st->pc->exec_code); |
| 515 |
3417 |
| LABEL(fetch_s ): TXCODE_fetch_s (aTHX_ st); goto *(st->pc->exec_code); |
| 516 |
75 |
| LABEL(fetch_field ): TXCODE_fetch_field (aTHX_ st); goto *(st->pc->exec_code); |
| 517 |
1090 |
| LABEL(fetch_field_s ): TXCODE_fetch_field_s (aTHX_ st); goto *(st->pc->exec_code); |
| 518 |
4119 |
| LABEL(print ): TXCODE_print (aTHX_ st); goto *(st->pc->exec_code); |
| 519 |
181 |
| LABEL(print_raw ): TXCODE_print_raw (aTHX_ st); goto *(st->pc->exec_code); |
| 520 |
7398 |
| LABEL(print_raw_s ): TXCODE_print_raw_s (aTHX_ st); goto *(st->pc->exec_code); |
| 521 |
1246 |
| LABEL(include ): TXCODE_include (aTHX_ st); goto *(st->pc->exec_code); |
| 522 |
2 |
| LABEL(find_file ): TXCODE_find_file (aTHX_ st); goto *(st->pc->exec_code); |
| 523 |
1 |
| LABEL(suffix ): TXCODE_suffix (aTHX_ st); goto *(st->pc->exec_code); |
| 524 |
202 |
| LABEL(for_start ): TXCODE_for_start (aTHX_ st); goto *(st->pc->exec_code); |
| 525 |
980 |
| LABEL(for_iter ): TXCODE_for_iter (aTHX_ st); goto *(st->pc->exec_code); |
| 526 |
513 |
| LABEL(add ): TXCODE_add (aTHX_ st); goto *(st->pc->exec_code); |
| 527 |
28 |
| LABEL(sub ): TXCODE_sub (aTHX_ st); goto *(st->pc->exec_code); |
| 528 |
26 |
| LABEL(mul ): TXCODE_mul (aTHX_ st); goto *(st->pc->exec_code); |
| 529 |
9 |
| LABEL(div ): TXCODE_div (aTHX_ st); goto *(st->pc->exec_code); |
| 530 |
50 |
| LABEL(mod ): TXCODE_mod (aTHX_ st); goto *(st->pc->exec_code); |
| 531 |
94 |
| LABEL(concat ): TXCODE_concat (aTHX_ st); goto *(st->pc->exec_code); |
| 532 |
8 |
| LABEL(repeat ): TXCODE_repeat (aTHX_ st); goto *(st->pc->exec_code); |
| 533 |
4 |
| LABEL(bitor ): TXCODE_bitor (aTHX_ st); goto *(st->pc->exec_code); |
| 534 |
4 |
| LABEL(bitand ): TXCODE_bitand (aTHX_ st); goto *(st->pc->exec_code); |
| 535 |
5 |
| LABEL(bitxor ): TXCODE_bitxor (aTHX_ st); goto *(st->pc->exec_code); |
| 536 |
6 |
| LABEL(bitneg ): TXCODE_bitneg (aTHX_ st); goto *(st->pc->exec_code); |
| 537 |
39836967 |
| LABEL(and ): TXCODE_and (aTHX_ st); goto *(st->pc->exec_code); |
| 538 |
41 |
| LABEL(dand ): TXCODE_dand (aTHX_ st); goto *(st->pc->exec_code); |
| 539 |
218 |
| LABEL(or ): TXCODE_or (aTHX_ st); goto *(st->pc->exec_code); |
| 540 |
48 |
| LABEL(dor ): TXCODE_dor (aTHX_ st); goto *(st->pc->exec_code); |
| 541 |
5 |
| LABEL(not ): TXCODE_not (aTHX_ st); goto *(st->pc->exec_code); |
| 542 |
9 |
| LABEL(minus ): TXCODE_minus (aTHX_ st); goto *(st->pc->exec_code); |
| 543 |
21 |
| LABEL(max_index ): TXCODE_max_index (aTHX_ st); goto *(st->pc->exec_code); |
| 544 |
9 |
| LABEL(builtin_mark_raw ): TXCODE_builtin_mark_raw (aTHX_ st); goto *(st->pc->exec_code); |
| 545 |
10 |
| LABEL(builtin_unmark_raw ): TXCODE_builtin_unmark_raw (aTHX_ st); goto *(st->pc->exec_code); |
| 546 |
6 |
| LABEL(builtin_uri_escape ): TXCODE_builtin_uri_escape (aTHX_ st); goto *(st->pc->exec_code); |
| 547 |
4 |
| LABEL(builtin_is_array_ref): TXCODE_builtin_is_array_ref(aTHX_ st); goto *(st->pc->exec_code); |
| 548 |
4 |
| LABEL(builtin_is_hash_ref ): TXCODE_builtin_is_hash_ref (aTHX_ st); goto *(st->pc->exec_code); |
| 549 |
10 |
| LABEL(builtin_html_escape ): TXCODE_builtin_html_escape (aTHX_ st); goto *(st->pc->exec_code); |
| 550 |
2 |
| LABEL(is_code_ref ): TXCODE_is_code_ref (aTHX_ st); goto *(st->pc->exec_code); |
| 551 |
6 |
| LABEL(merge_hash ): TXCODE_merge_hash (aTHX_ st); goto *(st->pc->exec_code); |
| 552 |
32 |
| LABEL(match ): TXCODE_match (aTHX_ st); goto *(st->pc->exec_code); |
| 553 |
500 |
| LABEL(eq ): TXCODE_eq (aTHX_ st); goto *(st->pc->exec_code); |
| 554 |
85 |
| LABEL(ne ): TXCODE_ne (aTHX_ st); goto *(st->pc->exec_code); |
| 555 |
58 |
| LABEL(lt ): TXCODE_lt (aTHX_ st); goto *(st->pc->exec_code); |
| 556 |
10 |
| LABEL(le ): TXCODE_le (aTHX_ st); goto *(st->pc->exec_code); |
| 557 |
42 |
| LABEL(gt ): TXCODE_gt (aTHX_ st); goto *(st->pc->exec_code); |
| 558 |
419 |
| LABEL(ge ): TXCODE_ge (aTHX_ st); goto *(st->pc->exec_code); |
| 559 |
54 |
| LABEL(ncmp ): TXCODE_ncmp (aTHX_ st); goto *(st->pc->exec_code); |
| 560 |
13 |
| LABEL(scmp ): TXCODE_scmp (aTHX_ st); goto *(st->pc->exec_code); |
| 561 |
7 |
| LABEL(range ): TXCODE_range (aTHX_ st); goto *(st->pc->exec_code); |
| 562 |
876 |
| LABEL(fetch_symbol ): TXCODE_fetch_symbol (aTHX_ st); goto *(st->pc->exec_code); |
| 563 |
860 |
| LABEL(funcall ): TXCODE_funcall (aTHX_ st); goto *(st->pc->exec_code); |
| 564 |
1229 |
| LABEL(macro_end ): TXCODE_macro_end (aTHX_ st); goto *(st->pc->exec_code); |
| 565 |
281 |
| LABEL(methodcall_s ): TXCODE_methodcall_s (aTHX_ st); goto *(st->pc->exec_code); |
| 566 |
101 |
| LABEL(make_array ): TXCODE_make_array (aTHX_ st); goto *(st->pc->exec_code); |
| 567 |
54 |
| LABEL(make_hash ): TXCODE_make_hash (aTHX_ st); goto *(st->pc->exec_code); |
| 568 |
72 |
| LABEL(enter ): TXCODE_enter (aTHX_ st); goto *(st->pc->exec_code); |
| 569 |
70 |
| LABEL(leave ): TXCODE_leave (aTHX_ st); goto *(st->pc->exec_code); |
| 570 |
39837198 |
| LABEL(goto ): TXCODE_goto (aTHX_ st); goto *(st->pc->exec_code); |
| 571 |
6 |
| LABEL(vars ): TXCODE_vars (aTHX_ st); goto *(st->pc->exec_code); |
| 572 |
0 |
| LABEL(depend ): TXCODE_depend (aTHX_ st); goto *(st->pc->exec_code); |
| 573 |
1432 |
| LABEL(macro_begin ): TXCODE_macro_begin (aTHX_ st); goto *(st->pc->exec_code); |
| 574 |
871 |
| LABEL(macro_nargs ): TXCODE_macro_nargs (aTHX_ st); goto *(st->pc->exec_code); |
| 575 |
11 |
| LABEL(macro_outer ): TXCODE_macro_outer (aTHX_ st); goto *(st->pc->exec_code); |
| 576 |
4922 |
| LABEL(set_opinfo ): TXCODE_set_opinfo (aTHX_ st); goto *(st->pc->exec_code); |
| 577 |
0 |
| LABEL(super ): TXCODE_super (aTHX_ st); goto *(st->pc->exec_code); |
| 578 |
3914 |
| LABEL(end): TXCODE_end(aTHX_ st); |
| 579 |
3914 |
| return NULL; |
| 580 |
|
| } /* end of tx_runops() */ |
| 581 |
|
| #undef LABEL |
| 582 |
|
| #undef LABEL_PTR |
| 583 |
|
| #endif /* TX_DIRECT_THREADED_CODE */ |
| 584 |
|
| |