| 1 |
/* |
| 2 |
* Tue Feb 12 18:19:56 2008 |
| 3 |
* This file was produced by |
| 4 |
* rtt: Icon Version 9.5.a-C, Autumn, 2007 |
| 5 |
*/ |
| 6 |
//and then modified by cs |
| 7 |
|
| 8 |
|
| 9 |
extern "C" { //cs |
| 10 |
|
| 11 |
#define COMPILER 0 |
| 12 |
#include RTT |
| 13 |
|
| 14 |
//#line 22 "interp.r" |
| 15 |
|
| 16 |
//word lastop; |
| 17 |
extern word lastop; //cs |
| 18 |
|
| 19 |
//#line 28 "interp.r" |
| 20 |
|
| 21 |
//struct ef_marker *efp; |
| 22 |
extern struct ef_marker *efp; //cs |
| 23 |
//struct gf_marker *gfp; |
| 24 |
extern struct gf_marker *gfp; //cs |
| 25 |
//inst ipc; |
| 26 |
extern inst ipc; //cs |
| 27 |
//word *sp = NULL; |
| 28 |
extern word *sp; //cs |
| 29 |
|
| 30 |
//int ilevel; |
| 31 |
extern int ilevel; //cs |
| 32 |
//struct descrip value_tmp; |
| 33 |
extern struct descrip value_tmp; //cs |
| 34 |
//struct descrip eret_tmp; |
| 35 |
extern struct descrip eret_tmp; //cs |
| 36 |
|
| 37 |
//int coexp_act; |
| 38 |
extern int coexp_act; //cs |
| 39 |
|
| 40 |
//#line 40 "interp.r" |
| 41 |
|
| 42 |
//dptr xargp; |
| 43 |
extern dptr xargp; //cs |
| 44 |
//word xnargs; |
| 45 |
extern word xnargs; //cs |
| 46 |
|
| 47 |
//#line 155 "interp.r" |
| 48 |
|
| 49 |
//int interp(fsig, cargp) |
| 50 |
//int fsig; |
| 51 |
//dptr cargp; |
| 52 |
static int icall(dptr procptr, dptr arglistptr, dptr result) //cs |
| 53 |
{ |
| 54 |
register word opnd; |
| 55 |
register word *rsp; |
| 56 |
register dptr rargp; |
| 57 |
register struct ef_marker *newefp; |
| 58 |
register struct gf_marker *newgfp; |
| 59 |
register word *wd; |
| 60 |
register word *firstwd, *lastwd; |
| 61 |
word *oldsp; |
| 62 |
int type, signal, args; |
| 63 |
// extern int (*optab[])(); |
| 64 |
extern int (*optab[])(dptr); //cs |
| 65 |
// extern int (*keytab[])(); |
| 66 |
extern int (*keytab[])(dptr); //cs |
| 67 |
struct b_proc *bproc; |
| 68 |
dptr lval; //cs |
| 69 |
int fsig = 0; //cs |
| 70 |
dptr cargp = (dptr)(sp+1); //cs |
| 71 |
dptr return_cargp = cargp; //cs |
| 72 |
word *saved_sp = sp; //cs |
| 73 |
word *return_sp = sp + 2; //cs |
| 74 |
|
| 75 |
cargp[0] = *procptr; //cs |
| 76 |
cargp[1] = *arglistptr; //cs |
| 77 |
sp += 4; //cs |
| 78 |
|
| 79 |
//#line 189 "interp.r" |
| 80 |
|
| 81 |
if (BlkLoc(k_current) == BlkLoc(k_main) && |
| 82 |
((char *)sp + PerilDelta) > (char *)stackend) |
| 83 |
fatalerr(301, NULL); |
| 84 |
|
| 85 |
//#line 195 "interp.r" |
| 86 |
|
| 87 |
#if GPX //cs |
| 88 |
if (!pollctr--) { |
| 89 |
pollctr = pollevent(); |
| 90 |
if (pollctr == -1) fatalerr(141, NULL); |
| 91 |
} |
| 92 |
#endif |
| 93 |
|
| 94 |
//#line 201 "interp.r" |
| 95 |
|
| 96 |
ilevel++; |
| 97 |
|
| 98 |
rsp = sp;; |
| 99 |
|
| 100 |
//#line 215 "interp.r" |
| 101 |
|
| 102 |
if (fsig == G_Csusp) { |
| 103 |
|
| 104 |
//#line 218 "interp.r" |
| 105 |
|
| 106 |
oldsp = rsp; |
| 107 |
|
| 108 |
//#line 223 "interp.r" |
| 109 |
|
| 110 |
newgfp = (struct gf_marker *)(rsp + 1); |
| 111 |
newgfp->gf_gentype = fsig; |
| 112 |
newgfp->gf_gfp = gfp; |
| 113 |
newgfp->gf_efp = efp; |
| 114 |
newgfp->gf_ipc = ipc; |
| 115 |
rsp += ((sizeof(struct gf_smallmarker) + sizeof(word) - 1) / sizeof(word)); |
| 116 |
|
| 117 |
//#line 235 "interp.r" |
| 118 |
|
| 119 |
if (gfp != 0) { |
| 120 |
if (gfp->gf_gentype == G_Psusp) |
| 121 |
firstwd = (word *)gfp + ((sizeof((*gfp)) + sizeof(word) - 1) / sizeof(word)); |
| 122 |
else |
| 123 |
firstwd = (word *)gfp + ((sizeof(struct gf_smallmarker) + sizeof(word) - 1) / sizeof(word)); |
| 124 |
} |
| 125 |
else |
| 126 |
firstwd = (word *)efp + ((sizeof((*efp)) + sizeof(word) - 1) / sizeof(word)); |
| 127 |
lastwd = (word *)cargp + 1; |
| 128 |
|
| 129 |
//#line 249 "interp.r" |
| 130 |
|
| 131 |
for (wd = firstwd; wd <= lastwd; wd++) |
| 132 |
*++rsp = *wd; |
| 133 |
gfp = newgfp; |
| 134 |
} |
| 135 |
|
| 136 |
//#line 257 "interp.r" |
| 137 |
|
| 138 |
goto apply; //cs |
| 139 |
|
| 140 |
for (; ; ) { |
| 141 |
|
| 142 |
//#line 330 "interp.r" |
| 143 |
|
| 144 |
lastop = (word)(*ipc.op++); |
| 145 |
|
| 146 |
if( rsp < return_sp ) //cs |
| 147 |
syserror("loadfuncpp: call of Icon from C++ must return a value, yet failed instead"); |
| 148 |
|
| 149 |
//#line 348 "interp.r" |
| 150 |
|
| 151 |
switch ((int)lastop) { |
| 152 |
|
| 153 |
//#line 359 "interp.r" |
| 154 |
|
| 155 |
case 51: |
| 156 |
ipc.op[-1] = (90); |
| 157 |
PushValSP(rsp, D_Cset); |
| 158 |
opnd = (*ipc.opnd++); |
| 159 |
opnd += (word)ipc.opnd; |
| 160 |
ipc.opnd[-1] = (opnd); |
| 161 |
PushValSP(rsp, opnd); |
| 162 |
break; |
| 163 |
|
| 164 |
case 90: |
| 165 |
PushValSP(rsp, D_Cset); |
| 166 |
PushValSP(rsp, (*ipc.opnd++)); |
| 167 |
break; |
| 168 |
|
| 169 |
case 60: |
| 170 |
PushValSP(rsp, D_Integer); |
| 171 |
PushValSP(rsp, (*ipc.opnd++)); |
| 172 |
break; |
| 173 |
|
| 174 |
case 75: |
| 175 |
ipc.op[-1] = (91); |
| 176 |
PushValSP(rsp, D_Real); |
| 177 |
opnd = (*ipc.opnd++); |
| 178 |
opnd += (word)ipc.opnd; |
| 179 |
PushValSP(rsp, opnd); |
| 180 |
ipc.opnd[-1] = (opnd); |
| 181 |
break; |
| 182 |
|
| 183 |
case 91: |
| 184 |
PushValSP(rsp, D_Real); |
| 185 |
PushValSP(rsp, (*ipc.opnd++)); |
| 186 |
break; |
| 187 |
|
| 188 |
case 77: |
| 189 |
ipc.op[-1] = (92); |
| 190 |
PushValSP(rsp, (*ipc.opnd++)); |
| 191 |
opnd = (word)strcons + (*ipc.opnd++); |
| 192 |
ipc.opnd[-1] = (opnd); |
| 193 |
PushValSP(rsp, opnd); |
| 194 |
break; |
| 195 |
|
| 196 |
case 92: |
| 197 |
PushValSP(rsp, (*ipc.opnd++)); |
| 198 |
PushValSP(rsp, (*ipc.opnd++)); |
| 199 |
break; |
| 200 |
|
| 201 |
//#line 407 "interp.r" |
| 202 |
|
| 203 |
case 81: |
| 204 |
PushValSP(rsp, D_Var); |
| 205 |
PushValSP(rsp, &glbl_argp[(*ipc.opnd++) + 1]); |
| 206 |
break; |
| 207 |
|
| 208 |
case 84: |
| 209 |
ipc.op[-1] = (93); |
| 210 |
PushValSP(rsp, D_Var); |
| 211 |
opnd = (*ipc.opnd++); |
| 212 |
PushValSP(rsp, &globals[opnd]); |
| 213 |
ipc.opnd[-1] = ((word)&globals[opnd]); |
| 214 |
break; |
| 215 |
|
| 216 |
case 93: |
| 217 |
PushValSP(rsp, D_Var); |
| 218 |
PushValSP(rsp, (*ipc.opnd++)); |
| 219 |
break; |
| 220 |
|
| 221 |
case 83: |
| 222 |
PushValSP(rsp, D_Var); |
| 223 |
PushValSP(rsp, &pfp->pf_locals[(*ipc.opnd++)]); |
| 224 |
break; |
| 225 |
|
| 226 |
case 82: |
| 227 |
ipc.op[-1] = (94); |
| 228 |
PushValSP(rsp, D_Var); |
| 229 |
opnd = (*ipc.opnd++); |
| 230 |
PushValSP(rsp, &statics[opnd]); |
| 231 |
ipc.opnd[-1] = ((word)&statics[opnd]); |
| 232 |
break; |
| 233 |
|
| 234 |
case 94: |
| 235 |
PushValSP(rsp, D_Var); |
| 236 |
PushValSP(rsp, (*ipc.opnd++)); |
| 237 |
break; |
| 238 |
|
| 239 |
//#line 448 "interp.r" |
| 240 |
|
| 241 |
case 4: |
| 242 |
case 19: |
| 243 |
case 23: |
| 244 |
case 34: |
| 245 |
case 37: |
| 246 |
|
| 247 |
//#line 65 "interp.r" |
| 248 |
|
| 249 |
rargp = (dptr)(rsp - 1) - 1; |
| 250 |
xargp = rargp; |
| 251 |
sp = rsp;; |
| 252 |
|
| 253 |
//#line 453 "interp.r" |
| 254 |
|
| 255 |
; |
| 256 |
Deref(rargp[1]); |
| 257 |
|
| 258 |
//#line 85 "interp.r" |
| 259 |
|
| 260 |
if ((*(optab[lastop]))(rargp) == A_Resume) { |
| 261 |
|
| 262 |
//#line 89 "interp.r" |
| 263 |
|
| 264 |
goto efail_noev; |
| 265 |
} |
| 266 |
rsp = (word *)rargp + 1; |
| 267 |
|
| 268 |
//#line 95 "interp.r" |
| 269 |
|
| 270 |
break; |
| 271 |
|
| 272 |
//#line 455 "interp.r" |
| 273 |
|
| 274 |
; |
| 275 |
|
| 276 |
case 43: |
| 277 |
|
| 278 |
//#line 65 "interp.r" |
| 279 |
|
| 280 |
rargp = (dptr)(rsp - 1) - 1; |
| 281 |
xargp = rargp; |
| 282 |
sp = rsp;; |
| 283 |
|
| 284 |
//#line 458 "interp.r" |
| 285 |
|
| 286 |
; |
| 287 |
Deref(rargp[1]); |
| 288 |
|
| 289 |
//#line 85 "interp.r" |
| 290 |
|
| 291 |
if ((*(optab[lastop]))(rargp) == A_Resume) { |
| 292 |
|
| 293 |
//#line 89 "interp.r" |
| 294 |
|
| 295 |
goto efail_noev; |
| 296 |
} |
| 297 |
rsp = (word *)rargp + 1; |
| 298 |
|
| 299 |
//#line 95 "interp.r" |
| 300 |
|
| 301 |
break; |
| 302 |
|
| 303 |
//#line 460 "interp.r" |
| 304 |
|
| 305 |
; |
| 306 |
|
| 307 |
case 21: |
| 308 |
case 22: |
| 309 |
|
| 310 |
//#line 65 "interp.r" |
| 311 |
|
| 312 |
rargp = (dptr)(rsp - 1) - 1; |
| 313 |
xargp = rargp; |
| 314 |
sp = rsp;; |
| 315 |
|
| 316 |
//#line 464 "interp.r" |
| 317 |
|
| 318 |
; |
| 319 |
|
| 320 |
//#line 85 "interp.r" |
| 321 |
|
| 322 |
if ((*(optab[lastop]))(rargp) == A_Resume) { |
| 323 |
|
| 324 |
//#line 89 "interp.r" |
| 325 |
|
| 326 |
goto efail_noev; |
| 327 |
} |
| 328 |
rsp = (word *)rargp + 1; |
| 329 |
|
| 330 |
//#line 95 "interp.r" |
| 331 |
|
| 332 |
break; |
| 333 |
|
| 334 |
//#line 465 "interp.r" |
| 335 |
|
| 336 |
; |
| 337 |
|
| 338 |
case 32: |
| 339 |
PushNullSP(rsp); |
| 340 |
|
| 341 |
//#line 65 "interp.r" |
| 342 |
|
| 343 |
rargp = (dptr)(rsp - 1) - 2; |
| 344 |
xargp = rargp; |
| 345 |
sp = rsp;; |
| 346 |
|
| 347 |
//#line 85 "interp.r" |
| 348 |
|
| 349 |
if ((*(optab[lastop]))(rargp) == A_Resume) { |
| 350 |
|
| 351 |
//#line 89 "interp.r" |
| 352 |
|
| 353 |
goto efail_noev; |
| 354 |
} |
| 355 |
rsp = (word *)rargp + 1; |
| 356 |
|
| 357 |
//#line 95 "interp.r" |
| 358 |
|
| 359 |
break; |
| 360 |
|
| 361 |
//#line 474 "interp.r" |
| 362 |
|
| 363 |
case 40: |
| 364 |
|
| 365 |
//#line 65 "interp.r" |
| 366 |
|
| 367 |
rargp = (dptr)(rsp - 1) - 1; |
| 368 |
xargp = rargp; |
| 369 |
sp = rsp;; |
| 370 |
|
| 371 |
//#line 475 "interp.r" |
| 372 |
|
| 373 |
; |
| 374 |
Deref(rargp[1]); |
| 375 |
|
| 376 |
//#line 105 "interp.r" |
| 377 |
|
| 378 |
signal = (*(optab[lastop]))(rargp); |
| 379 |
goto C_rtn_term; |
| 380 |
|
| 381 |
//#line 477 "interp.r" |
| 382 |
|
| 383 |
; |
| 384 |
|
| 385 |
case 2: |
| 386 |
PushNullSP(rsp); |
| 387 |
|
| 388 |
//#line 65 "interp.r" |
| 389 |
|
| 390 |
rargp = (dptr)(rsp - 1) - 2; |
| 391 |
xargp = rargp; |
| 392 |
sp = rsp;; |
| 393 |
|
| 394 |
//#line 481 "interp.r" |
| 395 |
|
| 396 |
; |
| 397 |
|
| 398 |
//#line 105 "interp.r" |
| 399 |
|
| 400 |
signal = (*(optab[lastop]))(rargp); |
| 401 |
goto C_rtn_term; |
| 402 |
|
| 403 |
//#line 482 "interp.r" |
| 404 |
|
| 405 |
; |
| 406 |
|
| 407 |
//#line 486 "interp.r" |
| 408 |
|
| 409 |
case 3: |
| 410 |
case 5: |
| 411 |
case 6: |
| 412 |
case 8: |
| 413 |
case 9: |
| 414 |
case 16: |
| 415 |
case 17: |
| 416 |
case 18: |
| 417 |
case 31: |
| 418 |
case 42: |
| 419 |
case 30: |
| 420 |
case 7: |
| 421 |
case 10: |
| 422 |
case 11: |
| 423 |
case 12: |
| 424 |
case 13: |
| 425 |
case 14: |
| 426 |
case 15: |
| 427 |
case 20: |
| 428 |
case 24: |
| 429 |
case 25: |
| 430 |
case 26: |
| 431 |
case 27: |
| 432 |
case 29: |
| 433 |
case 28: |
| 434 |
|
| 435 |
//#line 65 "interp.r" |
| 436 |
|
| 437 |
rargp = (dptr)(rsp - 1) - 2; |
| 438 |
xargp = rargp; |
| 439 |
sp = rsp;; |
| 440 |
|
| 441 |
//#line 511 "interp.r" |
| 442 |
|
| 443 |
; |
| 444 |
Deref(rargp[1]); |
| 445 |
Deref(rargp[2]); |
| 446 |
|
| 447 |
//#line 85 "interp.r" |
| 448 |
|
| 449 |
if ((*(optab[lastop]))(rargp) == A_Resume) { |
| 450 |
|
| 451 |
//#line 89 "interp.r" |
| 452 |
|
| 453 |
goto efail_noev; |
| 454 |
} |
| 455 |
rsp = (word *)rargp + 1; |
| 456 |
|
| 457 |
//#line 95 "interp.r" |
| 458 |
|
| 459 |
break; |
| 460 |
|
| 461 |
//#line 514 "interp.r" |
| 462 |
|
| 463 |
; |
| 464 |
|
| 465 |
case 1: |
| 466 |
|
| 467 |
//#line 65 "interp.r" |
| 468 |
|
| 469 |
rargp = (dptr)(rsp - 1) - 2; |
| 470 |
xargp = rargp; |
| 471 |
sp = rsp;; |
| 472 |
|
| 473 |
//#line 517 "interp.r" |
| 474 |
|
| 475 |
; |
| 476 |
|
| 477 |
//#line 85 "interp.r" |
| 478 |
|
| 479 |
if ((*(optab[lastop]))(rargp) == A_Resume) { |
| 480 |
|
| 481 |
//#line 89 "interp.r" |
| 482 |
|
| 483 |
goto efail_noev; |
| 484 |
} |
| 485 |
rsp = (word *)rargp + 1; |
| 486 |
|
| 487 |
//#line 95 "interp.r" |
| 488 |
|
| 489 |
break; |
| 490 |
|
| 491 |
//#line 518 "interp.r" |
| 492 |
|
| 493 |
; |
| 494 |
|
| 495 |
case 39: |
| 496 |
PushNullSP(rsp); |
| 497 |
|
| 498 |
//#line 65 "interp.r" |
| 499 |
|
| 500 |
rargp = (dptr)(rsp - 1) - 3; |
| 501 |
xargp = rargp; |
| 502 |
sp = rsp;; |
| 503 |
|
| 504 |
//#line 522 "interp.r" |
| 505 |
|
| 506 |
; |
| 507 |
|
| 508 |
//#line 85 "interp.r" |
| 509 |
|
| 510 |
if ((*(optab[lastop]))(rargp) == A_Resume) { |
| 511 |
|
| 512 |
//#line 89 "interp.r" |
| 513 |
|
| 514 |
goto efail_noev; |
| 515 |
} |
| 516 |
rsp = (word *)rargp + 1; |
| 517 |
|
| 518 |
//#line 95 "interp.r" |
| 519 |
|
| 520 |
break; |
| 521 |
|
| 522 |
//#line 523 "interp.r" |
| 523 |
|
| 524 |
; |
| 525 |
|
| 526 |
case 38: |
| 527 |
PushNullSP(rsp); |
| 528 |
|
| 529 |
//#line 65 "interp.r" |
| 530 |
|
| 531 |
rargp = (dptr)(rsp - 1) - 3; |
| 532 |
xargp = rargp; |
| 533 |
sp = rsp;; |
| 534 |
|
| 535 |
//#line 527 "interp.r" |
| 536 |
|
| 537 |
; |
| 538 |
|
| 539 |
//#line 85 "interp.r" |
| 540 |
|
| 541 |
if ((*(optab[lastop]))(rargp) == A_Resume) { |
| 542 |
|
| 543 |
//#line 89 "interp.r" |
| 544 |
|
| 545 |
goto efail_noev; |
| 546 |
} |
| 547 |
rsp = (word *)rargp + 1; |
| 548 |
|
| 549 |
//#line 95 "interp.r" |
| 550 |
|
| 551 |
break; |
| 552 |
|
| 553 |
//#line 528 "interp.r" |
| 554 |
|
| 555 |
; |
| 556 |
|
| 557 |
//#line 531 "interp.r" |
| 558 |
|
| 559 |
case 33: |
| 560 |
|
| 561 |
//#line 65 "interp.r" |
| 562 |
|
| 563 |
rargp = (dptr)(rsp - 1) - 2; |
| 564 |
xargp = rargp; |
| 565 |
sp = rsp;; |
| 566 |
|
| 567 |
//#line 532 "interp.r" |
| 568 |
|
| 569 |
; |
| 570 |
|
| 571 |
//#line 105 "interp.r" |
| 572 |
|
| 573 |
signal = (*(optab[lastop]))(rargp); |
| 574 |
goto C_rtn_term; |
| 575 |
|
| 576 |
//#line 533 "interp.r" |
| 577 |
|
| 578 |
; |
| 579 |
|
| 580 |
case 35: |
| 581 |
PushNullSP(rsp); |
| 582 |
|
| 583 |
//#line 65 "interp.r" |
| 584 |
|
| 585 |
rargp = (dptr)(rsp - 1) - 3; |
| 586 |
xargp = rargp; |
| 587 |
sp = rsp;; |
| 588 |
|
| 589 |
//#line 537 "interp.r" |
| 590 |
|
| 591 |
; |
| 592 |
|
| 593 |
//#line 105 "interp.r" |
| 594 |
|
| 595 |
signal = (*(optab[lastop]))(rargp); |
| 596 |
goto C_rtn_term; |
| 597 |
|
| 598 |
//#line 538 "interp.r" |
| 599 |
|
| 600 |
; |
| 601 |
|
| 602 |
//#line 542 "interp.r" |
| 603 |
|
| 604 |
case 36: |
| 605 |
PushNullSP(rsp); |
| 606 |
|
| 607 |
//#line 65 "interp.r" |
| 608 |
|
| 609 |
rargp = (dptr)(rsp - 1) - 4; |
| 610 |
xargp = rargp; |
| 611 |
sp = rsp;; |
| 612 |
|
| 613 |
//#line 544 "interp.r" |
| 614 |
|
| 615 |
; |
| 616 |
|
| 617 |
//#line 85 "interp.r" |
| 618 |
|
| 619 |
if ((*(optab[lastop]))(rargp) == A_Resume) { |
| 620 |
|
| 621 |
//#line 89 "interp.r" |
| 622 |
|
| 623 |
goto efail_noev; |
| 624 |
} |
| 625 |
rsp = (word *)rargp + 1; |
| 626 |
|
| 627 |
//#line 95 "interp.r" |
| 628 |
|
| 629 |
break; |
| 630 |
|
| 631 |
//#line 545 "interp.r" |
| 632 |
|
| 633 |
; |
| 634 |
|
| 635 |
//#line 548 "interp.r" |
| 636 |
|
| 637 |
case 41: |
| 638 |
|
| 639 |
//#line 65 "interp.r" |
| 640 |
|
| 641 |
rargp = (dptr)(rsp - 1) - 3; |
| 642 |
xargp = rargp; |
| 643 |
sp = rsp;; |
| 644 |
|
| 645 |
//#line 549 "interp.r" |
| 646 |
|
| 647 |
; |
| 648 |
Deref(rargp[1]); |
| 649 |
Deref(rargp[2]); |
| 650 |
Deref(rargp[3]); |
| 651 |
|
| 652 |
//#line 105 "interp.r" |
| 653 |
|
| 654 |
signal = (*(optab[lastop]))(rargp); |
| 655 |
goto C_rtn_term; |
| 656 |
|
| 657 |
//#line 553 "interp.r" |
| 658 |
|
| 659 |
; |
| 660 |
|
| 661 |
case 98: |
| 662 |
|
| 663 |
//#line 559 "interp.r" |
| 664 |
|
| 665 |
#if GPX //cs |
| 666 |
if (!pollctr--) { |
| 667 |
sp = rsp;; |
| 668 |
pollctr = pollevent(); |
| 669 |
rsp = sp;; |
| 670 |
if (pollctr == -1) fatalerr(141, NULL); |
| 671 |
} |
| 672 |
#endif |
| 673 |
|
| 674 |
//#line 570 "interp.r" |
| 675 |
|
| 676 |
break; |
| 677 |
|
| 678 |
//#line 573 "interp.r" |
| 679 |
|
| 680 |
case 108: |
| 681 |
{ |
| 682 |
|
| 683 |
//#line 583 "interp.r" |
| 684 |
|
| 685 |
break; |
| 686 |
} |
| 687 |
|
| 688 |
case 64: |
| 689 |
|
| 690 |
//#line 590 "interp.r" |
| 691 |
|
| 692 |
#if GPX //cs |
| 693 |
if (!pollctr--) { |
| 694 |
sp = rsp;; |
| 695 |
pollctr = pollevent(); |
| 696 |
rsp = sp;; |
| 697 |
if (pollctr == -1) fatalerr(141, NULL); |
| 698 |
} |
| 699 |
#endif |
| 700 |
|
| 701 |
//#line 606 "interp.r" |
| 702 |
|
| 703 |
break; |
| 704 |
|
| 705 |
//#line 610 "interp.r" |
| 706 |
|
| 707 |
case 44: |
| 708 |
PushDescSP(rsp, k_subject); |
| 709 |
PushValSP(rsp, D_Integer); |
| 710 |
PushValSP(rsp, k_pos); |
| 711 |
|
| 712 |
//#line 79 "interp.r" |
| 713 |
|
| 714 |
rargp = (dptr)(rsp - 1) - 2; |
| 715 |
xargp = rargp; |
| 716 |
sp = rsp;; |
| 717 |
|
| 718 |
//#line 614 "interp.r" |
| 719 |
|
| 720 |
; |
| 721 |
|
| 722 |
signal = Obscan(2, rargp); |
| 723 |
|
| 724 |
goto C_rtn_term; |
| 725 |
|
| 726 |
case 55: |
| 727 |
|
| 728 |
//#line 79 "interp.r" |
| 729 |
|
| 730 |
rargp = (dptr)(rsp - 1) - 1; |
| 731 |
xargp = rargp; |
| 732 |
sp = rsp;; |
| 733 |
|
| 734 |
//#line 621 "interp.r" |
| 735 |
|
| 736 |
; |
| 737 |
|
| 738 |
signal = Oescan(1, rargp); |
| 739 |
|
| 740 |
goto C_rtn_term; |
| 741 |
|
| 742 |
//#line 629 "interp.r" |
| 743 |
|
| 744 |
case 89: { |
| 745 |
apply: //cs |
| 746 |
union block *bp; |
| 747 |
int i, j; |
| 748 |
|
| 749 |
value_tmp = *(dptr)(rsp - 1); |
| 750 |
Deref(value_tmp); |
| 751 |
switch (Type(value_tmp)) { |
| 752 |
case T_List: { |
| 753 |
rsp -= 2; |
| 754 |
bp = BlkLoc(value_tmp); |
| 755 |
args = (int)bp->list.size; |
| 756 |
|
| 757 |
//#line 647 "interp.r" |
| 758 |
|
| 759 |
if (BlkLoc(k_current) == BlkLoc(k_main) && |
| 760 |
((char *)sp + args * sizeof(struct descrip) > |
| 761 |
(char *)stackend)) |
| 762 |
fatalerr(301, NULL); |
| 763 |
|
| 764 |
//#line 653 "interp.r" |
| 765 |
|
| 766 |
for (bp = bp->list.listhead; |
| 767 |
|
| 768 |
//#line 657 "interp.r" |
| 769 |
|
| 770 |
bp != NULL; |
| 771 |
|
| 772 |
bp = bp->lelem.listnext) { |
| 773 |
for (i = 0; i < bp->lelem.nused; i++) { |
| 774 |
j = bp->lelem.first + i; |
| 775 |
if (j >= bp->lelem.nslots) |
| 776 |
j -= bp->lelem.nslots; |
| 777 |
PushDescSP(rsp, bp->lelem.lslots[j]); |
| 778 |
} |
| 779 |
} |
| 780 |
goto invokej; |
| 781 |
} |
| 782 |
|
| 783 |
case T_Record: { |
| 784 |
rsp -= 2; |
| 785 |
bp = BlkLoc(value_tmp); |
| 786 |
args = bp->record.recdesc->proc.nfields; |
| 787 |
for (i = 0; i < args; i++) { |
| 788 |
PushDescSP(rsp, bp->record.fields[i]); |
| 789 |
} |
| 790 |
goto invokej; |
| 791 |
} |
| 792 |
|
| 793 |
default: { |
| 794 |
|
| 795 |
xargp = (dptr)(rsp - 3); |
| 796 |
err_msg(126, &value_tmp); |
| 797 |
goto efail; |
| 798 |
} |
| 799 |
} |
| 800 |
} |
| 801 |
|
| 802 |
case 61: { |
| 803 |
args = (int)(*ipc.opnd++); |
| 804 |
invokej: |
| 805 |
{ |
| 806 |
int nargs; |
| 807 |
dptr carg; |
| 808 |
|
| 809 |
sp = rsp;; |
| 810 |
type = invoke(args, &carg, &nargs); |
| 811 |
rsp = sp;; |
| 812 |
|
| 813 |
if (type == I_Fail) |
| 814 |
goto efail_noev; |
| 815 |
if (type == I_Continue) |
| 816 |
break; |
| 817 |
else { |
| 818 |
|
| 819 |
rargp = carg; |
| 820 |
|
| 821 |
//#line 712 "interp.r" |
| 822 |
|
| 823 |
#if GPX //cs |
| 824 |
pollctr >>= 1; |
| 825 |
if (!pollctr) { |
| 826 |
sp = rsp;; |
| 827 |
pollctr = pollevent(); |
| 828 |
rsp = sp;; |
| 829 |
if (pollctr == -1) fatalerr(141, NULL); |
| 830 |
} |
| 831 |
#endif |
| 832 |
|
| 833 |
//#line 726 "interp.r" |
| 834 |
|
| 835 |
bproc = (struct b_proc *)BlkLoc(*rargp); |
| 836 |
|
| 837 |
//#line 734 "interp.r" |
| 838 |
|
| 839 |
if (type == I_Vararg) { |
| 840 |
// int (*bfunc)(); |
| 841 |
int (*bfunc)(int, dptr); //cs |
| 842 |
// bfunc = bproc->entryp.ccode; |
| 843 |
bfunc = (int (*)(int,dptr))(bproc->entryp.ccode); |
| 844 |
|
| 845 |
//#line 741 "interp.r" |
| 846 |
|
| 847 |
signal = (*bfunc)(nargs, rargp); |
| 848 |
} |
| 849 |
else |
| 850 |
|
| 851 |
//#line 746 "interp.r" |
| 852 |
|
| 853 |
{ |
| 854 |
// int (*bfunc)(); |
| 855 |
int (*bfunc)(dptr); |
| 856 |
// bfunc = bproc->entryp.ccode; |
| 857 |
bfunc = (int (*)(dptr))(bproc->entryp.ccode); |
| 858 |
|
| 859 |
//#line 753 "interp.r" |
| 860 |
|
| 861 |
signal = (*bfunc)(rargp); |
| 862 |
} |
| 863 |
|
| 864 |
//#line 767 "interp.r" |
| 865 |
|
| 866 |
goto C_rtn_term; |
| 867 |
} |
| 868 |
} |
| 869 |
} |
| 870 |
|
| 871 |
case 62: |
| 872 |
|
| 873 |
PushNullSP(rsp); |
| 874 |
opnd = (*ipc.opnd++); |
| 875 |
|
| 876 |
//#line 79 "interp.r" |
| 877 |
|
| 878 |
rargp = (dptr)(rsp - 1) - 0; |
| 879 |
xargp = rargp; |
| 880 |
sp = rsp;; |
| 881 |
|
| 882 |
//#line 776 "interp.r" |
| 883 |
|
| 884 |
; |
| 885 |
|
| 886 |
signal = (*(keytab[(int)opnd]))(rargp); |
| 887 |
goto C_rtn_term; |
| 888 |
|
| 889 |
case 65: |
| 890 |
opnd = (*ipc.opnd++); |
| 891 |
|
| 892 |
//#line 79 "interp.r" |
| 893 |
|
| 894 |
rargp = (dptr)(rsp - 1) - opnd; |
| 895 |
xargp = rargp; |
| 896 |
sp = rsp;; |
| 897 |
|
| 898 |
//#line 793 "interp.r" |
| 899 |
|
| 900 |
; |
| 901 |
|
| 902 |
//#line 796 "interp.r" |
| 903 |
|
| 904 |
{ |
| 905 |
int i; |
| 906 |
for (i = 1; i <= opnd; i++) |
| 907 |
Deref(rargp[i]); |
| 908 |
} |
| 909 |
|
| 910 |
signal = Ollist((int)opnd, rargp); |
| 911 |
|
| 912 |
goto C_rtn_term; |
| 913 |
|
| 914 |
//#line 808 "interp.r" |
| 915 |
|
| 916 |
case 67: |
| 917 |
ipc.op[-1] = (96); |
| 918 |
opnd = (*ipc.opnd++); |
| 919 |
opnd += (word)ipc.opnd; |
| 920 |
ipc.opnd[-1] = (opnd); |
| 921 |
newefp = (struct ef_marker *)(rsp + 1); |
| 922 |
newefp->ef_failure.opnd = (word *)opnd; |
| 923 |
goto mark; |
| 924 |
|
| 925 |
case 96: |
| 926 |
newefp = (struct ef_marker *)(rsp + 1); |
| 927 |
newefp->ef_failure.opnd = (word *)(*ipc.opnd++); |
| 928 |
mark: |
| 929 |
newefp->ef_gfp = gfp; |
| 930 |
newefp->ef_efp = efp; |
| 931 |
newefp->ef_ilevel = ilevel; |
| 932 |
rsp += ((sizeof((*efp)) + sizeof(word) - 1) / sizeof(word)); |
| 933 |
efp = newefp; |
| 934 |
gfp = 0; |
| 935 |
break; |
| 936 |
|
| 937 |
case 85: |
| 938 |
mark0: |
| 939 |
newefp = (struct ef_marker *)(rsp + 1); |
| 940 |
newefp->ef_failure.opnd = 0; |
| 941 |
newefp->ef_gfp = gfp; |
| 942 |
newefp->ef_efp = efp; |
| 943 |
newefp->ef_ilevel = ilevel; |
| 944 |
rsp += ((sizeof((*efp)) + sizeof(word) - 1) / sizeof(word)); |
| 945 |
efp = newefp; |
| 946 |
gfp = 0; |
| 947 |
break; |
| 948 |
|
| 949 |
case 78: |
| 950 |
|
| 951 |
//#line 849 "interp.r" |
| 952 |
|
| 953 |
gfp = efp->ef_gfp; |
| 954 |
rsp = (word *)efp - 1; |
| 955 |
|
| 956 |
//#line 855 "interp.r" |
| 957 |
|
| 958 |
Unmark_uw: |
| 959 |
if (efp->ef_ilevel < ilevel) { |
| 960 |
--ilevel; |
| 961 |
|
| 962 |
sp = rsp;; |
| 963 |
|
| 964 |
//#line 866 "interp.r" |
| 965 |
|
| 966 |
return A_Unmark_uw; |
| 967 |
} |
| 968 |
|
| 969 |
efp = efp->ef_efp; |
| 970 |
break; |
| 971 |
|
| 972 |
//#line 874 "interp.r" |
| 973 |
|
| 974 |
case 56: { |
| 975 |
|
| 976 |
//#line 879 "interp.r" |
| 977 |
|
| 978 |
oldsp = rsp; |
| 979 |
newgfp = (struct gf_marker *)(rsp + 1); |
| 980 |
newgfp->gf_gentype = G_Esusp; |
| 981 |
newgfp->gf_gfp = gfp; |
| 982 |
newgfp->gf_efp = efp; |
| 983 |
newgfp->gf_ipc = ipc; |
| 984 |
gfp = newgfp; |
| 985 |
rsp += ((sizeof(struct gf_smallmarker) + sizeof(word) - 1) / sizeof(word)); |
| 986 |
|
| 987 |
//#line 892 "interp.r" |
| 988 |
|
| 989 |
if (efp->ef_gfp != 0) { |
| 990 |
newgfp = (struct gf_marker *)(efp->ef_gfp); |
| 991 |
if (newgfp->gf_gentype == G_Psusp) |
| 992 |
firstwd = (word *)efp->ef_gfp + ((sizeof((*gfp)) + sizeof(word) - 1) / sizeof(word)); |
| 993 |
else |
| 994 |
firstwd = (word *)efp->ef_gfp + |
| 995 |
((sizeof(struct gf_smallmarker) + sizeof(word) - 1) / sizeof(word)); |
| 996 |
} |
| 997 |
else |
| 998 |
firstwd = (word *)efp->ef_efp + ((sizeof((*efp)) + sizeof(word) - 1) / sizeof(word)); |
| 999 |
lastwd = (word *)efp - 1; |
| 1000 |
efp = efp->ef_efp; |
| 1001 |
|
| 1002 |
//#line 909 "interp.r" |
| 1003 |
|
| 1004 |
for (wd = firstwd; wd <= lastwd; wd++) |
| 1005 |
*++rsp = *wd; |
| 1006 |
PushValSP(rsp, oldsp[-1]); |
| 1007 |
PushValSP(rsp, oldsp[0]); |
| 1008 |
break; |
| 1009 |
} |
| 1010 |
|
| 1011 |
case 66: { |
| 1012 |
struct descrip sval; |
| 1013 |
|
| 1014 |
//#line 924 "interp.r" |
| 1015 |
|
| 1016 |
// dptr lval = (dptr)((word *)efp - 2); |
| 1017 |
lval = (dptr)((word *)efp - 2); //cs |
| 1018 |
|
| 1019 |
//#line 929 "interp.r" |
| 1020 |
|
| 1021 |
if (--IntVal(*lval) > 0) { |
| 1022 |
|
| 1023 |
//#line 934 "interp.r" |
| 1024 |
|
| 1025 |
sval = *(dptr)(rsp - 1); |
| 1026 |
|
| 1027 |
//#line 941 "interp.r" |
| 1028 |
|
| 1029 |
if (efp->ef_gfp != 0) { |
| 1030 |
newgfp = (struct gf_marker *)(efp->ef_gfp); |
| 1031 |
if (newgfp->gf_gentype == G_Psusp) |
| 1032 |
firstwd = (word *)efp->ef_gfp + ((sizeof((*gfp)) + sizeof(word) - 1) / sizeof(word)); |
| 1033 |
else |
| 1034 |
firstwd = (word *)efp->ef_gfp + |
| 1035 |
((sizeof(struct gf_smallmarker) + sizeof(word) - 1) / sizeof(word)); |
| 1036 |
} |
| 1037 |
else |
| 1038 |
firstwd = (word *)efp->ef_efp + ((sizeof((*efp)) + sizeof(word) - 1) / sizeof(word)); |
| 1039 |
lastwd = (word *)efp - 3; |
| 1040 |
if (gfp == 0) |
| 1041 |
gfp = efp->ef_gfp; |
| 1042 |
efp = efp->ef_efp; |
| 1043 |
|
| 1044 |
//#line 960 "interp.r" |
| 1045 |
|
| 1046 |
rsp -= 2; |
| 1047 |
for (wd = firstwd; wd <= lastwd; wd++) |
| 1048 |
*++rsp = *wd; |
| 1049 |
PushDescSP(rsp, sval); |
| 1050 |
} |
| 1051 |
else { |
| 1052 |
|
| 1053 |
//#line 973 "interp.r" |
| 1054 |
|
| 1055 |
*lval = *(dptr)(rsp - 1); |
| 1056 |
|
| 1057 |
//#line 981 "interp.r" |
| 1058 |
|
| 1059 |
gfp = efp->ef_gfp; |
| 1060 |
|
| 1061 |
//#line 987 "interp.r" |
| 1062 |
|
| 1063 |
Lsusp_uw: |
| 1064 |
if (efp->ef_ilevel < ilevel) { |
| 1065 |
--ilevel; |
| 1066 |
sp = rsp;; |
| 1067 |
|
| 1068 |
//#line 997 "interp.r" |
| 1069 |
|
| 1070 |
return A_Lsusp_uw; |
| 1071 |
} |
| 1072 |
rsp = (word *)efp - 1; |
| 1073 |
efp = efp->ef_efp; |
| 1074 |
} |
| 1075 |
break; |
| 1076 |
} |
| 1077 |
|
| 1078 |
case 72: { |
| 1079 |
|
| 1080 |
//#line 1015 "interp.r" |
| 1081 |
|
| 1082 |
struct descrip tmp; |
| 1083 |
dptr svalp; |
| 1084 |
struct b_proc *sproc; |
| 1085 |
|
| 1086 |
//#line 1025 "interp.r" |
| 1087 |
|
| 1088 |
svalp = (dptr)(rsp - 1); |
| 1089 |
if (Var(*svalp)) { |
| 1090 |
sp = rsp;; |
| 1091 |
retderef(svalp, (word *)glbl_argp, sp); |
| 1092 |
rsp = sp;; |
| 1093 |
} |
| 1094 |
|
| 1095 |
//#line 1035 "interp.r" |
| 1096 |
|
| 1097 |
oldsp = rsp; |
| 1098 |
newgfp = (struct gf_marker *)(rsp + 1); |
| 1099 |
newgfp->gf_gentype = G_Psusp; |
| 1100 |
newgfp->gf_gfp = gfp; |
| 1101 |
newgfp->gf_efp = efp; |
| 1102 |
newgfp->gf_ipc = ipc; |
| 1103 |
newgfp->gf_argp = glbl_argp; |
| 1104 |
newgfp->gf_pfp = pfp; |
| 1105 |
gfp = newgfp; |
| 1106 |
rsp += ((sizeof((*gfp)) + sizeof(word) - 1) / sizeof(word)); |
| 1107 |
|
| 1108 |
//#line 1051 "interp.r" |
| 1109 |
|
| 1110 |
if (pfp->pf_gfp != 0) { |
| 1111 |
newgfp = (struct gf_marker *)(pfp->pf_gfp); |
| 1112 |
if (newgfp->gf_gentype == G_Psusp) |
| 1113 |
firstwd = (word *)pfp->pf_gfp + ((sizeof((*gfp)) + sizeof(word) - 1) / sizeof(word)); |
| 1114 |
else |
| 1115 |
firstwd = (word *)pfp->pf_gfp + |
| 1116 |
((sizeof(struct gf_smallmarker) + sizeof(word) - 1) / sizeof(word)); |
| 1117 |
} |
| 1118 |
else |
| 1119 |
firstwd = (word *)pfp->pf_efp + ((sizeof((*efp)) + sizeof(word) - 1) / sizeof(word)); |
| 1120 |
lastwd = (word *)glbl_argp - 1; |
| 1121 |
efp = efp->ef_efp; |
| 1122 |
|
| 1123 |
//#line 1068 "interp.r" |
| 1124 |
|
| 1125 |
for (wd = firstwd; wd <= lastwd; wd++) |
| 1126 |
*++rsp = *wd; |
| 1127 |
PushValSP(rsp, oldsp[-1]); |
| 1128 |
PushValSP(rsp, oldsp[0]); |
| 1129 |
--k_level; |
| 1130 |
if (k_trace) { |
| 1131 |
k_trace--; |
| 1132 |
sproc = (struct b_proc *)BlkLoc(*glbl_argp); |
| 1133 |
strace(&(sproc->pname), svalp); |
| 1134 |
} |
| 1135 |
|
| 1136 |
//#line 1083 "interp.r" |
| 1137 |
|
| 1138 |
if (pfp->pf_scan != NULL) { |
| 1139 |
|
| 1140 |
//#line 1089 "interp.r" |
| 1141 |
|
| 1142 |
tmp = k_subject; |
| 1143 |
k_subject = *pfp->pf_scan; |
| 1144 |
*pfp->pf_scan = tmp; |
| 1145 |
|
| 1146 |
tmp = *(pfp->pf_scan + 1); |
| 1147 |
IntVal(*(pfp->pf_scan + 1)) = k_pos; |
| 1148 |
k_pos = IntVal(tmp); |
| 1149 |
} |
| 1150 |
|
| 1151 |
//#line 1106 "interp.r" |
| 1152 |
|
| 1153 |
efp = pfp->pf_efp; |
| 1154 |
ipc = pfp->pf_ipc; |
| 1155 |
glbl_argp = pfp->pf_argp; |
| 1156 |
pfp = pfp->pf_pfp; |
| 1157 |
break; |
| 1158 |
} |
| 1159 |
|
| 1160 |
//#line 1115 "interp.r" |
| 1161 |
|
| 1162 |
case 54: { |
| 1163 |
|
| 1164 |
//#line 1124 "interp.r" |
| 1165 |
|
| 1166 |
eret_tmp = *(dptr)&rsp[-1]; |
| 1167 |
gfp = efp->ef_gfp; |
| 1168 |
Eret_uw: |
| 1169 |
|
| 1170 |
//#line 1131 "interp.r" |
| 1171 |
|
| 1172 |
if (efp->ef_ilevel < ilevel) { |
| 1173 |
--ilevel; |
| 1174 |
sp = rsp;; |
| 1175 |
|
| 1176 |
//#line 1140 "interp.r" |
| 1177 |
|
| 1178 |
return A_Eret_uw; |
| 1179 |
} |
| 1180 |
rsp = (word *)efp - 1; |
| 1181 |
efp = efp->ef_efp; |
| 1182 |
PushDescSP(rsp, eret_tmp); |
| 1183 |
break; |
| 1184 |
} |
| 1185 |
|
| 1186 |
//#line 1149 "interp.r" |
| 1187 |
|
| 1188 |
case 71: { |
| 1189 |
|
| 1190 |
//#line 1163 "interp.r" |
| 1191 |
|
| 1192 |
struct b_proc *rproc; |
| 1193 |
rproc = (struct b_proc *)BlkLoc(*glbl_argp); |
| 1194 |
|
| 1195 |
//#line 1173 "interp.r" |
| 1196 |
|
| 1197 |
*glbl_argp = *(dptr)(rsp - 1); |
| 1198 |
if (Var(*glbl_argp)) { |
| 1199 |
sp = rsp;; |
| 1200 |
retderef(glbl_argp, (word *)glbl_argp, sp); |
| 1201 |
rsp = sp;; |
| 1202 |
} |
| 1203 |
|
| 1204 |
--k_level; |
| 1205 |
if (k_trace) { |
| 1206 |
k_trace--; |
| 1207 |
rtrace(&(rproc->pname), glbl_argp); |
| 1208 |
} |
| 1209 |
Pret_uw: |
| 1210 |
if (pfp->pf_ilevel < ilevel) { |
| 1211 |
--ilevel; |
| 1212 |
sp = rsp;; |
| 1213 |
|
| 1214 |
//#line 1196 "interp.r" |
| 1215 |
|
| 1216 |
return A_Pret_uw; |
| 1217 |
} |
| 1218 |
|
| 1219 |
//#line 1203 "interp.r" |
| 1220 |
|
| 1221 |
rsp = (word *)glbl_argp + 1; |
| 1222 |
efp = pfp->pf_efp; |
| 1223 |
gfp = pfp->pf_gfp; |
| 1224 |
ipc = pfp->pf_ipc; |
| 1225 |
glbl_argp = pfp->pf_argp; |
| 1226 |
pfp = pfp->pf_pfp; |
| 1227 |
|
| 1228 |
//#line 1219 "interp.r" |
| 1229 |
|
| 1230 |
//cs return to C++ |
| 1231 |
if( rsp == return_sp ) { |
| 1232 |
//printf("Op_Pret caused a return to C++\n");fflush(stdout); |
| 1233 |
--ilevel; |
| 1234 |
*result = *return_cargp; |
| 1235 |
sp = saved_sp; |
| 1236 |
return 0; |
| 1237 |
} |
| 1238 |
//cs end return to C++ |
| 1239 |
break; |
| 1240 |
} |
| 1241 |
|
| 1242 |
//#line 1224 "interp.r" |
| 1243 |
|
| 1244 |
case 53: |
| 1245 |
efail: |
| 1246 |
|
| 1247 |
//#line 1229 "interp.r" |
| 1248 |
|
| 1249 |
efail_noev: |
| 1250 |
|
| 1251 |
//#line 1233 "interp.r" |
| 1252 |
|
| 1253 |
if (gfp == 0) { |
| 1254 |
|
| 1255 |
//#line 1251 "interp.r" |
| 1256 |
|
| 1257 |
ipc = efp->ef_failure; |
| 1258 |
gfp = efp->ef_gfp; |
| 1259 |
rsp = (word *)efp - 1; |
| 1260 |
efp = efp->ef_efp; |
| 1261 |
|
| 1262 |
if (ipc.op == 0) |
| 1263 |
goto efail; |
| 1264 |
break; |
| 1265 |
} |
| 1266 |
else |
| 1267 |
{ |
| 1268 |
|
| 1269 |
//#line 1267 "interp.r" |
| 1270 |
|
| 1271 |
struct descrip tmp; |
| 1272 |
register struct gf_marker *resgfp = gfp; |
| 1273 |
|
| 1274 |
type = (int)resgfp->gf_gentype; |
| 1275 |
|
| 1276 |
if (type == G_Psusp) { |
| 1277 |
glbl_argp = resgfp->gf_argp; |
| 1278 |
if (k_trace) { |
| 1279 |
k_trace--; |
| 1280 |
sp = rsp;; |
| 1281 |
atrace(&(((struct b_proc *)BlkLoc(*glbl_argp))->pname)); |
| 1282 |
rsp = sp;; |
| 1283 |
} |
| 1284 |
} |
| 1285 |
ipc = resgfp->gf_ipc; |
| 1286 |
efp = resgfp->gf_efp; |
| 1287 |
gfp = resgfp->gf_gfp; |
| 1288 |
rsp = (word *)resgfp - 1; |
| 1289 |
if (type == G_Psusp) { |
| 1290 |
pfp = resgfp->gf_pfp; |
| 1291 |
|
| 1292 |
//#line 1292 "interp.r" |
| 1293 |
|
| 1294 |
if (pfp->pf_scan != NULL) { |
| 1295 |
tmp = k_subject; |
| 1296 |
k_subject = *pfp->pf_scan; |
| 1297 |
*pfp->pf_scan = tmp; |
| 1298 |
|
| 1299 |
tmp = *(pfp->pf_scan + 1); |
| 1300 |
IntVal(*(pfp->pf_scan + 1)) = k_pos; |
| 1301 |
k_pos = IntVal(tmp); |
| 1302 |
} |
| 1303 |
|
| 1304 |
//#line 1313 "interp.r" |
| 1305 |
|
| 1306 |
++k_level; |
| 1307 |
} |
| 1308 |
|
| 1309 |
switch (type) { |
| 1310 |
|
| 1311 |
//#line 1336 "interp.r" |
| 1312 |
|
| 1313 |
case G_Csusp: |
| 1314 |
; |
| 1315 |
--ilevel; |
| 1316 |
sp = rsp;; |
| 1317 |
|
| 1318 |
//#line 1344 "interp.r" |
| 1319 |
|
| 1320 |
return A_Resume; |
| 1321 |
|
| 1322 |
case G_Esusp: |
| 1323 |
; |
| 1324 |
goto efail_noev; |
| 1325 |
|
| 1326 |
case G_Psusp: |
| 1327 |
; |
| 1328 |
break; |
| 1329 |
} |
| 1330 |
|
| 1331 |
break; |
| 1332 |
} |
| 1333 |
|
| 1334 |
case 68: { |
| 1335 |
|
| 1336 |
//#line 1374 "interp.r" |
| 1337 |
|
| 1338 |
--k_level; |
| 1339 |
if (k_trace) { |
| 1340 |
k_trace--; |
| 1341 |
failtrace(&(((struct b_proc *)BlkLoc(*glbl_argp))->pname)); |
| 1342 |
} |
| 1343 |
Pfail_uw: |
| 1344 |
|
| 1345 |
if (pfp->pf_ilevel < ilevel) { |
| 1346 |
--ilevel; |
| 1347 |
sp = rsp;; |
| 1348 |
|
| 1349 |
//#line 1388 "interp.r" |
| 1350 |
|
| 1351 |
return A_Pfail_uw; |
| 1352 |
} |
| 1353 |
efp = pfp->pf_efp; |
| 1354 |
gfp = pfp->pf_gfp; |
| 1355 |
ipc = pfp->pf_ipc; |
| 1356 |
glbl_argp = pfp->pf_argp; |
| 1357 |
pfp = pfp->pf_pfp; |
| 1358 |
|
| 1359 |
//#line 1406 "interp.r" |
| 1360 |
|
| 1361 |
goto efail_noev; |
| 1362 |
} |
| 1363 |
|
| 1364 |
//#line 1410 "interp.r" |
| 1365 |
|
| 1366 |
case 45: |
| 1367 |
PushNullSP(rsp); |
| 1368 |
PushValSP(rsp, ((word *)efp)[-2]); |
| 1369 |
PushValSP(rsp, ((word *)efp)[-1]); |
| 1370 |
break; |
| 1371 |
|
| 1372 |
case 46: |
| 1373 |
opnd = (*ipc.opnd++); |
| 1374 |
opnd += (word)ipc.opnd; |
| 1375 |
efp->ef_failure.opnd = (word *)opnd; |
| 1376 |
break; |
| 1377 |
|
| 1378 |
case 52: |
| 1379 |
PushNullSP(rsp); |
| 1380 |
rsp[1] = rsp[-3]; |
| 1381 |
rsp[2] = rsp[-2]; |
| 1382 |
rsp += 2; |
| 1383 |
break; |
| 1384 |
|
| 1385 |
case 57: |
| 1386 |
PushValSP(rsp, D_Integer); |
| 1387 |
PushValSP(rsp, (*ipc.opnd++)); |
| 1388 |
|
| 1389 |
//#line 79 "interp.r" |
| 1390 |
|
| 1391 |
rargp = (dptr)(rsp - 1) - 2; |
| 1392 |
xargp = rargp; |
| 1393 |
sp = rsp;; |
| 1394 |
|
| 1395 |
//#line 1432 "interp.r" |
| 1396 |
|
| 1397 |
; |
| 1398 |
|
| 1399 |
signal = Ofield(2, rargp); |
| 1400 |
|
| 1401 |
goto C_rtn_term; |
| 1402 |
|
| 1403 |
case 58: |
| 1404 |
ipc.op[-1] = (95); |
| 1405 |
opnd = (*ipc.opnd++); |
| 1406 |
opnd += (word)ipc.opnd; |
| 1407 |
ipc.opnd[-1] = (opnd); |
| 1408 |
ipc.opnd = (word *)opnd; |
| 1409 |
break; |
| 1410 |
|
| 1411 |
case 95: |
| 1412 |
opnd = (*ipc.opnd++); |
| 1413 |
ipc.opnd = (word *)opnd; |
| 1414 |
break; |
| 1415 |
|
| 1416 |
case 59: |
| 1417 |
*--ipc.op = 58; |
| 1418 |
opnd = sizeof((*ipc.op)) + sizeof((*rsp)); |
| 1419 |
opnd += (word)ipc.opnd; |
| 1420 |
ipc.opnd = (word *)opnd; |
| 1421 |
break; |
| 1422 |
|
| 1423 |
case 63: |
| 1424 |
|
| 1425 |
//#line 79 "interp.r" |
| 1426 |
|
| 1427 |
rargp = (dptr)(rsp - 1) - 0; |
| 1428 |
xargp = rargp; |
| 1429 |
sp = rsp;; |
| 1430 |
|
| 1431 |
//#line 1459 "interp.r" |
| 1432 |
|
| 1433 |
; |
| 1434 |
|
| 1435 |
if (Olimit(0, rargp) == A_Resume) { |
| 1436 |
|
| 1437 |
//#line 1468 "interp.r" |
| 1438 |
|
| 1439 |
goto efail_noev; |
| 1440 |
} |
| 1441 |
else { |
| 1442 |
|
| 1443 |
//#line 1476 "interp.r" |
| 1444 |
|
| 1445 |
rsp = (word *)rargp + 1; |
| 1446 |
} |
| 1447 |
goto mark0; |
| 1448 |
|
| 1449 |
//#line 1486 "interp.r" |
| 1450 |
|
| 1451 |
case 69: |
| 1452 |
PushNullSP(rsp); |
| 1453 |
break; |
| 1454 |
|
| 1455 |
case 70: |
| 1456 |
rsp -= 2; |
| 1457 |
break; |
| 1458 |
|
| 1459 |
case 73: |
| 1460 |
PushValSP(rsp, D_Integer); |
| 1461 |
PushValSP(rsp, 1); |
| 1462 |
break; |
| 1463 |
|
| 1464 |
case 74: |
| 1465 |
PushValSP(rsp, D_Integer); |
| 1466 |
PushValSP(rsp, -1); |
| 1467 |
break; |
| 1468 |
|
| 1469 |
case 76: |
| 1470 |
rsp += 2; |
| 1471 |
rsp[-1] = rsp[-3]; |
| 1472 |
rsp[0] = rsp[-2]; |
| 1473 |
break; |
| 1474 |
|
| 1475 |
//#line 1512 "interp.r" |
| 1476 |
|
| 1477 |
case 50: |
| 1478 |
|
| 1479 |
//#line 1515 "interp.r" |
| 1480 |
|
| 1481 |
PushNullSP(rsp); |
| 1482 |
|
| 1483 |
//#line 79 "interp.r" |
| 1484 |
|
| 1485 |
rargp = (dptr)(rsp - 1) - 0; |
| 1486 |
xargp = rargp; |
| 1487 |
sp = rsp;; |
| 1488 |
|
| 1489 |
//#line 1516 "interp.r" |
| 1490 |
|
| 1491 |
; |
| 1492 |
opnd = (*ipc.opnd++); |
| 1493 |
opnd += (word)ipc.opnd; |
| 1494 |
|
| 1495 |
signal = Ocreate((word *)opnd, rargp); |
| 1496 |
|
| 1497 |
goto C_rtn_term; |
| 1498 |
|
| 1499 |
//#line 1528 "interp.r" |
| 1500 |
|
| 1501 |
case 47: { |
| 1502 |
|
| 1503 |
//#line 1534 "interp.r" |
| 1504 |
|
| 1505 |
struct b_coexpr *ncp; |
| 1506 |
dptr dp; |
| 1507 |
|
| 1508 |
sp = rsp;; |
| 1509 |
dp = (dptr)(sp - 1); |
| 1510 |
xargp = dp - 2; |
| 1511 |
|
| 1512 |
Deref(*dp); |
| 1513 |
if (dp->dword != D_Coexpr) { |
| 1514 |
err_msg(118, dp); |
| 1515 |
goto efail; |
| 1516 |
} |
| 1517 |
|
| 1518 |
ncp = (struct b_coexpr *)BlkLoc(*dp); |
| 1519 |
|
| 1520 |
signal = activate((dptr)(sp - 3), ncp, (dptr)(sp - 3)); |
| 1521 |
rsp = sp;; |
| 1522 |
if (signal == A_Resume) |
| 1523 |
goto efail_noev; |
| 1524 |
else |
| 1525 |
rsp -= 2; |
| 1526 |
|
| 1527 |
break; |
| 1528 |
} |
| 1529 |
|
| 1530 |
case 49: { |
| 1531 |
|
| 1532 |
//#line 1564 "interp.r" |
| 1533 |
|
| 1534 |
struct b_coexpr *ncp; |
| 1535 |
|
| 1536 |
sp = rsp;; |
| 1537 |
ncp = popact((struct b_coexpr *)BlkLoc(k_current)); |
| 1538 |
|
| 1539 |
++BlkLoc(k_current)->coexpr.size; |
| 1540 |
co_chng(ncp, (dptr)&sp[-1], NULL, A_Coret, 1); |
| 1541 |
rsp = sp;; |
| 1542 |
|
| 1543 |
break; |
| 1544 |
} |
| 1545 |
|
| 1546 |
//#line 1577 "interp.r" |
| 1547 |
|
| 1548 |
case 48: { |
| 1549 |
|
| 1550 |
//#line 1582 "interp.r" |
| 1551 |
|
| 1552 |
struct b_coexpr *ncp; |
| 1553 |
|
| 1554 |
sp = rsp;; |
| 1555 |
ncp = popact((struct b_coexpr *)BlkLoc(k_current)); |
| 1556 |
|
| 1557 |
co_chng(ncp, NULL, NULL, A_Cofail, 1); |
| 1558 |
rsp = sp;; |
| 1559 |
|
| 1560 |
break; |
| 1561 |
} |
| 1562 |
|
| 1563 |
case 86: |
| 1564 |
|
| 1565 |
//#line 1596 "interp.r" |
| 1566 |
|
| 1567 |
goto interp_quit; |
| 1568 |
|
| 1569 |
//#line 1599 "interp.r" |
| 1570 |
|
| 1571 |
default: { |
| 1572 |
char buf[50]; |
| 1573 |
|
| 1574 |
sprintf(buf, "unimplemented opcode: %ld (0x%08x)\n", |
| 1575 |
(long)lastop, lastop); |
| 1576 |
syserr(buf); |
| 1577 |
} |
| 1578 |
} |
| 1579 |
continue; |
| 1580 |
|
| 1581 |
C_rtn_term: |
| 1582 |
rsp = sp;; |
| 1583 |
|
| 1584 |
switch (signal) { |
| 1585 |
|
| 1586 |
case A_Resume: |
| 1587 |
|
| 1588 |
//#line 1622 "interp.r" |
| 1589 |
|
| 1590 |
goto efail_noev; |
| 1591 |
|
| 1592 |
case A_Unmark_uw: |
| 1593 |
|
| 1594 |
//#line 1631 "interp.r" |
| 1595 |
|
| 1596 |
goto Unmark_uw; |
| 1597 |
|
| 1598 |
case A_Lsusp_uw: |
| 1599 |
|
| 1600 |
//#line 1640 "interp.r" |
| 1601 |
|
| 1602 |
goto Lsusp_uw; |
| 1603 |
|
| 1604 |
case A_Eret_uw: |
| 1605 |
|
| 1606 |
//#line 1649 "interp.r" |
| 1607 |
|
| 1608 |
goto Eret_uw; |
| 1609 |
|
| 1610 |
case A_Pret_uw: |
| 1611 |
|
| 1612 |
//#line 1658 "interp.r" |
| 1613 |
|
| 1614 |
goto Pret_uw; |
| 1615 |
|
| 1616 |
case A_Pfail_uw: |
| 1617 |
|
| 1618 |
//#line 1667 "interp.r" |
| 1619 |
|
| 1620 |
goto Pfail_uw; |
| 1621 |
} |
| 1622 |
|
| 1623 |
rsp = (word *)rargp + 1; |
| 1624 |
|
| 1625 |
//#line 1682 "interp.r" |
| 1626 |
|
| 1627 |
continue; |
| 1628 |
} |
| 1629 |
|
| 1630 |
interp_quit: |
| 1631 |
--ilevel; |
| 1632 |
if (ilevel != 0) |
| 1633 |
syserror("interp: termination with inactive generators."); |
| 1634 |
|
| 1635 |
return 0; |
| 1636 |
} |
| 1637 |
|
| 1638 |
} //cs --- extern "C" |