Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 185719477ba58911fb9e505a2de87b8485325cdc
Ticket: 322720f99dbe67f791e557876bd46e734544b988
Poor bytecode (optimizations?) for || and &&
User & Date: dkf on 2017-03-04 12:38:12
Changes

  1. icomment:
    The problem is that the optimiser is not detecting this:
    <blockquote><pre>
            jumpTrue lbl1
            push "1"
            jump lbl2
    lbl1:   push "0"
    lbl2:   jump<i>Cond lbl3</i>
    </pre></blockquote>
    Whereas it is clearly provable that converting it into just this:
    <blockquote><pre>
            nop<sup><i>n</i></sup>
            jump<i>Cond lbl3</i>
    </pre></blockquote>
    would work fine (provided there are no other branches targeting anywhere inside the instruction sequence). <small>Note that the optimiser as it stands needs to keep the instructions that are placed in the same location (hence the <tt>nop</tt>s) but a compacting optimiser is entirely possible provided someone does the work.</small>
    <p>
    There may be related issues with the instruction sequence for <tt>&amp;&amp;</tt> and that should be checked at the same time. Test code should use <tt>tcl::unsupported::getbytecode</tt> instead of attempting to parse the disassembler output.
    
  2. login: "dkf"
  3. mimetype: "text/html"
  4. username: "dkf"