YAP 7.1.0
walkclause.h
1
2 /* This file was generated automatically by "yap -L misc/buildops"
3 please do not update */
4
5
6 while (TRUE) {
7 op_numbers op;
8
9 op = Yap_op_from_opcode(pc->opc);
10 /* C-code, maybe indexing */
11 switch (op) {
12 /* instructions type D */
13 case _write_dbterm:
14 pc = NEXTOP(pc,D);
15 break;
16 /* instructions type Illss */
17 case _enter_lu_pred:
18 return walk_got_lu_block(pc->y_u.Illss.I, startp, endp);
19 /* instructions type J */
20#ifdef YAP_JIT
21 case _jit_handler:
22#endif
23 pc = NEXTOP(pc,J);
24 break;
25 /* instructions type L */
26 case _alloc_for_logical_pred:
27 return walk_got_lu_clause(pc->y_u.L.ClBase, startp, endp);
28 /* instructions type N */
29 case _write_bigint:
30 pc = NEXTOP(pc,N);
31 break;
32 /* instructions type Osblp */
33 case _either:
34 case _or_else:
35 clause_code = TRUE;
36 pp = pc->y_u.Osblp.p0;
37 pc = NEXTOP(pc,Osblp);
38 break;
39 /* instructions type Osbmp */
40 case _p_execute:
41 case _p_execute_tail:
42 pc = NEXTOP(pc,Osbmp);
43 break;
44 /* instructions type Osbpa */
45 case _ensure_space:
46 pc = NEXTOP(pc,Osbpa);
47 break;
48 /* instructions type Osbpp */
49 case _call_cpred:
50 pp = pc->y_u.Osbpp.p;
51 return walk_found_c_pred(pp, startp, endp);
52 case _call_usercpred:
53 pp = pc->y_u.Osbpp.p;
54 return walk_found_c_pred(pp, startp, endp);
55 case _execute_cpred:
56 pp = pc->y_u.Osbpp.p;
57 return walk_found_c_pred(pp, startp, endp);
58 case _p_execute2:
59 return found_meta_call(startp, endp);
60 case _call:
61 case _dexecute:
62 case _execute:
63 case _fcall:
64 clause_code = TRUE;
65 pp = pc->y_u.Osbpp.p0;
66 pc = NEXTOP(pc,Osbpp);
67 break;
68 /* instructions type OtILl */
69 case _count_trust_logical:
70 case _profiled_trust_logical:
71 case _trust_logical:
72 return walk_got_lu_block(pc->y_u.OtILl.block, startp, endp);
73 /* instructions type OtaLl */
74 case _count_retry_logical:
75 case _profiled_retry_logical:
76 case _retry_logical:
77 case _try_logical:
78 pc = pc->y_u.OtaLl.n;
79 break;
80 /* instructions type OtapFs */
81 case _cut_c:
82 case _cut_userc:
83 case _retry_c:
84 case _retry_userc:
85 case _try_c:
86 case _try_userc:
87 clause_code = TRUE;
88 pp = pc->y_u.OtapFs.p;
89 pc = NEXTOP(pc,OtapFs);
90 break;
91 /* instructions type Otapl */
92 case _count_retry_and_mark:
93 case _count_retry_me:
94 case _count_trust_me:
95 case _profiled_retry_and_mark:
96 case _profiled_retry_me:
97 case _profiled_trust_me:
98 case _retry:
99 case _retry_and_mark:
100 case _retry_me:
101 case _spy_or_trymark:
102 case _trust:
103 case _trust_me:
104 case _try_and_mark:
105 case _try_clause:
106 case _try_me:
107 clause_code = FALSE;
108 pp = pc->y_u.Otapl.p;
109 pc = NEXTOP(pc,Otapl);
110 break;
111 /* instructions type c */
112 case _write_atom:
113 pc = NEXTOP(pc,c);
114 break;
115 /* instructions type cc */
116 case _get_2atoms:
117 pc = NEXTOP(pc,cc);
118 break;
119 /* instructions type ccc */
120 case _get_3atoms:
121 pc = NEXTOP(pc,ccc);
122 break;
123 /* instructions type cccc */
124 case _get_4atoms:
125 pc = NEXTOP(pc,cccc);
126 break;
127 /* instructions type ccccc */
128 case _get_5atoms:
129 pc = NEXTOP(pc,ccccc);
130 break;
131 /* instructions type cccccc */
132 case _get_6atoms:
133 pc = NEXTOP(pc,cccccc);
134 break;
135 /* instructions type clll */
136 case _if_not_then:
137 pc = NEXTOP(pc,clll);
138 break;
139 /* instructions type d */
140 case _write_float:
141 pc = NEXTOP(pc,d);
142 break;
143 /* instructions type e */
144 case _Nstop:
145 return NULL;
146 case _copy_idb_term:
147 return found_idb_clause(pc, startp, endp);
148 case _expand_index:
149 return found_expand(pc, startp, endp PASS_REGS);
150 case _index_pred:
151 return found_owner_op(pc, startp, endp PASS_REGS);
152 case _lock_pred:
153 return found_owner_op(pc, startp, endp PASS_REGS);
154 case _op_fail:
155 if (codeptr == FAILCODE)
156 return found_fail(pc, startp, endp PASS_REGS);
157 pc = NEXTOP(pc,e);
158 break;
159 case _spy_pred:
160 return found_owner_op(pc, startp, endp PASS_REGS);
161 case _trust_fail:
162 if (codeptr == TRUSTFAILCODE)
163 return found_fail(pc, startp, endp PASS_REGS);
164 pc = NEXTOP(pc,e);
165 break;
166 case _undef_p:
167 return found_owner_op(pc, startp, endp PASS_REGS);
168 case _unify_idb_term:
169 return found_idb_clause(pc, startp, endp);
170 case _allocate:
171 case _enter_exo:
172 case _index_blob:
173 case _index_dbref:
174 case _index_long:
175 case _p_equal:
176 case _p_functor:
177 case _pop:
178#ifdef BEAM
179 case _retry_eam:
180#endif
181#ifdef THREADS
182 case _thread_local:
183#endif
184 case _unlock_lu:
185 case _write_l_list:
186 case _write_list:
187 case _write_void:
188 pc = NEXTOP(pc,e);
189 break;
190 /* instructions type fa */
191 case _write_l_struc:
192 case _write_struct:
193 pc = NEXTOP(pc,fa);
194 break;
195 /* instructions type i */
196 case _write_longint:
197 pc = NEXTOP(pc,i);
198 break;
199 /* instructions type l */
200 case _Ystop:
201 return found_ystop(pc, clause_code, startp, endp, pp PASS_REGS);
202 case _jump:
203 case _jump_if_var:
204 case _move_back:
205 case _retry2:
206 case _retry3:
207 case _retry4:
208 case _skip:
209 case _try_clause2:
210 case _try_clause3:
211 case _try_clause4:
212 case _try_in:
213 pc = NEXTOP(pc,l);
214 break;
215 /* instructions type llll */
216 case _switch_on_type:
217 pc = NEXTOP(pc,llll);
218 break;
219 /* instructions type lp */
220 case _retry_all_exo:
221 case _retry_exo:
222 case _retry_exo_udi:
223 case _try_all_exo:
224 case _try_exo:
225 case _try_exo_udi:
226 case _user_switch:
227 pc = NEXTOP(pc,lp);
228 break;
229 /* instructions type o */
230 case _unify_l_list:
231 case _unify_l_list_write:
232 case _unify_l_void:
233 case _unify_l_void_write:
234 case _unify_list:
235 case _unify_list_write:
236 case _unify_void:
237 case _unify_void_write:
238 pc = NEXTOP(pc,o);
239 break;
240 /* instructions type oD */
241 case _unify_dbterm:
242 case _unify_l_dbterm:
243 pc = NEXTOP(pc,oD);
244 break;
245 /* instructions type oN */
246 case _unify_bigint:
247 case _unify_l_bigint:
248 pc = NEXTOP(pc,oN);
249 break;
250 /* instructions type oc */
251 case _unify_atom:
252 case _unify_atom_write:
253 case _unify_l_atom:
254 case _unify_l_atom_write:
255 pc = NEXTOP(pc,oc);
256 break;
257 /* instructions type od */
258 case _unify_float:
259 case _unify_float_write:
260 case _unify_l_float:
261 case _unify_l_float_write:
262 pc = NEXTOP(pc,od);
263 break;
264 /* instructions type ofa */
265 case _unify_l_struc:
266 case _unify_l_struc_write:
267 case _unify_struct:
268 case _unify_struct_write:
269 pc = NEXTOP(pc,ofa);
270 break;
271 /* instructions type oi */
272 case _unify_l_longint:
273 case _unify_l_longint_write:
274 case _unify_longint:
275 case _unify_longint_write:
276 pc = NEXTOP(pc,oi);
277 break;
278 /* instructions type ollll */
279 case _switch_list_nl:
280 pc = NEXTOP(pc,ollll);
281 break;
282 /* instructions type os */
283#ifdef BEAM
284 case _run_eam:
285#endif
286 case _unify_l_n_voids:
287 case _unify_l_n_voids_write:
288 case _unify_n_voids:
289 case _unify_n_voids_write:
290 pc = NEXTOP(pc,os);
291 break;
292 /* instructions type osc */
293 case _unify_n_atoms:
294 case _unify_n_atoms_write:
295 pc = NEXTOP(pc,osc);
296 break;
297 /* instructions type ou */
298 case _unify_l_string:
299 case _unify_string:
300 pc = NEXTOP(pc,ou);
301 break;
302 /* instructions type ox */
303 case _save_appl_x:
304 case _save_appl_x_write:
305 case _save_pair_x:
306 case _save_pair_x_write:
307 case _unify_l_x_loc:
308 case _unify_l_x_loc_write:
309 case _unify_l_x_val:
310 case _unify_l_x_val_write:
311 case _unify_l_x_var:
312 case _unify_l_x_var_write:
313 case _unify_x_loc:
314 case _unify_x_loc_write:
315 case _unify_x_val:
316 case _unify_x_val_write:
317 case _unify_x_var:
318 case _unify_x_var_write:
319 pc = NEXTOP(pc,ox);
320 break;
321 /* instructions type oxx */
322 case _unify_l_x_var2:
323 case _unify_l_x_var2_write:
324 case _unify_x_var2:
325 case _unify_x_var2_write:
326 pc = NEXTOP(pc,oxx);
327 break;
328 /* instructions type oy */
329 case _save_appl_y:
330 case _save_appl_y_write:
331 case _save_pair_y:
332 case _save_pair_y_write:
333 case _unify_l_y_loc:
334 case _unify_l_y_loc_write:
335 case _unify_l_y_val:
336 case _unify_l_y_val_write:
337 case _unify_l_y_var:
338 case _unify_l_y_var_write:
339 case _unify_y_loc:
340 case _unify_y_loc_write:
341 case _unify_y_val:
342 case _unify_y_val_write:
343 case _unify_y_var:
344 case _unify_y_var_write:
345 pc = NEXTOP(pc,oy);
346 break;
347 /* instructions type p */
348 case _lock_lu:
349 case _procceed:
350 pp = pc->y_u.p.p;
351 if (pp->PredFlags & MegaClausePredFlag)
352 return found_mega_clause(pp, startp, endp);
353 clause_code = TRUE;
354 pc = NEXTOP(pc,p);
355 break;
356 case _count_call:
357 case _count_retry:
358 case _deallocate:
359 case _enter_profiling:
360 case _retry_profiled:
361 case _retry_udi:
362 case _try_udi:
363 pc = NEXTOP(pc,p);
364 break;
365 /* instructions type plxxs */
366 case _call_bfunc_xx:
367 pc = NEXTOP(pc,plxxs);
368 break;
369 /* instructions type plxys */
370 case _call_bfunc_xy:
371 case _call_bfunc_yx:
372 pc = NEXTOP(pc,plxys);
373 break;
374 /* instructions type plyys */
375 case _call_bfunc_yy:
376 pc = NEXTOP(pc,plyys);
377 break;
378 /* instructions type s */
379 case _cut:
380 case _cut_e:
381 case _cut_t:
382 case _pop_n:
383 case _write_n_voids:
384 pc = NEXTOP(pc,s);
385 break;
386 /* instructions type sc */
387 case _write_n_atoms:
388 pc = NEXTOP(pc,sc);
389 break;
390 /* instructions type sllll */
391 case _switch_on_sub_arg_type:
392 pc = NEXTOP(pc,sllll);
393 break;
394 /* instructions type slpp */
395 case _call_c_wfail:
396 pp = pc->y_u.slpp.p;
397 return walk_found_c_pred(pp, startp, endp);
398 /* instructions type sssl */
399 case _go_on_cons:
400 case _go_on_func:
401 case _if_cons:
402 case _if_func:
403 case _switch_on_cons:
404 case _switch_on_func:
405 pc = NEXTOP(pc,sssl);
406 break;
407 /* instructions type sssllp */
408 case _expand_clauses:
409 return found_expand_index(pc, startp, endp, codeptr PASS_REGS);
410 pc = NEXTOP(pc,sssllp);
411 break;
412 /* instructions type x */
413 case _get_atom_exo:
414 case _get_list:
415 case _put_list:
416 case _save_b_x:
417 case _write_x_loc:
418 case _write_x_val:
419 case _write_x_var:
420 pc = NEXTOP(pc,x);
421 break;
422 /* instructions type xD */
423 case _get_dbterm:
424 case _put_dbterm:
425 pc = NEXTOP(pc,xD);
426 break;
427 /* instructions type xN */
428 case _get_bigint:
429 case _put_bigint:
430 pc = NEXTOP(pc,xN);
431 break;
432 /* instructions type xc */
433 case _get_atom:
434 case _put_atom:
435 pc = NEXTOP(pc,xc);
436 break;
437 /* instructions type xd */
438 case _get_float:
439 case _put_float:
440 pc = NEXTOP(pc,xd);
441 break;
442 /* instructions type xfa */
443 case _get_struct:
444 case _put_struct:
445 pc = NEXTOP(pc,xfa);
446 break;
447 /* instructions type xi */
448 case _get_longint:
449 case _put_longint:
450 pc = NEXTOP(pc,xi);
451 break;
452 /* instructions type xl */
453 case _p_atom_x:
454 case _p_atomic_x:
455 case _p_compound_x:
456 case _p_db_ref_x:
457 case _p_float_x:
458 case _p_integer_x:
459 case _p_nonvar_x:
460 case _p_number_x:
461 case _p_primitive_x:
462 case _p_var_x:
463 pc = NEXTOP(pc,xl);
464 break;
465 /* instructions type xll */
466 case _jump_if_nonvar:
467 pc = NEXTOP(pc,xll);
468 break;
469 /* instructions type xllll */
470 case _switch_on_arg_type:
471 pc = NEXTOP(pc,xllll);
472 break;
473 /* instructions type xps */
474 case _commit_b_x:
475 case _soft_cut_b_x:
476 pc = NEXTOP(pc,xps);
477 break;
478 /* instructions type xu */
479 case _get_string:
480 pc = NEXTOP(pc,xu);
481 break;
482 /* instructions type xx */
483 case _get_x_val:
484 case _get_x_var:
485 case _gl_void_valx:
486 case _gl_void_varx:
487 case _glist_valx:
488 case _put_x_val:
489 case _put_x_var:
490 pc = NEXTOP(pc,xx);
491 break;
492 /* instructions type xxc */
493 case _p_func2s_cv:
494 pc = NEXTOP(pc,xxc);
495 break;
496 /* instructions type xxn */
497 case _p_and_vc:
498 case _p_arg_cv:
499 case _p_div_cv:
500 case _p_div_vc:
501 case _p_func2s_vc:
502 case _p_minus_cv:
503 case _p_or_vc:
504 case _p_plus_vc:
505 case _p_sll_cv:
506 case _p_sll_vc:
507 case _p_slr_cv:
508 case _p_slr_vc:
509 case _p_times_vc:
510 pc = NEXTOP(pc,xxn);
511 break;
512 /* instructions type xxx */
513 case _p_and_vv:
514 case _p_arg_vv:
515 case _p_div_vv:
516 case _p_func2f_xx:
517 case _p_func2s_vv:
518 case _p_minus_vv:
519 case _p_or_vv:
520 case _p_plus_vv:
521 case _p_sll_vv:
522 case _p_slr_vv:
523 case _p_times_vv:
524 pc = NEXTOP(pc,xxx);
525 break;
526 /* instructions type xxxx */
527 case _put_xx_val:
528 pc = NEXTOP(pc,xxxx);
529 break;
530 /* instructions type xxy */
531 case _p_func2f_xy:
532 pc = NEXTOP(pc,xxy);
533 break;
534 /* instructions type y */
535 case _save_b_y:
536 case _write_y_loc:
537 case _write_y_val:
538 case _write_y_var:
539 pc = NEXTOP(pc,y);
540 break;
541 /* instructions type yl */
542 case _p_atom_y:
543 case _p_atomic_y:
544 case _p_compound_y:
545 case _p_db_ref_y:
546 case _p_float_y:
547 case _p_integer_y:
548 case _p_nonvar_y:
549 case _p_number_y:
550 case _p_primitive_y:
551 case _p_var_y:
552 pc = NEXTOP(pc,yl);
553 break;
554 /* instructions type yps */
555 case _commit_b_y:
556 case _soft_cut_b_y:
557 pc = NEXTOP(pc,yps);
558 break;
559 /* instructions type yx */
560 case _get_y_val:
561 case _get_y_var:
562 case _gl_void_valy:
563 case _gl_void_vary:
564 case _glist_valy:
565 case _put_unsafe:
566 case _put_y_val:
567 case _put_y_var:
568 pc = NEXTOP(pc,yx);
569 break;
570 /* instructions type yxc */
571 case _p_func2s_y_cv:
572 pc = NEXTOP(pc,yxc);
573 break;
574 /* instructions type yxn */
575 case _p_and_y_vc:
576 case _p_arg_y_cv:
577 case _p_div_y_cv:
578 case _p_div_y_vc:
579 case _p_func2s_y_vc:
580 case _p_minus_y_cv:
581 case _p_or_y_vc:
582 case _p_plus_y_vc:
583 case _p_sll_y_cv:
584 case _p_sll_y_vc:
585 case _p_slr_y_cv:
586 case _p_slr_y_vc:
587 case _p_times_y_vc:
588 pc = NEXTOP(pc,yxn);
589 break;
590 /* instructions type yxx */
591 case _p_and_y_vv:
592 case _p_arg_y_vv:
593 case _p_div_y_vv:
594 case _p_func2f_yx:
595 case _p_func2s_y_vv:
596 case _p_minus_y_vv:
597 case _p_or_y_vv:
598 case _p_plus_y_vv:
599 case _p_sll_y_vv:
600 case _p_slr_y_vv:
601 case _p_times_y_vv:
602 pc = NEXTOP(pc,yxx);
603 break;
604 /* instructions type yyx */
605 case _p_func2f_yy:
606 pc = NEXTOP(pc,yyx);
607 break;
608 /* instructions type yyxx */
609 case _get_yy_var:
610 case _put_y_vals:
611 pc = NEXTOP(pc,yyxx);
612 break;
613#ifdef YAPOR
614 /* instructions type Otapl */
615 case _getwork:
616 case _getwork_seq:
617 case _sync:
618 clause_code = FALSE;
619 pp = pc->y_u.Otapl.p;
620 pc = NEXTOP(pc,Otapl);
621 break;
622 /* instructions type e */
623 case _getwork_first_time:
624 pc = NEXTOP(pc,e);
625 break;
626#endif
627#ifdef TABLING
628 /* instructions type Otapl */
629 case _table_answer_resolution:
630#ifdef THREADS_CONSUMER_SHARING
631 case _table_answer_resolution_completion:
632#endif
633 case _table_completion:
634 case _table_load_answer:
635 case _table_retry:
636 case _table_retry_me:
637 case _table_trust:
638 case _table_trust_me:
639 case _table_try:
640 case _table_try_answer:
641 case _table_try_me:
642 case _table_try_single:
643 clause_code = FALSE;
644 pp = pc->y_u.Otapl.p;
645 pc = NEXTOP(pc,Otapl);
646 break;
647 /* instructions type e */
648#ifdef TABLING_INNER_CUTS
649 case _clause_with_cut:
650#endif
651 pc = NEXTOP(pc,e);
652 break;
653 /* instructions type s */
654 case _table_new_answer:
655 pc = NEXTOP(pc,s);
656 break;
657 /* instructions type e */
658 case _trie_do_appl:
659 case _trie_do_appl_in_pair:
660 case _trie_do_atom:
661 case _trie_do_atom_in_pair:
662 case _trie_do_bigint:
663 case _trie_do_double:
664 case _trie_do_extension:
665 case _trie_do_gterm:
666 case _trie_do_longint:
667 case _trie_do_null:
668 case _trie_do_null_in_pair:
669 case _trie_do_pair:
670 case _trie_do_val:
671 case _trie_do_val_in_pair:
672 case _trie_do_var:
673 case _trie_do_var_in_pair:
674 case _trie_retry_appl:
675 case _trie_retry_appl_in_pair:
676 case _trie_retry_atom:
677 case _trie_retry_atom_in_pair:
678 case _trie_retry_bigint:
679 case _trie_retry_double:
680 case _trie_retry_extension:
681 case _trie_retry_gterm:
682 case _trie_retry_longint:
683 case _trie_retry_null:
684 case _trie_retry_null_in_pair:
685 case _trie_retry_pair:
686 case _trie_retry_val:
687 case _trie_retry_val_in_pair:
688 case _trie_retry_var:
689 case _trie_retry_var_in_pair:
690 case _trie_trust_appl:
691 case _trie_trust_appl_in_pair:
692 case _trie_trust_atom:
693 case _trie_trust_atom_in_pair:
694 case _trie_trust_bigint:
695 case _trie_trust_double:
696 case _trie_trust_extension:
697 case _trie_trust_gterm:
698 case _trie_trust_longint:
699 case _trie_trust_null:
700 case _trie_trust_null_in_pair:
701 case _trie_trust_pair:
702 case _trie_trust_val:
703 case _trie_trust_val_in_pair:
704 case _trie_trust_var:
705 case _trie_trust_var_in_pair:
706 case _trie_try_appl:
707 case _trie_try_appl_in_pair:
708 case _trie_try_atom:
709 case _trie_try_atom_in_pair:
710 case _trie_try_bigint:
711 case _trie_try_double:
712 case _trie_try_extension:
713 case _trie_try_gterm:
714 case _trie_try_longint:
715 case _trie_try_null:
716 case _trie_try_null_in_pair:
717 case _trie_try_pair:
718 case _trie_try_val:
719 case _trie_try_val_in_pair:
720 case _trie_try_var:
721 case _trie_try_var_in_pair:
722 pc = NEXTOP(pc,e);
723 break;
724#endif
725 /* this instruction is hardwired */
726 case _or_last:
727#ifdef YAPOR
728 pp = pc->y_u.Osblp.p0;
729 if (pp->PredFlags & MegaClausePredFlag)
730 return found_mega_clause(pp, startp, endp);
731 clause_code = TRUE;
732 pc = NEXTOP(pc,Osblp);
733#else
734 pp = pc->y_u.p.p;
735 if (pp->PredFlags & MegaClausePredFlag)
736 return found_mega_clause(pp, startp, endp);
737 clause_code = TRUE;
738 pc = NEXTOP(pc,p);
739#endif
740 }
741 }