Changeset 538


Ignore:
Timestamp:
07/24/16 13:50:23 (8 years ago)
Author:
Maciej Komosinski
Message:

Value of the assignment statement is now consistently the assigned value. Previously it was the value returned from set() (in cases where set() is used and the assigned expression is not a constant). Interestingly, Dictionary.set() returns the "before" value for the given key, and this created the delayed "assignment propagation" effect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/vm/framscript.y

    r523 r538  
    11841184                     {
    11851185                     if ($6.constant)
    1186                              {trctx.out->printf("move s0,m1\ncall [m1].\"set\",%s,%s\ninc m0\n",litstr($3),litstr($6));$$=$6;trstack.adjust(+1);}
     1186                             {trctx.out->printf("move s0,m1\ncall [m1].\"set\",%s,%s\ninc m0\n",litstr($3),litstr($6));trstack.adjust(+1);}
    11871187                     else
    1188                              {trctx.out->printf("move s1,m1\npush s0\nmove %s,s1\ncall [m1].\"set\"\nadd 2,m0\nmove s-2,s0\n",litstr($3));trstack.adjust(+1);}
     1188                             {trctx.out->printf("move s1,m1\npush s0\npush s0\nmove %s,s1\ncall [m1].\"set\"\nadd 3,m0\nmove s-1,s0\n",litstr($3));trstack.adjust(+1);}
    11891189                     }
    11901190             else
     
    11931193                             {trctx.out->printf("move s1,m1\npush %s\ncall [m1].\"set\"\nadd 3,m0\n",litstr($6)); trstack.adjust(+2);}
    11941194                     else
    1195                              {trctx.out->printf("move s2,m1\ncall [m1].\"set\"\nadd 2,m0\nmove s-2,s0\n"); trstack.adjust(+2);}
     1195                             {trctx.out->printf("move s2,m1\npush s1\npush s1\ncall [m1].\"set\"\nadd 4,m0\nmove s-2,s0\n"); trstack.adjust(+2);}
    11961196                     }
    11971197             }
     
    12761276                             {trctx.out->printf("move s0,m1\ncall [m1].\"set\",%s,%s\ninc m0\n",litstr($3),litstr($5));$$=$5;trstack.adjust(+1);}
    12771277                     else
    1278                              {trctx.out->printf("move s1,m1\npush s0\nmove %s,s1\ncall [m1].\"set\"\nadd 2,m0\nmove s-2,s0\n",litstr($3));trstack.adjust(+1);}
     1278                             {trctx.out->printf("move s1,m1\npush s0\npush s0\nmove %s,s1\ncall [m1].\"set\"\nadd 3,m0\nmove s-1,s0\n",litstr($3));trstack.adjust(+1);}
    12791279             }
    12801280
Note: See TracChangeset for help on using the changeset viewer.