Skip to content
Tcl Source Code History Of Ticket 1661637
Login

History Of Ticket 1661637

Artifacts Associated With Ticket 1661637

  1. Ticket change [394c114588] (rid 112366) by dgp on 2007-02-16 16:09:00:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      The attached patch modifies
      TclSetBytecodeFromAny() so
      that when the value we are
      compiling is already a pure
      list, we produce bytecode
      directly, and don't go through
      the waste of reparsing the
      string rep, and recreating
      word values out of the tokens
      produced by parsing.
      
      This means we don't shimmer
      away any possibly valuable
      internal reps in the elements
      of the list.
      
      As a simple example:
      
      set ns ::foo
      namespace eval $ns {}
      namespace exists $ns
      namespace eval [list namespace exists $ns]
      
      The first [namespace exists] caches
      converts value "::foo" to the "nsName"
      Tcl_ObjType with a cached reference
      to the Namespace that name represents.
      
      Without this patch, that internal rep
      data is lost when [namespace eval]
      bytecode compiles the second
      [namespace exists] command, and the
      namespace has to be looked up from
      string value again.
      
      With this patch, the value $ns compiles
      directly into the bytecode, and when
      INST_INVOKE_STK1 executes the compiled
      [namespace exists] command, it gets
      the cached intrep data.
      
      This is just a simple example to
      illustrate the general principle that
      we ought to keep intreps if it's
      reasonably easy and there's not a reason
      not to.
      
      This principle has already proved
      its worth for TCL_EVAL_DIRECT compiles,
      and inspired lots of [list $cmd $arg]
      coding style out there.  It's strange
      that the same style has not until now
      been supported in the bytecompiling
      branches.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "dgp"
    10. subsystem initialized to: "47. Bytecode Compiler"
    11. title initialized to: "direct compile of pure list scripts"
    12. type initialized to: "RFE"
  2. Ticket change [d189398d95] (rid 113369) by dgp on 2007-02-16 23:09:00:

    1. icomment:
      
      
      File Added - 216320: compList.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Add attachment "compList.patch" [2a831a46b2] (rid 118592) by dgp on 2007-02-16 23:09:00.

  4. Add attachment "1661637.patch" [aa72f19d56] (rid 100929) by dgp on 2007-02-17 05:11:57.

  5. Ticket change [821bb64afe] (rid 117174) by dgp on 2007-02-17 05:11:57:

    1. icomment:
      
      
      File Added - 216364: 1661637.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Ticket change [90b2d5dd63] (rid 120494) by dgp on 2007-02-17 05:11:58:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: YES
      
      
      miguel observes that most (all?)
      of these issues can be addressed
      by intercepting earlier in
      TclCompEvalObj.  The second patch
      attached takes that approach. 
      Either patch, or even both patches
      could be committed.
       
      File Added: 1661637.patch
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [025fdf637d] (rid 119637) by msofer on 2007-09-13 08:26:41:

    1. priority changed to: "8"
  8. Ticket change [e5eda3490e] (rid 104213) by msofer on 2008-06-02 22:45:39:

    1. icomment:
      
      
      File Added - 279884: 1661637-2.patch
      
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      New patch that intercepts even earlier, in TclEvalObjEx: enable the canonical list optimisation also when TCL_EVAL_DIRECT has not been set. In this way, the compiler isn't ever called on canonical lists.
      File Added: 1661637-2.patch
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  9. Add attachment "1661637-2.patch" [191cf41ab2] (rid 122766) by msofer on 2008-06-02 22:45:39.

  10. Ticket change [d627d758a4] (rid 123757) by nijtmans on 2008-06-03 03:13:31:

    1. icomment:
      Logged In: YES 
      user_id=61031
      Originator: NO
      
      The only thing we should worry about is when a list element contains
      a ';', and it is not constructed using 'list'. E.g.:
      >set x {puts stdout a;puts stdout b};# string containing two commands
      puts stdout a;puts stdout b
      >lindex $x 2;# now $x will become a list, but the string rep is not adapted
      a;puts
      > eval $x
      a
      b
      
      Will this still function the same after applying this patch?
      
      A way out of this problem is simply disallowing that string
      elements contain ';'. Then the 'lindex $x 2' should simply
      give an error that the string cannot be converted to a valid
      list. Then, still, it is a slight incompatibility, but at
      least the user is pointed to the place where the real problem
      is: Trying to convert such kind of string to a list, which
      changes the semantics.
      
      This can be shown as well by:
      >lappend x c
      puts stdout {a;puts} stdout b
      
      Now magically, curly braces appear around the "a;puts"
      For the record: I agree with this patch, but the
      consequence for the list behavior should be well considered.
      
      Regards,
            Jan Nijtmans
      
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  11. Ticket change [c3a6ef82d4] (rid 111702) by dgp on 2008-06-03 03:17:11:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: YES
      
      
      Not to worry, Jan; we've been successfully
      distinguishing the 'pure' or canonical lists
      from other lists since the days of 8.3.0.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [192e38ca13] (rid 122773) by dkf on 2008-06-03 05:36:59:

    1. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      To be exact, the current logic distinguishes between lists in "proven canonical form" and everything else. A list is "proven canonical" when it either doesn't have a string representation at all, or when the string representation is derived from the list representation using UpdateStringOfList (IIRC). This avoids all the traps with things like semicolons, newlines, square brackets, etc. while remaining relatively robust in the face of things like debugging (unlike the previously used "pure list" concept). Non-canonical lists (well, they might be canonical, but we can't prove it cheaply) go through the other handling routes, which should be semantically the same even if less efficient in this case.
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  13. Ticket change [f055f865a4] (rid 109176) by msofer on 2008-06-08 10:23:24:

    1. closedate changed to: "2008-06-08T03:23:24"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      The third approach has been committed as part of Patch #1973096
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Accepted"
    7. status changed to: "Closed"
    8. username: "msofer"