Skip to content
Tcl Source Code History Of Ticket aa10216459cdfe0f
Login

History Of Ticket aa10216459cdfe0f

Artifacts Associated With Ticket aa10216459cdfe0f

  1. Ticket change [2cb4761b0f] (rid 239772) by oehhar on 2025-05-05 08:31:54:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      Donal Fellows has authored bytecode improvements in the branch [https://core.tcl-lang.org/tcl/timeline?r=no-variable-width-instruction-issue&c=2025-05-04+16%3A43%3A44].
      
      The posted descriptions are recorded in this ticket by the cronicler Harald Oehlmann:
      
      The branch deprecates all operations that have a single byte for a jump offset, a variable index or an argument count (except for string concatenation). These are replaced with versions that use four-byte offsets/indices/counts. The affected instructions are:
      
      
         *   INST_PUSH1
         *   INST_INVOKE_STK1
         *   INST_LOAD_SCALAR1
         *   INST_LOAD_SCALAR_STK (wasn't issues by our compiler anyway)
         *   INST_LOAD_ARRAY1
         *   INST_STORE_SCALAR1
         *   INST_STORE_SCALAR_STK (another never-generated one)
         *   INST_STORE_ARRAY1
         *   INST_INCR_SCALAR1
         *   INST_INCR_ARRAY1
         *   INST_INCR_SCALAR1_IMM
         *   INST_INCR_ARRAY1_IMM
         *   INST_APPEND_SCALAR1
         *   INST_APPEND_ARRAY1
         *   INST_LAPPEND_SCALAR1
         *   INST_LAPPEND_ARRAY1
         *   INST_RETURN_CODE_BRANCH
         *   INST_TAILCALL
         *   INST_TCLOO_NEXT
         *   INST_TCLOO_NEXT_CLASS
      
      Some of these are replaced with their existing 4-byte versions. Some have new versions (now with 4-byte args):
      
         *   INST_INCR_SCALAR
         *   INST_INCR_ARRAY
         *   INST_INCR_SCALAR_IMM
         *   INST_INCR_ARRAY_IMM
         *   INST_TAILCALL
         *   INST_TCLOO_NEXT
         *   INST_TCLOO_NEXT_CLASS
      
      
      The replacement for INST_RETURN_CODE_BRANCH is INST_JUMP_TABLE_NUM that is a general numeric-keyed jump table. (Take note for the Tcl Compiler and TBCLoad: there's a new AUX type).
      
      I also add these new opcodes:
      
         *   INST_SWAP - Swap the top two items on the stack.
         *   INST_ERROR_PREFIX_EQ - Special equality for [try/trap]
         *   INST_TCLOO_ID - Get the creation ID of an object; not common, but easy
         *   INST_DICT_PUT - [dict replace] as an opcode, simplifying [try]
         *   INST_DICT_REMOVE - [dict remove] as an opcode, to fill out the suite available
         *   INST_IS_EMPTY - access to Tcl_IsEmpty (and enhancements to bytecode optimiser to use it)
      
      
      Some of the operations are made available to [tcl::unsupported::assemble]. Only the error prefix comparator isn't; that's got safety requirements on its argument that I'm not bothering to make the assembler understand.
      
      As far as I can tell, the test suite is passing. At least on Windows and excluding some tests that don't run on this laptop.
      
      A side note: the INST_JUMP_TABLE_NUM instruction will enable the addition of a new mode of operation for [switch] that I've been thinking about for a while: switching on integer equality, which I've seen the need for in handling things like switching on the number of arguments passed to a procedure. (It can't be safely done now because we use the wrong sort of equality testing.) I'll TIP that up once the instruction to make it practical hits the trunk.
      
    5. foundin initialized to: "main"
    6. is_private initialized to: "0"
    7. login: "oehhar"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "oehhar"
    14. subsystem initialized to: "47. Bytecode Compiler"
    15. title initialized to:
      bytecode using 4 bytes offsets and other improvements
      
    16. type initialized to: "RFE"
  2. Ticket change [ca78c7929c] (rid 253739) by apnadkarni on 2026-05-21 15:16:01:

    1. assignee changed to: "hoehlmann"
    2. icomment:
      Harald, can this ticket be closed now or did you have something more in mind.
      
    3. login: "apnadkarni"
    4. mimetype: "text/plain"
  3. Ticket change [e596c54e53] (rid 253743) by oehhar on 2026-05-22 06:55:24:

    1. closedate changed to: "2461182.7884727893"
    2. closer changed to: "oehhar"
    3. login: "oehhar"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"