Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch kbk-refactor-callframe Excluding Merge-Ins
This is equivalent to a diff from 7a21900824 to 933c8a03f0
2020-01-13
| ||
03:57 | Add elimination of LOAD-STORE redundancy - don't put into the callframe a value that we just got from there. This check may or may not be useful; the test suite exercises it but only on 'set x '. It does come up in other langauges. Leaf check-in: 933c8a03f0 user: kbk tags: kbk-refactor-callframe | |
2020-01-09
| ||
21:56 | Handle 'invokeExpanded'. Restore the ability to remove references to the callframe when calling compiled functions or builtins that don't use it. check-in: b54d2746cb user: kbk tags: kbk-refactor-callframe | |
2019-11-26
| ||
09:58 | Starting to support 8.7's arrays with defaults Leaf check-in: e7a8c3f643 user: dkf tags: dkf-array-default | |
2019-11-23
| ||
23:02 | merge trunk check-in: c3fc2d4137 user: kbk tags: notworking, kbk-refactor-callframe | |
22:35 | Merge trunk: a couple of ops that interact with the callframe and were missed while refactoring Leaf check-in: 19e26fa988 user: kbk tags: notworking, tcl_8_7_branch | |
22:29 | Merge in refactoring of two operations, directIsArray and directMakeArray, that interact with the callframe and were missed on the first go. Leaf check-in: 7a21900824 user: kbk tags: trunk | |
22:24 | directMakeArray interacts with the callframe Closed-Leaf check-in: 1f1e370993 user: kbk tags: kbk-refactor-directops | |
2019-11-19
| ||
03:52 | Merge refactoring so that all direct operations interact correctly with the callframe. check-in: b9e2a13b96 user: kbk tags: trunk | |
Changes to codegen/build.tcl.
︙ | |||
5393 5394 5395 5396 5397 5398 5399 | 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 | - + | # Results: # An IMPURE BOOLEAN LLVM value reference. method narrowToType.IMPURE_BOOLEAN(IMPURE\040ZEROONE\040BOOLEAN) {value {name ""}} { my addReference(STRING) [my impure.string $value] if {$name ne "" && [string match {[0-9]*} [GetValueName $value]]} { SetValueName $value $name |
︙ | |||
5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 | 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 | + + + + + + + + + + + + + + + + + | # An IMPURE NUMERIC LLVM value reference. method narrowToType.IMPURE_NUMERIC(STRING) {value {name ""}} { set nval [my call ${tcl.extractNumeric} [list $value]] my addReference(STRING) $value return [my impure NUMERIC $value $nval $name] } # Builder:narrowToType.IMPURE_ZEROONE_BOOLEAN(STRING) -- # # Generate code to parse the given STRING and extract a Boolean value, # either the integer 0 or 1 or one of the Boolean words. The STRING # is already known to contain a value of the right type. Quadcode # implementation ('narrowToType') # # Parameters: # value - The STRING LLVM reference to parse. # name (optional) - A name to give to the result value. method narrowToType.IMPURE_ZEROONE_BOOLEAN(STRING) {value {name ""}} { set bval [my call ${tcl.extractZeroOneBoolean} [list $value]] my addReference(STRING) $value return [my impure {ZEROONE BOOLEAN} $value $bval $name] } # Builder:nothing -- # # Create a Nothing NEXIST of the given type. # # Parameters: # type - The type of the NEXIST. |
︙ | |||
6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 | 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # # Results: # Returns an LLVM INT reference method returnCode(FAIL) {src ecode name} { my packInt32 $ecode } # Builder:returnCode(FAIL DOUBLE) -- # # Pass the Tcl return code through to an LLVM value # # Parameters: # src - The FAIL DOUBLE value that encodes the last interpreter action # ecode - The INT32 value that holds the return code # name (optional) - A name to give to the result value # # Results: # Returns an LLVM INT reference method returnCode(FAIL\040DOUBLE) {src ecode name} { my packInt32 $ecode } # Builder:returnCode(FAIL STRING) -- # # Pass the Tcl return code through to an LLVM value # # Parameters: # src - The FAIL STRING value that encodes the last interpreter action # ecode - The INT32 value that holds the return code # name (optional) - A name to give to the result value # # Results: # Returns an LLVM INT reference method returnCode(FAIL\040STRING) {src ecode name} { my dropReference(FAIL\040STRING) $src my packInt32 $ecode $name } # Builder:returnCode(FAIL ZEROONE) -- # # Pass the Tcl return code through to an LLVM value # # Parameters: # src - The FAIL ZEROONE value that encodes the last interpreter action # ecode - The INT32 value that holds the return code # name (optional) - A name to give to the result value # # Results: # Returns an LLVM INT reference method returnCode(FAIL\040ZEROONE) {src ecode name} { my packInt32 $ecode } # Builder:returnOptions(FAIL,INT) -- # # Get the Tcl exception dictionary. Quadcode implementation # ('returnOptions'). # # Parameters: # src - The Tcl status, as a LLVM FAIL reference # value - The Tcl result code, as an LLVM INT value reference. # name (optional) - # A name to give to the result value. # # Results: # An LLVM STRING reference. method returnOptions(FAIL,INT) {src value {name ""}} { my call ${tcl.getreturnopts} [list $value] $name } # Builder:returnOptions(FAIL DOUBLE,INT) -- # # Get the Tcl exception dictionary. Quadcode implementation # ('returnOptions'). # # Parameters: # src - The Tcl status, as a LLVM FAIL DOUBLE reference # value - The Tcl result code, as an LLVM INT value reference. # name (optional) - # A name to give to the result value. # # Results: # An LLVM STRING reference. method returnOptions(FAIL\040DOUBLE,INT) {src value {name ""}} { my call ${tcl.getreturnopts} [list $value] $name } # Builder:returnOptions(FAIL STRING,INT) -- # # Get the Tcl exception dictionary. Quadcode implementation # ('returnOptions'). # # Parameters: |
︙ |
Changes to codegen/compile.tcl.
︙ | |||
1275 1276 1277 1278 1279 1280 1281 | 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 | - + | } method IssueInvokeFunction {tgt func arguments vname} { upvar 1 callframe callframe thecallframe thecallframe set BASETYPES {ZEROONE INT DOUBLE NUMERIC STRING} set result [$b call $func $arguments $vname] |
︙ |
Changes to codegen/mathlib.tcl.
︙ | |||
28 29 30 31 32 33 34 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | - + + | variable tcl.add.numeric tcl.sub.numeric tcl.mult.numeric tcl.div.numeric variable tcl.pow.numeric tcl.land.numeric tcl.lor.numeric tcl.not.numeric variable tcl.not.numericOrBoolean variable tcl.neg.numeric tcl.eq.numeric tcl.ne.numeric tcl.lt.numeric variable tcl.le.numeric tcl.gt.numeric tcl.ge.numeric variable tcl.isBoolean tcl.isInteger tcl.isDouble variable tcl.isNumeric tcl.isNumericOrBoolean |
︙ | |||
1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 | 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | my condBr [my extract $b 0] $returnBoolean $getDouble label returnBoolean: my ret [my packNumericOrBooleanBoolean [my extract $b 1]] label getDouble: set i [my GetDouble $value] my br $testType } ##### Function tcl.extractZeroOneBoolean ##### # # Type signature: value:STRING -> ZEROONE # # Parse a STRING as a Boolean value. The value is known to be # parsable. Part of the implementation of quadcode 'narrowToType'. set f [$m local "tcl.extractZeroOneBoolean" "BOOLEAN<-STRING"] params value build { nonnull $value my br $testType label testType: set type [my dereference $value 0 Tcl_Obj.typePtr] my condBr [my nonnull $type] $testIsInt $testIsBoolean label testIsInt: my condBr [my isInteger $value] $returnInt $testIsBoolean label returnInt: set gw [my GetWide $value] set i [my extract $gw 1] my switch $i $no 0 $yes label no: my ret [Const true bool] label yes: my ret [Const false bool] label testIsBoolean: set b [my GetBoolean $value] my condBr [my extract $b 0] $returnBoolean $testIsInt label returnBoolean: my ret [my extract $b 1] } ##### Function tcl.extractDouble ##### # # Type signature: value:STRING -> DOUBLE # # Parse a STRING as a DOUBLE; the value is known to be parseable. # Part of the implementation of quadcode "narrowToType". |
︙ |
Changes to codegen/stdlib.tcl.
︙ | |||
2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 | 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 | + | label setSublist: $api TclListObjSetElement {} $parent $index $sublist my br $loop7 label loop7: my condBr [my shared $sublist] $mustDuplicate $loop8 label mustDuplicate: set dupeSublist [$api Tcl_DuplicateObj $sublist] my store $dupeSublist $subList $api TclListObjSetElement {} $parent $index $dupeSublist my br $loop8 label loop8: my store [my load $chain] \ [my cast(ptr) [my gep $parent 0 Tcl_Obj.internalRep 1] STRING] my store $parent $chain my br $loop1 |
︙ |
Changes to codegen/varframe.tcl.
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + | variable tcl.arraystring.addRef tcl.arraystring.addRef.nexist variable tcl.array.dropRef tcl.array.dropRef.nexist tcl.array.dropRef.fail variable tcl.arraystring.dropRef tcl.arraystring.dropRef.nexist variable tcl.array.init tcl.arraystring.init variable tcl.arraystring.extractarray tcl.arraystring.extractarray.nexist variable tcl.arraystring.extractscalar tcl.arraystring.extractscalar.nexist variable tcl.array.elemexists tcl.arraystring.elemexists |
︙ | |||
2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 | 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 | + + + + + + + + + + + + + + + + + + + + + | # TODO: What sort of flags should we watch out for? my addReference(STRING) $val my ret [my just $val] label unfound: my ret [my nothing STRING] } ##### Function tcl.array.get.nexist ##### # # Type signature: array:ARRAY! * key:STRING -> STRING! # # Retrieves the contents of an element from an array. Retrives # Nothing if the array does not exist # # TRICKY POINT: Does not handle traces or aliased elements. (Is the # latter even possible in Tcl?) set f [$m local tcl.array.get.nexist STRING!<-ARRAY!,STRING] params array key build { nonnull $key my condBr [my maybe $array] $nothing $realArray label nothing: my ret [my nothing STRING] label realArray: my ret [my Call tcl.array.get [my unmaybe $array] $key] } ##### Function tcl.array.set ##### # # Type signature: array:ARRAY * key:STRING * value:STRING -> ARRAY # # Sets the contents of an element in an array, returning the updated # array (which is actually the same as the input array; it is an # in-place modification). |
︙ |
Changes to demos/perftest/support.tcl.
︙ | |||
104 105 106 107 108 109 110 | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | global bytes # Copy/mod so that we don't have problems with bytecode caches set script " $op " # Run test multiple times to detect literal leakage problems set bytes [CleanByteArrayValue] puts -nonewline "eval $script:"; flush stdout |
︙ |
Changes to demos/perftest/tester.tcl.
︙ | |||
563 564 565 566 567 568 569 | 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 | - + | set x [lrange $l 0 1] set y [lrange $l 2 end] list $l $x $y } proc lsetest {l {ix { 2 }}} { for {set i 0} {$i < [llength $l]} {incr i} { |
︙ | |||
1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 | 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 | + + + + + + | for {set i 0} {$i < 100} {incr i} { incr x $adder incr y $adder incr y $adder } list $x $y } proc redundant-set {x} { set x $x set x $x return $x } namespace eval ::inlinetwice { proc carry limb { list [expr {$limb & 0x0FFFFFFF}] [expr {$limb >> 28}] } |
︙ | |||
2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 | 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 | + + + + + + + + + + + | proc toHex bin { regsub -all {..(?=.)} [binary encode hex $bin] {&:} } set key [fromHex {85:d6:be:78:57:55:6d:33:7f:44:52:fe:42:d5:06:a8:01:0 3:80:8a:fb:0d:b2:fd:4a:bf:f6:af:41:49:f5:1b}] set msg "Cryptographic Forum Research Group" set tag [fromHex {a8:06:1d:c1:30:51:36:c6:c2:2b:8b:af:0c:01:27:a9}] namespace eval minfunc { proc a {p q} { expr {min($p,$q)} } proc b {} { a 21 3 } } # A simple helper that is not compiled, but rather just shortens code below proc cleanopt {script} { variable cleanopt set code [uplevel 1 [list catch $script cleanopt(msg) cleanopt(opt)]] set msg $cleanopt(msg) |
︙ | |||
2561 2562 2563 2564 2565 2566 2567 | 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 | - - - - - - + - + - | upvartest1::check1 upvartest1::check2 upvartest2::test1 upvartest2::test2 upvartest2::test3 upvartest2::test4 |
︙ | |||
2644 2645 2646 2647 2648 2649 2650 | 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 | + + - + | regsubtest # Failure handling, [subst], [try] wideretest substtest substtest2 switchfail trimtest # See email chain at # https://sourceforge.net/p/tcl/mailman/message/36579552/ |
︙ | |||
2669 2670 2671 2672 2673 2674 2675 | 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 | - + + - + + + + + + + + + + + + + + + + + + + + + + + + - + + + | rangetest numberitems numberitems2 numberitems3 doubleitems containment lsorttest lsortcmd # Dictionary operations (also see some [try] tests) dictest |
︙ | |||
2703 2704 2705 2706 2707 2708 2709 | 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 | - + - + - - + + | coscaller1 coscaller2 xsum xsum2 # Namespace tests nstestaux::pts nstest::nstest0 nstest::nstest1 |
︙ | |||
2747 2748 2749 2750 2751 2752 2753 | 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 | + + - + + + + + + + + - + + + + - - + + + + + + + + + + + + + + + + | bug-7c599d4029::* singleton::* linesearch::colinear linesearch::sameline linesearch::getAllLines1 linesearch::getAllLines2 regexptest::* ::vartest::accum ::vartest::check |
︙ |
Added doc/20190216callframe/anticout.svg.
|
Added doc/20190216callframe/avail.svg.