Skip to content
Tcl Source Code History Of Ticket 7b51dbf6ca
Login

History Of Ticket 7b51dbf6ca

Artifacts Associated With Ticket 7b51dbf6ca

  1. Ticket change [ea02d04661] (rid 171763) by beric on 2019-05-23 07:09:54:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      While experimenting if namespace exported commands were optimized as direct commands when argument is "args" and body is empty, I have found that bytecode generated for the commands were not regenerated correctly:
      
      <verbatim>
         namespace eval debug {
           proc assert {args} {}
           namespace export assert
         }
         namespace import ::debug::assert
         proc test1 {} {assert anything} 
      </verbatim>
      
      The generated bytecode shows that the assert call is optimized:
      
      <verbatim>
      tcl::unsupported::disassemble proc test1
      ByteCode 0x04910178, refCt 1, epoch 18, interp 0x0480C488 (epoch 18)
        Source "assert anything"
        Cmds 1, src 15, inst 3, litObjs 1, aux 0, stkDepth 1, code/src 0.00
        Proc 0x049051A0, refCt 1, args 0, compiled locals 0
        Commands 1:
            1: pc 0-1, src 0-14
        Command 1: "assert anything"
          (0) push1 0 	# ""
          (2) done 
      </verbatim>
      
      But redefining the assert command:
      
      <verbatim>
         proc debug::assert {args} {puts $args}
      </verbatim>
      
      The compile epoch has changed, but the assert call is still optimized:
      
      <verbatim>
      tcl::unsupported::disassemble proc test1
      ByteCode 0x04910178, refCt 1, epoch 19, interp 0x0480C488 (epoch 19)
        Source "assert anything"
        Cmds 1, src 15, inst 3, litObjs 1, aux 0, stkDepth 1, code/src 0.00
        Proc 0x049051A0, refCt 1, args 0, compiled locals 0
        Commands 1:
            1: pc 0-1, src 0-14
        Command 1: "assert anything"
          (0) push1 0 	# ""
          (2) done 
      </verbatim>
      
    5. foundin initialized to: "8.6.9"
    6. is_private initialized to: "0"
    7. login: "beric"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Critical"
    11. status initialized to: "Open"
    12. submitter initialized to: "beric"
    13. subsystem initialized to: "47. Bytecode Compiler"
    14. title initialized to:
      Code using namespace exported commands not regenerated correctly
      
    15. type initialized to: "Bug"
  2. Ticket change [3a22af6b5d] (rid 171764) by sebres on 2019-05-23 08:44:06:

    1. icomment:
      This has basically nothing with optimization and going to missing epoch "check" of compiled blocks with imported commands from other namespace...
      <code><pre style="padding-left:10pt">
      % namespace inscope tcl::dict {namespace export get}
      % namespace import tcl::dict::get
      % proc t1 {} {get {a 1} a}
      % t1; # get is compiled to dictGet 1
      1
      % proc tcl::dict::get args error; # overwrite command with proc
      % t1; # still compiled as dictGet 1
      1
      </pre></code>
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  3. Ticket change [e18710847b] (rid 258020) by serhiy.storchaka on 2026-10-14 15:25:07:

    1. icomment:
      The imported command gets a copy of the compileProc of the original command at import time, and keeps it when the original command is redefined, so the recompiled code still uses the old compileProc.
      
      Proposed fix in branch [/timeline?r=compile-imported-cmd-redefined|compile-imported-cmd-redefined]: an imported command is compiled as the command it refers to. Tests namespace-12.2 to namespace-12.6.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  4. Ticket change [ca26485856] (rid 258021) by serhiy.storchaka on 2026-10-14 15:25:48:

    1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
    2. login: "serhiy.storchaka"
  5. Ticket change [024d6ebd7d] (rid 258048) by dgp on 2026-10-14 16:50:17:

    1. icomment:
      
      Please check whether the proposed change disturbs the
      functioning of the [control::assert] command provided
      by the "control" package that is included in the tcllib collection.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  6. Ticket change [f419871a7b] (rid 258049) by serhiy.storchaka on 2026-10-14 17:24:20:

    1. icomment:
      I checked <nowiki>[control::assert]</nowiki> from the current tcllib trunk with main and with the branch: called as <nowiki>[control::assert]</nowiki> and through <nowiki>[namespace import]</nowiki>, from procs compiled before and after switching it with <nowiki>[control::control assert enabled]</nowiki>, and with a callback. The results are identical, and do.test and no-op.test of the control module pass with both.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  7. Ticket change [4b7338776a] (rid 258072) by dgp on 2026-10-14 19:09:42:

    1. icomment:
      
      Thank you for checking.
      
      More general comment is that [namespace import] has always
      been a distinct operation from [interp alias].  A rename
      of the "exported" command can change how the alias functions,
      while the imported command remains linked to what was imported
      in a stable way.
      
      Any "fix" that disrupts this difference needs careful examination.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  8. Ticket change [94467f14eb] (rid 258085) by serhiy.storchaka on 2026-10-14 20:26:40:

    1. icomment:
      The branch keeps this difference: an imported command is compiled as the command it is linked to, found by following the import (TclGetOriginalCommand()), not by name. I checked with main and the branch: after renaming the exported command, the import still calls it under its new name (also after redefining it there), and a new command created under the old name is not used; an alias follows the name. The only difference from main is that compiled calls no longer use the compiled form of the old definition.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  9. Ticket change [b9e4522f79] (rid 261578) by jan.nijtmans on 2026-11-13 12:32:23:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Merged to [12c60e9c42|trunk]
      
      To me this looks OK, but - in case I'm missing something - let's keep this in trunk for a while (so don't backport for 9.0.5 yet).
      
      Please test everything you can on trunk, and report here!
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
    5. resolution changed to: "Fixed"
    6. status changed to: "Pending"
  10. Ticket change [a24397582d] (rid 261893) by jan.nijtmans on 2026-11-18 17:54:45:

    1. icomment:
      Now merged to core-9-0-branch as well
      
      Would be nice for 8.6.19 as well.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  11. Ticket change [0215a27188] (rid 261915) by serhiy.storchaka on 2026-11-18 18:27:58:

    1. icomment: "Backported to core-8-6-branch: [69c0fdc481]."
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  12. Ticket change [7535e38d64] (rid 261919) by serhiy.storchaka on 2026-11-18 18:32:48:

    1. closedate changed to: "2461363.272776770872"
    2. closer changed to: "serhiy.storchaka"
    3. login: "serhiy.storchaka"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"