From f939b6c7e8e9053fe0c26c1c33379cd9fba0a241 Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Tue, 28 Sep 2010 15:20:17 +0000 Subject: * generic/tclExecute.c: remove TEBCreturn() callback, the job can be accomplished by TEBCresume() --- ChangeLog | 9 +++++++-- generic/tclExecute.c | 43 ++++++++++++------------------------------- 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98893db..2816e5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-09-27 Miguel Sofer + + * generic/tclExecute.c: remove TEBCreturn() callback, the job can + be accomplished by TEBCresume() + 2010-09-28 Reinhard Max Implementation of TIP #162, "IPv6 Sockets for Tcl" @@ -20,14 +25,14 @@ * unix/configure.in: Test whether the fake-implementation is * unix/tcl.m4: needed. * unix/Makefile.in: Add a compile target for fake-rfc2553. - + * win/configure.in: Allow cross-compilation by default * tests/socket.test: Improve the test suite to make more use of * tests/remote.tcl: randomized ports to reduce interference with tests running in parallel or other services on the machine. - + 2010-09-26 Miguel Sofer * generic/tclBasic.c: [Patch 3072080] (minus the itcl diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 705d836..2297492 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.500 2010/09/27 20:16:30 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.501 2010/09/28 15:20:17 msofer Exp $ */ #include "tclInt.h" @@ -721,7 +721,6 @@ static Tcl_NRPostProc CopyCallback; static Tcl_NRPostProc ExprObjCallback; static Tcl_NRPostProc TEBCresume; -static Tcl_NRPostProc TEBCreturn; /* * The structure below defines a bytecode Tcl object type to hold the @@ -1939,13 +1938,9 @@ TclNRExecuteByteCode( #endif /* - * Push the callbacks for - * - exception handling and cleanup - * - bytecode execution + * Push the callback for bytecode execution */ - TclNRAddCallback(interp, TEBCreturn, BP, NULL, - NULL, NULL); TclNRAddCallback(interp, TEBCresume, BP, /*resume*/ INT2PTR(0), NULL, NULL); @@ -1953,26 +1948,6 @@ TclNRExecuteByteCode( } static int -TEBCreturn( - ClientData data[], - Tcl_Interp *interp, - int result) -{ - BottomData *BP = data[0]; - ByteCode *codePtr = BP->codePtr; - - if (--codePtr->refCount <= 0) { - TclCleanupByteCode(codePtr); - } - while (BP->expanded) { - BP = BP->expanded; - } - TclStackFree(interp, BP); /* free my stack */ - - return result; -} - -static int TEBCresume( ClientData data[], Tcl_Interp *interp, @@ -2074,7 +2049,6 @@ TEBCresume( result = TCL_ERROR; } NRE_ASSERT(iPtr->cmdFramePtr == bcFramePtr); - NRE_ASSERT(TOP_CB(interp)->procPtr == TEBCreturn); iPtr->cmdFramePtr = bcFramePtr->nextPtr; TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr); @@ -6352,11 +6326,18 @@ TEBCresume( CLANG_ASSERT(bcFramePtr); } + /* - * Store the previous bottomPtr for returning to it, then free all - * resources used by this bytecode and process callbacks until you return - * to the previous bytecode (if any). + * Free all resources associated with this execution */ + + if (--codePtr->refCount <= 0) { + TclCleanupByteCode(codePtr); + } + while (BP->expanded) { + BP = BP->expanded; + } + TclStackFree(interp, BP); /* free my stack */ iPtr->cmdFramePtr = bcFramePtr->nextPtr; return result; -- cgit v0.12