1: #include "../h/config.h" 2: /* 3: * pfail - returns from an Icon procedure with failure. 4: * The current procedure frame is exited and efail causes 5: * the failure of the enclosing expression. A tracing 6: * message is produced if &trace is non-zero. 7: */ 8: Global(_k_level) 9: Global(_k_trace) 10: Global(_efail) 11: Global(_ftrace) 12: Global(_pfail) 13: Global(_line) 14: Global(_file) 15: 16: #ifdef VAX 17: _pfail: 18: decl _k_level # A procedure is being exited, so 19: # decrement &level. 20: tstl _k_trace # If &trace is zero, 21: beql dofail # no tracing. 22: # 23: # Otherwise, a trace message is 24: # produced by calling ftrace with 25: # the address of the block of the 26: # failing procedure. 27: # &arg0 = (nargs * 8) + 8 + ap 28: ashl $3,4(ap),r0 # r0 = nargs * 8 29: addl2 $8,r0 # + 8 30: addl3 r0,ap,r0 # + ap 31: # r0 points to descriptor for procedure 32: pushl 4(r0) # and second word is address of block 33: calls $1,_ftrace # ftrace(&arg0) 34: 35: dofail: 36: movl -4(fp),_line # Restore _line, 37: movl -8(fp),_file # _file, 38: movl -4(ap),efp # expression frame pointer, 39: movl -8(ap),gfp # generator frame pointer, 40: movl -12(ap),ipc # interpreter pc, 41: movl 8(fp),ap # ap, 42: movl 12(fp),fp # and fp from failing procedure frame 43: jmp _efail # Cause failure in expression by 44: # branching to efail 45: #endif VAX 46: 47: #ifdef PORT 48: DummyFcn(_pfail) 49: #endif PORT 50: #ifdef PDP11 51: / pfail - return from an Icon procedure with failure. 52: / Exit the current procedure frame, and branch to _efail. 53: Global(_boundary) 54: 55: _pfail: 56: dec _k_level / decrement &level 57: 58: / Print trace message if &trace is set. 59: 60: tst _k_trace 61: beq 1f 62: mov 4(r5),r0 / calculate address of arg0 63: asl r0 / r0 <- r5 + 4*nargs + 6 64: asl r0 65: add r5,r0 66: add $6,r0 67: mov 2(r0),-(sp) / push address of failing procedure block 68: mov $1,_boundary / prevent csv from setting boundary 69: jsr pc,_ftrace 70: clr _boundary 71: tst (sp)+ / pop address of procedure block 72: 73: / Exit the procedure frame, decrement &level, and jump to efail. 74: 75: 1: 76: mov r5,r0 77: mov -(r0),r4 78: mov -(r0),r3 79: mov -(r0),r2 80: mov -(r0),_line 81: mov -(r0),_file 82: mov r5,sp 83: mov (sp)+,r5 84: jmp _efail / pass failure to expression frame 85: #endif PDP11