nsf.c

Clone Tools
  • last updated 14 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Squashed commit of the following:

commit 370f47d26099dd8cda4125de67048461edb797a9

Author: ssoberni <stefan.sobernig@wu-wien.ac.at>

Date: Thu Nov 4 10:56:11 2010 +0100

Due to recent changes in InterpColonVarResolver() to handle the

slow-path execution the byte-compiled [variable], an unwanted

interaction between ::nsf::setter, *certain* per-object namespaces,

and the ColonCmd()-based invocation of setter methods became

visible. In short: Given a pre-existing Tcl namespace and the

colon-prefixed call specification to a setter method,

InterpColonVarResolver() handles the var resolution request issued by

the setter method (or SetInstVar(), more precisely). In a

colon-prefixed call, the Tcl_Obj carrying the setter method name and

used to lookup the object variable contains the ":". At the same time,

the per-object namespace causes the TCL_NAMESPACE_ONLY flag to be set

which causes InterpColonVarResolver() to pass on the request. In this

setting, we end up with colon-prefixed object variables! See

tests/parameter.test for an explanatory test case. For the time being,

I fixed this by preserving and using the original, colon-free Tcl_Obj

indicating the variable name in the client data structure of the

settercmd.

  1. … 1 more file in changeset.
- fix a bug, where "o configure" (without arguments) resetted initialied values to the defaults.

  1. … 3 more files in changeset.
- improving error messages from argument parser - test "namespace current" and "self" in "contains" and "slots" regression test

  1. … 4 more files in changeset.
- activated SKIP_LAMBDA in nsfCallstack. As a consequence, we disallow resolving self/my ... from tcl-proc frames (use uplevel if necessary, avoid "namespace eval")

  1. … 3 more files in changeset.
- added new contains definition based on "apply" instead of "namespace eval". Main intention is to replace SKIP_LEVELS by SKIP_LAMBDA - added functionality to use ":attribute contains:method,nosetter" - added regression test for contains and attributes of type method

  1. … 5 more files in changeset.
- added an experimental code for setting parent namespace path as default for child-objects. At the time when an object namespace is created, the namespace path of the parent object is copied to the child as default value.

  1. … 3 more files in changeset.
- gentclApi.tcl: added optimizer rule for single argument of type tclobj - improved speed of CompiledLocalsLookup slightly

  1. … 3 more files in changeset.
- impoved NsColonVarResolver, made some assumptions explicit

  1. … 2 more files in changeset.
- fixed scoping issue, when "-volatile" was used for object creation - added regression test for interaction between filters and function resolver (and volatile) - reactivated new volatile test in destroy.test - undone temporary fixes for volatile in serializer and nx.tcl

  1. … 5 more files in changeset.
- new function MethodNameString() to obtain name without colon prefix from tcl_obj - fix bad interaction between filters and cmd name resolvers - output object frame to ease interpretation of [info frame]

- changed CallStackGetActiveProcFrame() to return also CMETHD frames This allows to execute :volatile in a initcmd and to delete the object at its end. As a consequence, code like [CopyHandler new -volatile] copy [::nsf::self] $newName has to be changed to CopyHandler new { :copy [:uplevel ::nsf::self] [uplevel set newName] :destroy } - renamed CallStackUseActiveFrames() to CallStackUseActiveFrame() and ctx->framesSaved to ctx->frameSaved to reflect implementation

  1. … 5 more files in changeset.
- removed debugging from CscFinish when compiled without DEVELOPMENT

  1. … 3 more files in changeset.
- remved debugging from NsfCleanupObject when compiled without DEVELOPMENT

  1. … 2 more files in changeset.
- fixed bug when calling aliased proc not via method interface - fixed bug when calling destroy in initcmd

  1. … 2 more files in changeset.
- added a few more small optimization. - code-generator: don't call argument parser, when no arguments are specified

  1. … 6 more files in changeset.
- Adding some tests on the interactions between our var resolvers and link-creating commands: [variable], [upvar], [global], ... - Amended the in-code documentation for InterpColonVarResolver(), InterpCompiledColonVarResolver() and CompiledColonVarFetch(). - Found another AVOID_RESOLVERS victim: [namespace which -variable /varName/]

  1. … 1 more file in changeset.
- removed bug-alert from nx.tcl (wrong false-positives for compiled locals in slots) - added a few small optimization. nsf appears to run on the shootout benchmark the same speed like a year ago (which much less functionality)

  1. … 5 more files in changeset.
- implemented exported command ::nsf::self as fast conveniance replacement for "::nsf::current object".

  1. … 8 more files in changeset.
- don't relay on gcc extensions

- make sure, standard pre-processors can process this file

- Providing a fix (and some analysis documentation) for the prefixed-(":")-variable resolution, making the entire mechanism more robust under situations of var resolvers for compiled and non-compiled script execution interacting. - Added a first sample test (which documents the motivating issue observed for AOLserver vs. NaviServer) - Further testing and documenting are pending

  1. … 1 more file in changeset.
- make sure not to return CompiledLocal vars from InterpColonVarResolver() when TCL_NAMESPACE_ONLY is requested. - delegate always from InterpColonVarResolver() to other resolvers, when TCL_NAMESPACE_ONLY is requested.

  1. … 2 more files in changeset.
- follow current Tcl vonvention for patchlevel var: - changed name of ::nsf::patchlevel to ::nsf::patchLevel - changed content ::nsf::patchLevel from eg .0 to full number including release details

- fixed bug in ::variable with colon-prefixed name

(shadowCommands does not help, see above)

- removed traces of Nsf_VariableObjCmd()

- extended regression test

  1. … 7 more files in changeset.
- made handling of unstacked entries optional by defining macro CHECK_ACTIVATION_COUNTS) - added macro NSF_DEVELOPMENT for toplevel handling if NDEBUG and CHECK_ACTIVATION_COUNTS - cleanup of method-modifiers.tcl - updated next migration guide

  1. … 6 more files in changeset.
- added handling of unstacked csc entries (removed all DEBUG warnings).

  1. … 10 more files in changeset.
- copied decls for objectMethod and classMethod as comments to nsf.c, fixed order - documented a few functions

  1. … 3 more files in changeset.
- use "nsf::configure debug" for value 1: compain about protected value >1: provide load messages for nx and xotcl - unset unneeded variables in ::nx namespace

  1. … 3 more files in changeset.
- fix requiredness of several info methods - added "nsf::configure debug ?level?"

  1. … 5 more files in changeset.
- renamed some arguments of tcl interface to increase consistency - make requiredness explicit for nsf::cmds - introduce ::nsf::parametersyntax to provide syntax for potentially missing definitions - provided ::nsf::parametersyntax for 3 ::nsf commands and 7 nx methods (from relationslots)

  1. … 6 more files in changeset.
- replaced "-objscope" and "-nonleaf" by "-frame object|method|default" for nsf::alias and nsf::default - added functionality for "-frame method" to nsf::dispatch - made the order of argument in ::nsf::alias and method "alias" the same (always first the method, then "-frame ...") - extened regression test

  1. … 15 more files in changeset.