Index: TODO =================================================================== diff -u -rb01d919fe9de4aa6eee10b0a39d3c067720482ca -r821c3ed7b14ad8137bee7d31ebadcc537c153d39 --- TODO (.../TODO) (revision b01d919fe9de4aa6eee10b0a39d3c067720482ca) +++ TODO (.../TODO) (revision 821c3ed7b14ad8137bee7d31ebadcc537c153d39) @@ -3590,7 +3590,12 @@ - perform more eager invalidation on objectMethodEpochs - cleanup on nsfObj.c +nsf.c: + - don't convert obj types tclCmdName and parsedVarNameType + to instanceMethodObjType + + TODO: - unknown arg handler must find a way to aviod method deletions or redefinitions or to recover from these gracefully Index: generic/nsf.c =================================================================== diff -u -reb61b50b37e5a0f09f9cbc4ff5456c9c5765d9ad -r821c3ed7b14ad8137bee7d31ebadcc537c153d39 --- generic/nsf.c (.../nsf.c) (revision eb61b50b37e5a0f09f9cbc4ff5456c9c5765d9ad) +++ generic/nsf.c (.../nsf.c) (revision 821c3ed7b14ad8137bee7d31ebadcc537c153d39) @@ -187,7 +187,8 @@ *Nsf_OT_tclCmdNameType = NULL, *Nsf_OT_listType = NULL, *Nsf_OT_doubleType = NULL, - *Nsf_OT_intType = NULL; + *Nsf_OT_intType = NULL, + *Nsf_OT_parsedVarNameType = NULL; /* * Function prototypes @@ -9827,9 +9828,13 @@ } else { cl = SearchPLMethod(currentClass->order, methodName, &cmd, NSF_CMD_CALL_PRIVATE_METHOD); } - NsfMethodObjSet(interp, methodObj, &NsfInstanceMethodObjType, - currentClass, nsfInstanceMethodEpoch, - cmd, cl, flags); + if (methodObj->typePtr != Nsf_OT_tclCmdNameType + && methodObj->typePtr != Nsf_OT_parsedVarNameType + ) { + NsfMethodObjSet(interp, methodObj, &NsfInstanceMethodObjType, + currentClass, nsfInstanceMethodEpoch, + cmd, cl, flags); + } } } } @@ -23300,6 +23305,19 @@ # endif #endif + /* + * obtain type for parsed var name + */ + if (Nsf_OT_parsedVarNameType == NULL) { + Tcl_Obj *varNameObj = Tcl_NewStringObj("::nsf::version",-1); + Var *arrayPtr; + + TclObjLookupVar(interp, varNameObj, NULL, 0, "access", + /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr); + Nsf_OT_parsedVarNameType = varNameObj->typePtr; + assert(Nsf_OT_parsedVarNameType); + } + #if !defined(TCL_THREADS) if ((Tcl_GetVar2(interp, "tcl_platform", "threaded", TCL_GLOBAL_ONLY) != NULL)) { /* a non threaded version of nsf is loaded into a threaded environment */ Index: generic/nsfObj.c =================================================================== diff -u -rb01d919fe9de4aa6eee10b0a39d3c067720482ca -r821c3ed7b14ad8137bee7d31ebadcc537c153d39 --- generic/nsfObj.c (.../nsfObj.c) (revision b01d919fe9de4aa6eee10b0a39d3c067720482ca) +++ generic/nsfObj.c (.../nsfObj.c) (revision 821c3ed7b14ad8137bee7d31ebadcc537c153d39) @@ -124,6 +124,10 @@ * structure as internal representation. */ if (likely(objPtr->typePtr != objectType)) { +#if defined(METHOD_OBJECT_TRACE) + fprintf(stderr, "... NsfMethodObjSet frees old int rep %s\n", + objPtr->typePtr ? objPtr->typePtr->name : "none"); +#endif TclFreeIntRep(objPtr); mcPtr = NEW(NsfMethodContext); objPtr->internalRep.twoPtrValue.ptr1 = (void *)mcPtr;