Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | remove second (unused) resolver (simplify code before new on-demand-resolver introduced) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | sebres-memopt-perf-branch |
Files: | files | file ages | folders |
SHA3-256: |
f7de92b810f764ed047e4784eef2b787 |
User & Date: | sebres 2019-02-10 02:01:39.294 |
Context
2019-06-27
| ||
15:35 | Remove an unused experimental resolver (NEW_PROTO_RESOLVER) that appears to have been abandoned. If there is anyone out there who misses it, we can retrieve again from the code history. check-in: 2a08252728 user: dgp tags: trunk | |
2019-04-14
| ||
15:19 | small review check-in: c8831b5a95 user: sebres tags: sebres-memopt-perf-branch | |
2019-02-10
| ||
02:01 | remove second (unused) resolver (simplify code before new on-demand-resolver introduced) check-in: f7de92b810 user: sebres tags: sebres-memopt-perf-branch | |
01:48 | merge fix from trunk check-in: fe7810c5f7 user: sebres tags: sebres-memopt-perf-branch | |
Changes
Changes to generic/itclBase.c.
︙ | ︙ | |||
192 193 194 195 196 197 198 | * * that is the starting point when loading the library * it initializes all internal stuff * * ------------------------------------------------------------------------ */ | < < < < | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | * * that is the starting point when loading the library * it initializes all internal stuff * * ------------------------------------------------------------------------ */ static int Initialize ( Tcl_Interp *interp) { Tcl_Namespace *nsPtr; Tcl_Namespace *itclNs; Tcl_HashEntry *hPtr; |
︙ | ︙ | |||
334 335 336 337 338 339 340 | infoPtr->useOldResolvers = opt; Itcl_InitStack(&infoPtr->clsStack); Tcl_SetAssocData(interp, ITCL_INTERP_DATA, NULL, (ClientData)infoPtr); Itcl_PreserveData((ClientData)infoPtr); | < < < < | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | infoPtr->useOldResolvers = opt; Itcl_InitStack(&infoPtr->clsStack); Tcl_SetAssocData(interp, ITCL_INTERP_DATA, NULL, (ClientData)infoPtr); Itcl_PreserveData((ClientData)infoPtr); objPtr = Tcl_NewStringObj("::oo::class", -1); Tcl_IncrRefCount(objPtr); clazzObjectPtr = Tcl_GetObjectFromObj(interp, objPtr); if (!clazzObjectPtr || !(tclCls = Tcl_GetObjectAsClass(clazzObjectPtr))) { Tcl_DecrRefCount(objPtr); return TCL_ERROR; } |
︙ | ︙ |
Changes to generic/itclClass.c.
︙ | ︙ | |||
431 432 433 434 435 436 437 | Tcl_AppendResult(interp, "ITCL: cannot create/get class namespace for class \"", Tcl_GetString(iclsPtr->fullNamePtr), "\"", NULL); return TCL_ERROR; } if (iclsPtr->infoPtr->useOldResolvers) { | < < < < < < < < < < < | 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | Tcl_AppendResult(interp, "ITCL: cannot create/get class namespace for class \"", Tcl_GetString(iclsPtr->fullNamePtr), "\"", NULL); return TCL_ERROR; } if (iclsPtr->infoPtr->useOldResolvers) { Itcl_SetNamespaceResolvers(ooNs, (Tcl_ResolveCmdProc*)Itcl_ClassCmdResolver, (Tcl_ResolveVarProc*)Itcl_ClassVarResolver, (Tcl_ResolveCompiledVarProc*)Itcl_ClassCompiledVarResolver); Itcl_SetNamespaceResolvers(classNs, (Tcl_ResolveCmdProc*)Itcl_ClassCmdResolver, (Tcl_ResolveVarProc*)Itcl_ClassVarResolver, (Tcl_ResolveCompiledVarProc*)Itcl_ClassCompiledVarResolver); } else { Tcl_SetNamespaceResolver(ooNs, iclsPtr->resolvePtr); Tcl_SetNamespaceResolver(classNs, iclsPtr->resolvePtr); } iclsPtr->nsPtr = classNs; |
︙ | ︙ | |||
1733 1734 1735 1736 1737 1738 1739 | ItclVarLookup *vlookup; ItclVariable *ivPtr; ItclMemberFunc *imPtr; ItclDelegatedFunction *idmPtr; ItclHierIter hier; ItclClass *iclsPtr2; ItclCmdLookup *clookupPtr; | < < < < | 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 | ItclVarLookup *vlookup; ItclVariable *ivPtr; ItclMemberFunc *imPtr; ItclDelegatedFunction *idmPtr; ItclHierIter hier; ItclClass *iclsPtr2; ItclCmdLookup *clookupPtr; int newEntry; Tcl_DStringInit(&buffer); Tcl_DStringInit(&buffer2); /* * Clear the variable resolution table. |
︙ | ︙ | |||
1778 1779 1780 1781 1782 1783 1784 | * into the table. */ Itcl_InitHierIter(&hier, iclsPtr); iclsPtr2 = Itcl_AdvanceHierIter(&hier); while (iclsPtr2 != NULL) { hPtr = Tcl_FirstHashEntry(&iclsPtr2->variables, &place); while (hPtr) { | < < < < < < < < < < < < < < < < < < < < < < | 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 | * into the table. */ Itcl_InitHierIter(&hier, iclsPtr); iclsPtr2 = Itcl_AdvanceHierIter(&hier); while (iclsPtr2 != NULL) { hPtr = Tcl_FirstHashEntry(&iclsPtr2->variables, &place); while (hPtr) { ivPtr = (ItclVariable*)Tcl_GetHashValue(hPtr); vlookup = (ItclVarLookup *)ckalloc(sizeof(ItclVarLookup)); vlookup->ivPtr = ivPtr; vlookup->usage = 0; vlookup->leastQualName = NULL; /* * If this variable is PRIVATE to another class scope, * then mark it as "inaccessible". */ vlookup->accessible = (ivPtr->protection != ITCL_PRIVATE || ivPtr->iclsPtr == iclsPtr); /* * If this is a reference to the built-in "this" * variable, then its index is "0". Otherwise, * add another slot to the end of the table. */ if ((ivPtr->flags & ITCL_THIS_VAR) != 0) { vlookup->varNum = 0; } else { if ((ivPtr->flags & ITCL_OPTIONS_VAR) != 0) { vlookup->varNum = 1; } else { vlookup->varNum = iclsPtr->numInstanceVars++; } } /* FIXME !!! should use for var lookup !! */ /* * Create all possible names for this variable and enter * them into the variable resolution table: * var * class::var |
︙ | ︙ | |||
1855 1856 1857 1858 1859 1860 1861 | Tcl_SetHashValue(hPtr, (ClientData)vlookup); vlookup->usage++; if (!vlookup->leastQualName) { vlookup->leastQualName = Tcl_GetHashKey(&iclsPtr->resolveVars, hPtr); } | < < < < < | 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 | Tcl_SetHashValue(hPtr, (ClientData)vlookup); vlookup->usage++; if (!vlookup->leastQualName) { vlookup->leastQualName = Tcl_GetHashKey(&iclsPtr->resolveVars, hPtr); } } if (nsPtr == NULL) { break; } Tcl_DStringSetLength(&buffer2, 0); Tcl_DStringAppend(&buffer2, Tcl_DStringValue(&buffer), -1); |
︙ | ︙ | |||
1937 1938 1939 1940 1941 1942 1943 | (char *)objPtr, &newEntry); if (newEntry) { clookupPtr = (ItclCmdLookup *)ckalloc(sizeof(ItclCmdLookup)); memset(clookupPtr, 0, sizeof(ItclCmdLookup)); clookupPtr->imPtr = imPtr; Tcl_SetHashValue(hPtr, (ClientData)clookupPtr); | < < < < < < < < < < < < < < < < < < | 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 | (char *)objPtr, &newEntry); if (newEntry) { clookupPtr = (ItclCmdLookup *)ckalloc(sizeof(ItclCmdLookup)); memset(clookupPtr, 0, sizeof(ItclCmdLookup)); clookupPtr->imPtr = imPtr; Tcl_SetHashValue(hPtr, (ClientData)clookupPtr); } else { Tcl_DecrRefCount(objPtr); } if (nsPtr == NULL) { break; } |
︙ | ︙ |
Changes to generic/itclCmd.c.
︙ | ︙ | |||
1822 1823 1824 1825 1826 1827 1828 | Tcl_SetHashValue(hPtr, (ClientData)vlookup); vlookup->usage++; if (!vlookup->leastQualName) { vlookup->leastQualName = Tcl_GetHashKey(&contextIclsPtr->resolveVars, hPtr); } | < < < < < | 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 | Tcl_SetHashValue(hPtr, (ClientData)vlookup); vlookup->usage++; if (!vlookup->leastQualName) { vlookup->leastQualName = Tcl_GetHashKey(&contextIclsPtr->resolveVars, hPtr); } } if (nsPtr == NULL) { break; } Tcl_DStringSetLength(&buffer2, 0); Tcl_DStringAppend(&buffer2, Tcl_DStringValue(&buffer), -1); |
︙ | ︙ |
Changes to generic/itclInfo.c.
︙ | ︙ | |||
2548 2549 2550 2551 2552 2553 2554 | * name. Use normal class names when possible. */ if (contextIoPtr) { contextNs = contextIoPtr->iclsPtr->nsPtr; } else { assert(contextIclsPtr != NULL); assert(contextIclsPtr->nsPtr != NULL); | < < < < | 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 | * name. Use normal class names when possible. */ if (contextIoPtr) { contextNs = contextIoPtr->iclsPtr->nsPtr; } else { assert(contextIclsPtr != NULL); assert(contextIclsPtr->nsPtr != NULL); if (contextIclsPtr->infoPtr->useOldResolvers) { contextNs = contextIclsPtr->nsPtr; } else { contextNs = contextIclsPtr->nsPtr; } } name = contextNs->fullName; if (!(contextIclsPtr->flags & ITCL_WIDGET)) { Tcl_AppendResult(interp, "object or class is no widget", NULL); return TCL_ERROR; } |
︙ | ︙ | |||
2808 2809 2810 2811 2812 2813 2814 | * name. Use normal class names when possible. */ if (contextIoPtr) { contextNs = contextIoPtr->iclsPtr->nsPtr; } else { assert(contextIclsPtr != NULL); assert(contextIclsPtr->nsPtr != NULL); | < < < < | 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 | * name. Use normal class names when possible. */ if (contextIoPtr) { contextNs = contextIoPtr->iclsPtr->nsPtr; } else { assert(contextIclsPtr != NULL); assert(contextIclsPtr->nsPtr != NULL); if (contextIclsPtr->infoPtr->useOldResolvers) { contextNs = contextIclsPtr->nsPtr; } else { contextNs = contextIclsPtr->nsPtr; } } name = contextNs->fullName; if (!(contextIclsPtr->flags & ITCL_TYPE)) { Tcl_AppendResult(interp, "object or class is no type", NULL); return TCL_ERROR; } |
︙ | ︙ | |||
4296 4297 4298 4299 4300 4301 4302 | * name. Use normal class names when possible. */ if (contextIoPtr) { contextNs = contextIoPtr->iclsPtr->nsPtr; } else { assert(contextIclsPtr != NULL); assert(contextIclsPtr->nsPtr != NULL); | < < < < | 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 | * name. Use normal class names when possible. */ if (contextIoPtr) { contextNs = contextIoPtr->iclsPtr->nsPtr; } else { assert(contextIclsPtr != NULL); assert(contextIclsPtr->nsPtr != NULL); if (contextIclsPtr->infoPtr->useOldResolvers) { contextNs = contextIclsPtr->nsPtr; } else { contextNs = contextIclsPtr->nsPtr; } } name = contextNs->fullName; if (!(contextIclsPtr->flags & ITCL_WIDGETADAPTOR)) { Tcl_AppendResult(interp, "object or class is no widgetadaptor", NULL); return TCL_ERROR; } |
︙ | ︙ |
Changes to generic/itclInt.h.
︙ | ︙ | |||
589 590 591 592 593 594 595 | Tcl_Obj *defaultValuePtr; Tcl_Obj *callbackPtr; } ItclMethodVariable; #define VAR_TYPE_VARIABLE 1 #define VAR_TYPE_COMMON 2 | < < < < < < < < | 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | Tcl_Obj *defaultValuePtr; Tcl_Obj *callbackPtr; } ItclMethodVariable; #define VAR_TYPE_VARIABLE 1 #define VAR_TYPE_COMMON 2 #define CMD_TYPE_METHOD 1 #define CMD_TYPE_PROC 2 typedef struct ItclClassCmdInfo { int type; int protection; int cmdNum; |
︙ | ︙ | |||
621 622 623 624 625 626 627 | int accessible; /* non-zero => accessible from class with * this lookup record in its resolveVars */ char *leastQualName; /* simplist name for this variable, with * the fewest qualifiers. This string is * taken from the resolveVars table, so * it shouldn't be freed. */ int varNum; | < | 613 614 615 616 617 618 619 620 621 622 623 624 625 626 | int accessible; /* non-zero => accessible from class with * this lookup record in its resolveVars */ char *leastQualName; /* simplist name for this variable, with * the fewest qualifiers. This string is * taken from the resolveVars table, so * it shouldn't be freed. */ int varNum; Tcl_Var varPtr; } ItclVarLookup; /* * Instance command lookup entry. */ typedef struct ItclCmdLookup { |
︙ | ︙ | |||
862 863 864 865 866 867 868 | MODULE_SCOPE const Tcl_MethodType itclRootMethodType; MODULE_SCOPE ItclRootMethodProc ItclUnknownGuts; MODULE_SCOPE ItclRootMethodProc ItclConstructGuts; MODULE_SCOPE ItclRootMethodProc ItclInfoGuts; #include "itcl2TclOO.h" | < < < | 853 854 855 856 857 858 859 860 861 862 863 864 865 | MODULE_SCOPE const Tcl_MethodType itclRootMethodType; MODULE_SCOPE ItclRootMethodProc ItclUnknownGuts; MODULE_SCOPE ItclRootMethodProc ItclConstructGuts; MODULE_SCOPE ItclRootMethodProc ItclInfoGuts; #include "itcl2TclOO.h" /* * Include all the private API, generated from itcl.decls. */ #include "itclIntDecls.h" |
Deleted generic/itclResolve2.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted generic/itclVCInt.h.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted generic/itclVarsAndCmds.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted generic/itclVarsAndCmds.h.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |