427 |
427 |
428 /* |
428 /* |
429 * this special nil test is for the very first context (startup-context); |
429 * this special nil test is for the very first context (startup-context); |
430 * actually, its cosmetics, to avoid a visible nil>>nil context in the debugger. |
430 * actually, its cosmetics, to avoid a visible nil>>nil context in the debugger. |
431 */ |
431 */ |
432 |
432 theContext = __INST(sender); |
433 if (__isNonNilObject(theContext = __INST(sender))) { |
433 if (__isNonNilObject(theContext)) { |
|
434 |
434 if (__isLazy(theContext)) { |
435 if (__isLazy(theContext)) { |
435 /* |
436 /* |
436 * this cannot happen |
437 * this cannot happen |
437 */ |
438 */ |
438 _PATCHUPCONTEXT(theContext); |
439 _PATCHUPCONTEXT(theContext); |
560 unrestartable or of a block (which is never restartable) |
561 unrestartable or of a block (which is never restartable) |
561 " |
562 " |
562 ^ InvalidReturnSignal |
563 ^ InvalidReturnSignal |
563 raiseRequestWith:value |
564 raiseRequestWith:value |
564 errorString:(how , ': context cannot be restarted/returned from') |
565 errorString:(how , ': context cannot be restarted/returned from') |
|
566 ! ! |
|
567 |
|
568 !Context methodsFor:'exception support'! |
|
569 |
|
570 findContextWithSelector:selector1 or:selector2 |
|
571 "walk along the sender chain, for a context with |
|
572 the given selector. |
|
573 This non-standard interface is only to be used by exception" |
|
574 |
|
575 "/ this could have been implemented as: |
|
576 "/ |
|
577 "/ |sender| |
|
578 "/ |
|
579 "/ self selector == aSelector ifTrue:[^ self]. |
|
580 "/ sender := self sender. |
|
581 "/ sender notNil ifTrue:[^ sender findContextWithSelector:aSelector]. |
|
582 "/ ^ nil |
|
583 "/ |
|
584 "/ and the code below actually does this (somewhat faster, though). |
|
585 |
|
586 %{ /* NOCONTEXT */ |
|
587 |
|
588 OBJ theContext; |
|
589 OBJ sel; |
|
590 |
|
591 /* |
|
592 * this special nil test is for the very first context (startup-context); |
|
593 * actually, its cosmetics, to avoid a visible nil>>nil context in the debugger. |
|
594 */ |
|
595 |
|
596 sel = __INST(selector); |
|
597 if ((sel == selector1) |
|
598 || ((selector2 != nil) && (sel == selector2))) { |
|
599 RETURN (self); |
|
600 } |
|
601 |
|
602 theContext = __INST(sender); |
|
603 while (__isNonNilObject(theContext)) { |
|
604 if (__isLazy(theContext)) { |
|
605 /* |
|
606 * this cannot happen |
|
607 */ |
|
608 _PATCHUPCONTEXT(theContext); |
|
609 } |
|
610 |
|
611 sel = __ContextInstPtr(theContext)->c_selector; |
|
612 if ((sel == selector1) |
|
613 || ((selector2 != nil) && (sel == selector2))) { |
|
614 /* |
|
615 * to be prepared for the worst situation |
|
616 * (the sender is not stored, so the trap wont catch it) |
|
617 * make the writeBarrier trigger manually. |
|
618 * We'll see, if this is really required. |
|
619 */ |
|
620 theContext->o_space |= CATCHMARK; |
|
621 _markNonLIFO(theContext); |
|
622 RETURN (theContext); |
|
623 } |
|
624 theContext = __ContextInstPtr(theContext)->c_sender; |
|
625 } |
|
626 %}. |
|
627 ^ nil |
565 ! ! |
628 ! ! |
566 |
629 |
567 !Context methodsFor:'minidebugger printing'! |
630 !Context methodsFor:'minidebugger printing'! |
568 |
631 |
569 fullPrint |
632 fullPrint |