Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | direct append operations interact with the callframe |
---|---|
Timelines: | family | ancestors | descendants | both | kbk-refactor-directops |
Files: | files | file ages | folders |
SHA3-256: |
9837744239b69f009bf5aeb7f36d4815 |
User & Date: | kbk 2019-11-12 03:13:50.262 |
Context
2019-11-13
| ||
03:55 | directUnset interacts with the callframe and retuns CALLFRAME FAIL check-in: e06c6257c1 user: kbk tags: kbk-refactor-directops | |
2019-11-12
| ||
03:13 | direct append operations interact with the callframe check-in: 9837744239 user: kbk tags: kbk-refactor-directops | |
02:48 | directArraySet interacts with the callframe check-in: 1ff2a97784 user: kbk tags: kbk-refactor-directops | |
Changes
Changes to codegen/build.tcl.
︙ | ︙ | |||
2554 2555 2556 2557 2558 2559 2560 | # Results: # The new dictionary value. method dictUnset(STRING,STRING) {dict key ec {name ""}} { my call ${tcl.dict.unset1} [list $dict $key $ec] $name } | | > > | > | > | > > | > | > | | 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 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 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 | # Results: # The new dictionary value. method dictUnset(STRING,STRING) {dict key ec {name ""}} { my call ${tcl.dict.unset1} [list $dict $key $ec] $name } # Builder:directAppend(CALLFRAME,STRING,STRING) -- # # Append a value to a variable, which should be referred to by a # fully-qualified name. NOTE: this operation can fail because of traces # so it produces a STRING FAIL. Quadcode implementation # ('directAppend'). # # Parameters: # cf - The callframe where non-fully-qualified variable names resolve # varname - # The variable name as an LLVM value reference. # value - The value to append as an LLVM value reference. # ec - Where to write the error code if an error happens. # name (optional) - # A name to give to the result value. # # Results: # The new contents of the variable. method directAppend(CALLFRAME,STRING,STRING) \ {cf varname value ec {name ""}} { set result [my call ${tcl.direct.append} [list $varname {} $value $ec] $name] return [my frame.pack $cf $result] } # Builder:directArrayAppend(CALLFRAME,STRING,STRING,STRING) -- # # Append a value to an array variable, which should be referred to by a # fully-qualified name. NOTE: this operation can fail because of traces # so it produces a STRING FAIL. Quadcode implementation # ('directArrayAppend'). # # Parameters: # cf - The callframe where non-fully-qualified names are resolved # varname - # The variable name as an LLVM value reference. # elem - The element name as an LLVM value reference. # value - The value to append as an LLVM value reference. # ec - Where to write the error code if an error happens. # name (optional) - # A name to give to the result value. # # Results: # The new contents of the variable. method directArrayAppend(CALLFRAME,STRING,STRING,STRING) \ {cf varname elem value ec {name ""}} { set result [my call ${tcl.direct.append} \ [list $varname $elem $value $ec] $name] return [my frame.pack $cf $result] } # Builder:directExists(STRING) -- # # Test if a variable exists; the variable should be referred to by a # fully-qualified name. Quadcode implementation ('directExists'). # # Parameters: |
︙ | ︙ | |||
2690 2691 2692 2693 2694 2695 2696 | {cf varname elem ec {name ""}} \ { set result [my call ${tcl.direct.get} \ [list $varname $elem $ec] $name] return [my frame.pack $cf $result] } | | > > | > | > | | > > | > | > | > > | > | > | | > > | > | > | | 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 2734 2735 2736 2737 2738 2739 2740 2741 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 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 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 | {cf varname elem ec {name ""}} \ { set result [my call ${tcl.direct.get} \ [list $varname $elem $ec] $name] return [my frame.pack $cf $result] } # Builder:directLappend(CALLFRAME,STRING,STRING) -- # # Append a value to a list in a variable, which should be referred to by # a fully-qualified name. NOTE: this operation can fail because of # traces so it produces a STRING FAIL. Quadcode implementation # ('directLappend'). # # Parameters: # cf - Callframe where non-fully-qualified variables resolve # varname - # The variable name as an LLVM value reference. # value - The value to append as an LLVM value reference. # ec - Where to write the error code if an error happens. # name (optional) - # A name to give to the result value. # # Results: # The new contents of the variable. method directLappend(CALLFRAME,STRING,STRING) \ {cf varname value ec {name ""}} { set result [my call ${tcl.direct.lappend} \ [list $varname {} $value $ec] $name] return [my frame.pack $cf $result] } # Builder:directArrayLappend(CALLFRAME,STRING,STRING,STRING) -- # # Append a value to a list in an array variable, which should be # referred to by a fully-qualified name. NOTE: this operation can fail # because of traces so it produces a STRING FAIL. Quadcode # implementation ('directArrayLappend'). # # Parameters: # cf - Callframe where non-fully-qualified variables resolve # varname - # The variable name as an LLVM value reference. # elem - The element name as an LLVM value reference. # value - The value to append as an LLVM value reference. # ec - Where to write the error code if an error happens. # name (optional) - # A name to give to the result value. # # Results: # The new contents of the variable. method directArrayLappend(CALLFRAME,STRING,STRING,STRING) \ {cf varname elem value ec {name ""}} { set result [my call ${tcl.direct.lappend} \ [list $varname $elem $value $ec] $name] return [my frame.pack $cf $result] } # Builder:directLappendList(CALLFRAME,STRING,STRING) -- # # Append the elements of a list to a list in a variable, which should be # referred to by a fully-qualified name. NOTE: this operation can fail # because of traces so it produces a STRING FAIL. Quadcode # implementation ('directLappendList'). # # Parameters: # cf - Callframe where non-fully-qualified variables resolve # varname - # The variable name as an LLVM value reference. # value - The list of values to append as an LLVM value reference. # ec - Where to write the error code if an error happens. # name (optional) - # A name to give to the result value. # # Results: # The new contents of the variable. method directLappendList(CALLFRAME,STRING,STRING) \ {cf varname value ec {name ""}} { set result [my call ${tcl.direct.lappendList} \ [list $varname {} $value $ec] $name] return [my frame.pack $cf $result] } # Builder:directLappendList(CALLFRAME,STRING,STRING,STRING) -- # # Append the elements of a list to a list in a variable, which should be # referred to by a fully-qualified name. NOTE: this operation can fail # because of traces so it produces a STRING FAIL. Quadcode # implementation ('directLappendList'). # # Parameters: # cf - Callframe where non-fully-qualified names should resolve # varname - # The variable name as an LLVM value reference. # elem - The element name as an LLVM value reference. # value - The list of values to append as an LLVM value reference. # ec - Where to write the error code if an error happens. # name (optional) - # A name to give to the result value. # # Results: # The new contents of the variable. method directArrayLappendList(CALLFRAME,STRING,STRING,STRING) \ {cf varname elem value ec {name ""}} { set result [my call ${tcl.direct.lappendList} \ [list $varname $elem $value $ec] $name] return [my frame.pack $cf $result] } # Builder:directSet(CALLFRAME,STRING,STRING) -- # # Set the value of a variable, which should be referred to by a # fully-qualified name. NOTE: this operation can fail because of traces # so it produces a STRING FAIL. Quadcode implementation ('directSet'). # |
︙ | ︙ |
Changes to codegen/compile.tcl.
︙ | ︙ | |||
517 518 519 520 521 522 523 | set srcs [my ConvertIndices 0 strlen 1 2] set res [$b $opcode {*}$srcs $errorCode $name] if {"FAIL" in [my ValueTypes $tgt]} { my SetErrorLine $errorCode [$b maybe $res] } my StoreResult $tgt $res } | < | < < | > > > > > | 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 | set srcs [my ConvertIndices 0 strlen 1 2] set res [$b $opcode {*}$srcs $errorCode $name] if {"FAIL" in [my ValueTypes $tgt]} { my SetErrorLine $errorCode [$b maybe $res] } my StoreResult $tgt $res } "directUnset" - "directArrayUnset" - "directIsArray" - "directMakeArray" - "regexp" - "listLength" - "listIn" - "listNotIn" - "dictIterStart" - "dictAppend" - "dictIncr" - "dictLappend" - "dictSize" - "div" - "expon" - "mod" - "verifyList" - "dictGetOrNexist" - "dictSetOrUnset" { set srcs [lassign $l opcode tgt] set name [my LocalVarName $tgt] append opcode ( [my ValueTypes {*}$srcs] ) set srcs [lmap s $srcs {my LoadOrLiteral $s}] set res [$b $opcode {*}$srcs $errorCode $name] if {"FAIL" in [my ValueTypes $tgt]} { my SetErrorLine $errorCode [$b maybe $res] } my StoreResult $tgt $res } "directGet" - "directSet" - "directArrayGet" - "directArraySet" - "directAppend" - "directLappend" - "directLappendList" - "directArrayAppend" - "directArrayLappend" - "directArrayLappendList" { set srcs [lassign $l opcode tgt] set name [my LocalVarName $tgt] append opcode ( [my ValueTypes {*}$srcs] ) set srcs [lmap s $srcs {my LoadOrLiteral $s}] set res [$b $opcode {*}$srcs $errorCode $name] set resNoCF [$b frame.value $res] my SetErrorLine $errorCode [$b maybe $resNoCF] |
︙ | ︙ |
Changes to quadcode/translate.tcl.
︙ | ︙ | |||
683 684 685 686 687 688 689 | my quads add $val {temp opd0} {temp opd1} my generate-callframe-op $pc directArraySet $var $var $elem $val } appendStk { set value [list temp [incr depth -1]] set var [list temp [incr depth -1]] # TODO: This assumes we're dealing with qualified names! | | > | | > | > | | | 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | my quads add $val {temp opd0} {temp opd1} my generate-callframe-op $pc directArraySet $var $var $elem $val } appendStk { set value [list temp [incr depth -1]] set var [list temp [incr depth -1]] # TODO: This assumes we're dealing with qualified names! my generate-callframe-op $pc directAppend $var $var $value } appendArrayStk { set value [list temp [incr depth -1]] set elem [list temp [incr depth -1]] set var [list temp [incr depth -1]] # TODO: This assumes we're dealing with qualified names! my generate-callframe-op \ $pc directArrayAppend $var $var $elem $value } lappendStk { set value [list temp [incr depth -1]] set var [list temp [incr depth -1]] # TODO: This assumes we're dealing with qualified names! # TODO: Typecheck: need list in $var my generate-callframe-op $pc directLappend $var $var $value } lappendListStk { set listvalue [list temp [incr depth -1]] set var [list temp [incr depth -1]] # TODO: This assumes we're dealing with qualified names! # TODO: Typecheck: need lists in $var and $listvalue my generate-callframe-op \ $pc directLappendList $var $var $listvalue } lappendArrayStk { set value [list temp [incr depth -1]] set elem [list temp [incr depth -1]] set var [list temp [incr depth -1]] # TODO: This assumes we're dealing with qualified names! # TODO: Typecheck: need list in $var my generate-callframe-op \ $pc directArrayLappend $var $var $elem $value } lappendListArrayStk { set listvalue [list temp [incr depth -1]] set elem [list temp [incr depth -1]] set var [list temp [incr depth -1]] # TODO: This assumes we're dealing with qualified names! # TODO: Typecheck: need lists in $var and $listvalue my generate-callframe-op $pc \ directArrayLappendList $var $var $elem $listvalue } existStk { set var [list temp [incr depth -1]] # TODO: This assumes we're dealing with qualified names! my quads directExists $var {temp @callframe} $var } |
︙ | ︙ |
Changes to quadcode/types.tcl.
︙ | ︙ | |||
758 759 760 761 762 763 764 | } resolveCmd { return $STRING } originCmd - frameArgs { return [expr {$STRING | $FAIL}] } | > | < < < < | 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 | } resolveCmd { return $STRING } originCmd - frameArgs { return [expr {$STRING | $FAIL}] } directGet - directSet - directArrayGet - directArraySet - directAppend - directLappend - directLappendList - directArrayAppend - directArrayLappend - directArrayLappendList { # Can't assume more; these may be touching traced variables return [expr {$CALLFRAME | $STRING | $FAIL}] } directExists - directArrayExists { return $BOOL } directUnset - directArrayUnset - directIsArray - directMakeArray { return [expr {$BOOL | $FAIL}] |
︙ | ︙ |