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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
|
/* Compiled by KLIC compiler version 3.003 (Sun Mar 21 15:27:19 JST 1999) */
#include <klic/klichdr.h>
#include "atom.h"
#include "funct.h"
#include <klic/gd_macro.h>
GD_USE_CLASS(predicate);
static q* gc_postmortem_args(allocp, ntop, otop, nsize, osize)
q *allocp, *ntop, *otop;
unsigned int nsize, osize;
{
declare_globals;
extern q *copy_one_term();
if (postmortem_args != 0) {
return copy_one_term(&postmortem_args, allocp,
ntop, otop, nsize, osize);
} else {
return allocp;
}
}
module module_system__control();
Const struct predicate predicate_system__control_xpostmortem_3 =
{ module_system__control, 0, 3 };
Const struct predicate predicate_system__control_xregister__postmortem_3 =
{ module_system__control, 1, 3 };
Const struct predicate predicate_system__control_xgc_2 =
{ module_system__control, 2, 2 };
Const struct predicate predicate_system__control_xafter__gc_1 =
{ module_system__control, 3, 1 };
extern q module_g_new();
extern q predicate_g_new();
declare_method_table_of(predicate);
module module_system__control(glbl, qp, allocp, toppred)
struct global_variables *glbl;
struct goalrec *qp;
register q *allocp;
Const struct predicate *toppred;
{
q a0, a1, a2;
q *reasonp;
module_top:
a0 = qp->args[0];
switch_on_pred() {
case_pred(0, postmortem_3_top);
case_pred(1, register__postmortem_3_top);
case_pred(2, gc_2_top);
last_case_pred(3, after__gc_1_top);
}
postmortem_3_top: {
q x0, x1, x2, x3;
a1 = qp->args[1];
a2 = qp->args[2];
qp = qp->next;
postmortem_3_clear_reason:
reasonp = reasons;
postmortem_3_0:
postmortem_3_1:
if (isref(a1)) goto postmortem_3_2;
gblt_pfunctor(a1,x0,postmortem_3_interrupt);
gblt_arity(a1,x1,postmortem_3_interrupt);
generic_arg[0] = a0;
new_generic(module_g_new, 1, x2, 0);
generic_arg[0] = x2;
generic_arg[1] = x0;
generic_arg[2] = x1;
new_generic(predicate_g_new, 3, x3, 0);
a0 = x3;
execute(register__postmortem_3_0);
goto register__postmortem_3_ext_interrupt;
postmortem_3_2:
deref_and_jump(a1,postmortem_3_1);
*reasonp++ = a1;
goto postmortem_3_interrupt;
postmortem_3_ext_interrupt:
reasonp = 0l;
postmortem_3_interrupt:
goto interrupt_3;
}
register__postmortem_3_top: {
q x0;
a1 = qp->args[1];
a2 = qp->args[2];
qp = qp->next;
register__postmortem_3_clear_reason:
reasonp = reasons;
register__postmortem_3_0:
register__postmortem_3_1:
switch (ptagof(a0)) {
case FUNCTOR:
register__postmortem_3_2:
if (!isgobj(a0)) goto register__postmortem_3_interrupt;
if (!isclass(a0,predicate)) goto register__postmortem_3_interrupt;
{
postmortem_pred = ((struct predicate_object *)functorp(a0))->pdesc;
if (postmortem_args ==0) register_gc_hook(gc_postmortem_args);
postmortem_args = a1;
}
x0 = NILATOM;
unify_value(a2, x0);
proceed();
case VARREF:
deref_and_jump(a0,register__postmortem_3_1);
*reasonp++ = a0;
goto register__postmortem_3_interrupt;
};
goto register__postmortem_3_interrupt;
register__postmortem_3_ext_interrupt:
reasonp = 0l;
register__postmortem_3_interrupt:
toppred = &predicate_system__control_xregister__postmortem_3;
goto interrupt_3;
}
gc_2_top: {
q x0;
a1 = qp->args[1];
qp = qp->next;
gc_2_clear_reason:
reasonp = reasons;
gc_2_0:
{
x0 = makeint(allocp-new_space_top);
allocp = real_heaplimit;
heaplimit = 0;
}
unify_value(a0, x0);
a0 = a1;
execute(after__gc_1_clear_reason);
goto after__gc_1_ext_interrupt;
gc_2_ext_interrupt:
reasonp = 0l;
gc_2_interrupt:
goto interrupt_2;
}
after__gc_1_top: {
q x0;
qp = qp->next;
after__gc_1_clear_reason:
reasonp = reasons;
after__gc_1_0:
{
x0 = makeint(allocp-new_space_top);
}
unify_value(a0, x0);
proceed();
after__gc_1_ext_interrupt:
reasonp = 0l;
after__gc_1_interrupt:
toppred = &predicate_system__control_xafter__gc_1;
goto interrupt_1;
}
interrupt_3:
allocp[4] = a2;
interrupt_2:
allocp[3] = a1;
interrupt_1:
allocp[2] = a0;
interrupt_0:
allocp = interrupt_goal(allocp, toppred, reasonp);
proceed_label:
loop_within_module(module_system__control);
}
|