diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2015-12-12 14:57:27 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2015-12-12 14:57:27 (GMT) |
commit | 2e36812df07374858548fac08c3e374913b7cdb1 (patch) | |
tree | d5dd8bfab87ec2e7af0bd21baf0ee3c73ff0c119 | |
parent | c2ab00c6fb30172a584aaf749a61e089a97ea3ea (diff) | |
download | tcl-2e36812df07374858548fac08c3e374913b7cdb1.zip tcl-2e36812df07374858548fac08c3e374913b7cdb1.tar.gz tcl-2e36812df07374858548fac08c3e374913b7cdb1.tar.bz2 |
removing useless trampoline bounces in cmd dispatch; added comments to README.opt2
-rw-r--r-- | README.opt2 | 5 | ||||
-rw-r--r-- | generic/tclBasic.c | 29 |
2 files changed, 12 insertions, 22 deletions
diff --git a/README.opt2 b/README.opt2 index 99a18cf..0782f59 100644 --- a/README.opt2 +++ b/README.opt2 @@ -21,3 +21,8 @@ IMPORTANT MODS AND INCOMPATS * there is a new optimizer that produces better bytecodes, especially in the handling of logic and exceptions. The optimizer itself is extremely suboptimal, the way it works can definitely be improved. + +* INCOMPATIBILITY (?) - NRE stack is a real stack + Tcl_NRAddCallback now OVERWRITES the currently executing callback!! Users + now have to make sure that they save the received data[] in local vars if + they plan to use them after pushing a new callback! diff --git a/generic/tclBasic.c b/generic/tclBasic.c index c81cce2..088278e 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -159,7 +159,6 @@ static Tcl_NRPostProc TEOV_NotFoundCallback; static Tcl_NRPostProc TEOV_RestoreVarFrame; static Tcl_NRPostProc TEOV_RunLeaveTraces; static Tcl_NRPostProc EvalObjvCore; -static Tcl_NRPostProc Dispatch; static Tcl_ObjCmdProc NRCoroInjectObjCmd; static Tcl_NRPostProc NRPostInvoke; @@ -4299,23 +4298,6 @@ EvalObjvCore( commandPtr, cmdPtr, objv); } - TclNRAddCallback(interp, Dispatch, - cmdPtr->nreProc ? cmdPtr->nreProc : cmdPtr->objProc, - cmdPtr->objClientData, INT2PTR(objc), objv); - return TCL_OK; -} - -static int -Dispatch( - ClientData data[], - Tcl_Interp *interp, - int result) -{ - Tcl_ObjCmdProc *objProc = data[0]; - ClientData clientData = data[1]; - int objc = PTR2INT(data[2]); - Tcl_Obj **objv = data[3]; - #ifdef USE_DTRACE if (TCL_DTRACE_CMD_ARGS_ENABLED()) { const char *a[10]; @@ -4345,7 +4327,11 @@ Dispatch( } #endif /* USE_DTRACE */ - return objProc(clientData, interp, objc, objv); + if (cmdPtr->nreProc) { + return cmdPtr->nreProc(cmdPtr->objClientData, interp, objc, objv); + } else { + return cmdPtr->objProc(cmdPtr->objClientData, interp, objc, objv); + } } int @@ -8081,9 +8067,8 @@ Tcl_NRCallObjProc( Tcl_Obj *const objv[]) { TclNRSetRoot(interp); - TclNRAddCallback(interp, Dispatch, objProc, clientData, - INT2PTR(objc), objv); - return TclNRRunCallbacks(interp, TCL_OK); + return TclNRRunCallbacks(interp, + (objProc)(clientData, interp, objc, objv)); } /* |