diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2008-08-10 15:35:33 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2008-08-10 15:35:33 (GMT) |
commit | 0424a43c3010587b193ad4675b83670e0a0849eb (patch) | |
tree | 5d907498483113332e781f01e966e1284ebf49fa /generic | |
parent | 872dbedfd8d5080ae12fb1f69f6e112c6f3ecc2b (diff) | |
download | tcl-0424a43c3010587b193ad4675b83670e0a0849eb.zip tcl-0424a43c3010587b193ad4675b83670e0a0849eb.tar.gz tcl-0424a43c3010587b193ad4675b83670e0a0849eb.tar.bz2 |
* generic/tclProc.c: completely removed ProcCompileProc, which was
a fix for [Bug 1482718]. This is not needed at least since
varReform, where the local variable data at runtime is read from
the CallFrame and/or the LocalCache.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclProc.c | 89 |
1 files changed, 4 insertions, 85 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c index 1fe9b39..12ae064 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclProc.c,v 1.155 2008/08/04 14:09:32 msofer Exp $ + * RCS: @(#) $Id: tclProc.c,v 1.156 2008/08/10 15:35:36 msofer Exp $ */ #include "tclInt.h" @@ -53,10 +53,7 @@ static void MakeProcError(Tcl_Interp *interp, static void MakeLambdaError(Tcl_Interp *interp, Tcl_Obj *procNameObj); static int SetLambdaFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); -static int ProcCompileProc(Tcl_Interp *interp, Proc *procPtr, - Tcl_Obj *bodyPtr, Namespace *nsPtr, - const char *description, const char *procName, - Proc **procPtrPtr); + static Tcl_NRPostProc ApplyNR2; static Tcl_NRPostProc InterpProcNR2; static Tcl_NRPostProc Uplevel_Callback; @@ -1586,9 +1583,9 @@ PushProcCallFrame( } } else { doCompilation: - result = ProcCompileProc(interp, procPtr, procPtr->bodyPtr, nsPtr, + result = TclProcCompileProc(interp, procPtr, procPtr->bodyPtr, nsPtr, (isLambda ? "body of lambda term" : "body of proc"), - TclGetString(objv[isLambda]), &procPtr); + TclGetString(objv[isLambda])); if (result != TCL_OK) { return result; } @@ -1906,23 +1903,6 @@ TclProcCompileProc( const char *description, /* string describing this body of code. */ const char *procName) /* Name of this procedure. */ { - return ProcCompileProc(interp, procPtr, bodyPtr, nsPtr, description, - procName, NULL); -} - -static int -ProcCompileProc( - Tcl_Interp *interp, /* Interpreter containing procedure. */ - Proc *procPtr, /* Data associated with procedure. */ - Tcl_Obj *bodyPtr, /* Body of proc. (Usually procPtr->bodyPtr, - * but could be any code fragment compiled in - * the context of this procedure.) */ - Namespace *nsPtr, /* Namespace containing procedure. */ - const char *description, /* string describing this body of code. */ - const char *procName, /* Name of this procedure. */ - Proc **procPtrPtr) /* Points to storage where a replacement - * (Proc *) value may be written. */ -{ Interp *iPtr = (Interp *) interp; int i; Tcl_CallFrame *framePtr; @@ -1998,67 +1978,6 @@ ProcCompileProc( */ saveProcPtr = iPtr->compiledProcPtr; - - if (procPtrPtr != NULL && procPtr->refCount > 1) { - Tcl_Command token; - Tcl_CmdInfo info; - Proc *newProc = (Proc *) ckalloc(sizeof(Proc)); - - newProc->iPtr = procPtr->iPtr; - newProc->refCount = 1; - newProc->cmdPtr = procPtr->cmdPtr; - token = (Tcl_Command) newProc->cmdPtr; - newProc->bodyPtr = Tcl_DuplicateObj(bodyPtr); - bodyPtr = newProc->bodyPtr; - Tcl_IncrRefCount(bodyPtr); - newProc->numArgs = procPtr->numArgs; - - newProc->numCompiledLocals = newProc->numArgs; - newProc->firstLocalPtr = NULL; - newProc->lastLocalPtr = NULL; - localPtr = procPtr->firstLocalPtr; - for (i=0; i<newProc->numArgs; i++, localPtr=localPtr->nextPtr) { - CompiledLocal *copy = (CompiledLocal *) ckalloc((unsigned) - (sizeof(CompiledLocal) - sizeof(localPtr->name) - + localPtr->nameLength + 1)); - - if (newProc->firstLocalPtr == NULL) { - newProc->firstLocalPtr = newProc->lastLocalPtr = copy; - } else { - newProc->lastLocalPtr->nextPtr = copy; - newProc->lastLocalPtr = copy; - } - copy->nextPtr = NULL; - copy->nameLength = localPtr->nameLength; - copy->frameIndex = localPtr->frameIndex; - copy->flags = localPtr->flags; - copy->defValuePtr = localPtr->defValuePtr; - if (copy->defValuePtr) { - Tcl_IncrRefCount(copy->defValuePtr); - } - copy->resolveInfo = localPtr->resolveInfo; - strcpy(copy->name, localPtr->name); - } - - /* - * Reset the ClientData - */ - - Tcl_GetCommandInfoFromToken(token, &info); - if (info.objClientData == (ClientData) procPtr) { - info.objClientData = (ClientData) newProc; - } - if (info.clientData == (ClientData) procPtr) { - info.clientData = (ClientData) newProc; - } - if (info.deleteData == (ClientData) procPtr) { - info.deleteData = (ClientData) newProc; - } - Tcl_SetCommandInfoFromToken(token, &info); - - procPtr->refCount--; - *procPtrPtr = procPtr = newProc; - } iPtr->compiledProcPtr = procPtr; (void) TclPushStackFrame(interp, &framePtr, |