1632 __INST(flags) = (OBJ)((INT)__INST(flags) & ~__MASKSMALLINT(__UNWIND_MARK)); |
1632 __INST(flags) = (OBJ)((INT)__INST(flags) & ~__MASKSMALLINT(__UNWIND_MARK)); |
1633 %} |
1633 %} |
1634 ! ! |
1634 ! ! |
1635 |
1635 |
1636 !Context methodsFor:'searching'! |
1636 !Context methodsFor:'searching'! |
|
1637 |
|
1638 findExceptional |
|
1639 "walk along the sender chain (starting with the sender), |
|
1640 for a context which is marked as handle or raise context. |
|
1641 This non-standard interface is only to be used by exception" |
|
1642 |
|
1643 "/ this could have been (actually: was) implemented as: |
|
1644 "/ |
|
1645 "/ |con| |
|
1646 "/ |
|
1647 "/ con := self. |
|
1648 "/ [con notNil] whileTrue:[ |
|
1649 "/ [con isHandleContext] ifTrue:[^con]. |
|
1650 "/ [con isRaiseContext] ifTrue:[^con]. |
|
1651 "/ con := con sender. |
|
1652 "/ ]. |
|
1653 "/ ^ nil |
|
1654 "/ |
|
1655 "/ and the code below does exactly this (somewhat faster, though). |
|
1656 "/ |
|
1657 "/ (it avoids referencing all intermediate contexts, which would mark them special, |
|
1658 "/ although they aren't really - this is expert knowledge, no need to understand that ...) |
|
1659 |
|
1660 %{ /* NOCONTEXT */ |
|
1661 |
|
1662 OBJ theContext; |
|
1663 |
|
1664 theContext = self; |
|
1665 while (__isNonNilObject(theContext)) { |
|
1666 if ((INT)(__ContextInstPtr(theContext)->c_flags) & __MASKSMALLINT(__HANDLE_MARK|__RAISE_MARK)) { |
|
1667 if (__isLazy(theContext)) { |
|
1668 __PATCHUPCONTEXT(theContext); |
|
1669 } |
|
1670 |
|
1671 if (! __isNonLIFO(theContext)) { |
|
1672 /* |
|
1673 * to be prepared for the worst situation |
|
1674 * (the sender is not stored, so the trap won't catch it) |
|
1675 * make the writeBarrier trigger manually. |
|
1676 * We'll see, if this is really required. |
|
1677 */ |
|
1678 theContext->o_space |= CATCHMARK; |
|
1679 #if 0 |
|
1680 _markNonLIFO(theContext); |
|
1681 #endif |
|
1682 } |
|
1683 RETURN (theContext); |
|
1684 } |
|
1685 theContext = __ContextInstPtr(theContext)->c_sender; |
|
1686 } |
|
1687 %}. |
|
1688 ^ nil |
|
1689 ! |
1637 |
1690 |
1638 findNextContextWithSelector:selector1 or:selector2 or:selector3 |
1691 findNextContextWithSelector:selector1 or:selector2 or:selector3 |
1639 "walk along the sender chain (starting with the sender), |
1692 "walk along the sender chain (starting with the sender), |
1640 for a context with either one of the given selectors. |
1693 for a context with either one of the given selectors. |
1641 This non-standard interface is only to be used by exception" |
1694 This non-standard interface is only to be used by exception" |