changeset 1371 | de4c37ac12fc |
parent 1281 | e70c494950b2 |
child 1382 | 10281d2f42d1 |
1370:ebed47a4723b | 1371:de4c37ac12fc |
---|---|
577 theReceiver codeOn:aStream inBlock:b for:aCompiler. |
577 theReceiver codeOn:aStream inBlock:b for:aCompiler. |
578 theArg notNil ifTrue:[ |
578 theArg notNil ifTrue:[ |
579 theArg codeOn:aStream inBlock:b for:aCompiler |
579 theArg codeOn:aStream inBlock:b for:aCompiler |
580 ]. |
580 ]. |
581 aStream nextPut:theByteCode. |
581 aStream nextPut:theByteCode. |
582 pos1 := aStream position. "/ remember branch target of left-fail branch |
582 pos1 := aStream position1Based. "/ remember branch target of left-fail branch |
583 aStream nextPut:0. |
583 aStream nextPut:0. |
584 |
584 |
585 "/ code the right of the and-part |
585 "/ code the right of the and-part |
586 theReceiver := receiver arg1. |
586 theReceiver := receiver arg1. |
587 theReceiver codeInlineOn:aStream inBlock:b for:aCompiler. |
587 theReceiver codeInlineOn:aStream inBlock:b for:aCompiler. |
589 jmp := #falseJump |
589 jmp := #falseJump |
590 ] ifFalse:[ |
590 ] ifFalse:[ |
591 jmp := #trueJump |
591 jmp := #trueJump |
592 ]. |
592 ]. |
593 aStream nextPut:jmp. |
593 aStream nextPut:jmp. |
594 pos2 := aStream position. "/ remember branch target of right-fail branch |
594 pos2 := aStream position1Based. "/ remember branch target of right-fail branch |
595 aStream nextPut:0. |
595 aStream nextPut:0. |
596 |
596 |
597 code := aStream contents. |
597 code := aStream contents. |
598 (selector == #ifFalse:ifTrue:) ifTrue:[ |
598 (selector == #ifFalse:ifTrue:) ifTrue:[ |
599 code at:pos1 put:(aStream position) |
599 code at:pos1 put:(aStream position1Based) |
600 ]. |
600 ]. |
601 |
601 |
602 "/ code the if-block |
602 "/ code the if-block |
603 block1 := argArray at: 1. |
603 block1 := argArray at: 1. |
604 block1 isBlock ifTrue:[ |
604 block1 isBlock ifTrue:[ |
616 aStream nextPut:#drop |
616 aStream nextPut:#drop |
617 ]. |
617 ]. |
618 ]. |
618 ]. |
619 |
619 |
620 aStream nextPut:#jump. |
620 aStream nextPut:#jump. |
621 pos3 := aStream position. |
621 pos3 := aStream position1Based. |
622 aStream nextPut:0. |
622 aStream nextPut:0. |
623 |
623 |
624 here := aStream position. |
624 here := aStream position1Based. |
625 (selector == #ifTrue:ifFalse:) ifTrue:[ |
625 (selector == #ifTrue:ifFalse:) ifTrue:[ |
626 code at:pos1 put:here |
626 code at:pos1 put:here |
627 ]. |
627 ]. |
628 code at:pos2 put:here. |
628 code at:pos2 put:here. |
629 |
629 |
643 valueNeeded ifFalse:[ |
643 valueNeeded ifFalse:[ |
644 aStream nextPut:#drop |
644 aStream nextPut:#drop |
645 ] |
645 ] |
646 ]. |
646 ]. |
647 |
647 |
648 code at:pos3 put:(aStream position) |
648 code at:pos3 put:(aStream position1Based) |
649 |
649 |
650 "Created: 6.9.1996 / 12:56:23 / cg" |
650 "Created: 6.9.1996 / 12:56:23 / cg" |
651 ! |
651 ! |
652 |
652 |
653 codeAndIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
653 codeAndIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
672 receiver1 codeOn:aStream inBlock:b for:aCompiler. |
672 receiver1 codeOn:aStream inBlock:b for:aCompiler. |
673 theArg notNil ifTrue:[ |
673 theArg notNil ifTrue:[ |
674 theArg codeOn:aStream inBlock:b for:aCompiler |
674 theArg codeOn:aStream inBlock:b for:aCompiler |
675 ]. |
675 ]. |
676 aStream nextPut:theByteCode. |
676 aStream nextPut:theByteCode. |
677 pos1 := aStream position. |
677 pos1 := aStream position1Based. |
678 aStream nextPut:0. |
678 aStream nextPut:0. |
679 |
679 |
680 andBlock := receiver arg1. "/ the and:-block |
680 andBlock := receiver arg1. "/ the and:-block |
681 (selector == #ifTrue:) ifTrue:[ |
681 (selector == #ifTrue:) ifTrue:[ |
682 jmp := #falseJump |
682 jmp := #falseJump |
701 jmp := optByteCode2. |
701 jmp := optByteCode2. |
702 ] ifFalse:[ |
702 ] ifFalse:[ |
703 andBlock codeInlineOn:aStream inBlock:b for:aCompiler. |
703 andBlock codeInlineOn:aStream inBlock:b for:aCompiler. |
704 ]. |
704 ]. |
705 aStream nextPut:jmp. |
705 aStream nextPut:jmp. |
706 pos2 := aStream position. |
706 pos2 := aStream position1Based. |
707 aStream nextPut:0. |
707 aStream nextPut:0. |
708 |
708 |
709 code := aStream contents. |
709 code := aStream contents. |
710 (selector == #ifFalse:) ifTrue:[ |
710 (selector == #ifFalse:) ifTrue:[ |
711 code at:pos1 put:(aStream position) |
711 code at:pos1 put:(aStream position1Based) |
712 ]. |
712 ]. |
713 block := argArray at: 1. |
713 block := argArray at: 1. |
714 block isBlock ifTrue:[ |
714 block isBlock ifTrue:[ |
715 block codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
715 block codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
716 ] ifFalse:[ |
716 ] ifFalse:[ |
727 ] |
727 ] |
728 ]. |
728 ]. |
729 |
729 |
730 valueNeeded ifTrue:[ |
730 valueNeeded ifTrue:[ |
731 aStream nextPut:#jump. |
731 aStream nextPut:#jump. |
732 pos3 := aStream position. |
732 pos3 := aStream position1Based. |
733 aStream nextPut:0. |
733 aStream nextPut:0. |
734 here := aStream position. |
734 here := aStream position1Based. |
735 (selector == #ifTrue:) ifTrue:[ |
735 (selector == #ifTrue:) ifTrue:[ |
736 code at:pos1 put:here |
736 code at:pos1 put:here |
737 ]. |
737 ]. |
738 code at:pos2 put:here. |
738 code at:pos2 put:here. |
739 aStream nextPut:#pushNil. |
739 aStream nextPut:#pushNil. |
740 code at:pos3 put:(aStream position) |
740 code at:pos3 put:(aStream position1Based) |
741 ] ifFalse:[ |
741 ] ifFalse:[ |
742 here := aStream position. |
742 here := aStream position1Based. |
743 (selector == #ifTrue:) ifTrue:[ |
743 (selector == #ifTrue:) ifTrue:[ |
744 code at:pos1 put:here |
744 code at:pos1 put:here |
745 ]. |
745 ]. |
746 code at:pos2 put:here |
746 code at:pos2 put:here |
747 ] |
747 ] |
752 |
752 |
753 |pos1 rightExpr| |
753 |pos1 rightExpr| |
754 |
754 |
755 receiver codeOn:aStream inBlock:b for:aCompiler. |
755 receiver codeOn:aStream inBlock:b for:aCompiler. |
756 valueNeeded ifTrue:[ |
756 valueNeeded ifTrue:[ |
757 aStream nextPut:#dup. |
757 aStream nextPut:#dup. |
758 ]. |
758 ]. |
759 aStream nextPut:#falseJump. |
759 aStream nextPut:#falseJump. |
760 pos1 := aStream position. |
760 pos1 := aStream position1Based. |
761 aStream nextPut:0. |
761 aStream nextPut:0. |
762 valueNeeded ifTrue:[ |
762 valueNeeded ifTrue:[ |
763 aStream nextPut:#drop. |
763 aStream nextPut:#drop. |
764 ]. |
764 ]. |
765 rightExpr := argArray at:1. |
765 rightExpr := argArray at:1. |
766 rightExpr codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
766 rightExpr codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
767 |
767 |
768 (aStream contents) at:pos1 put:(aStream position) |
768 (aStream contents) at:pos1 put:(aStream position1Based) |
769 |
769 |
770 "Created: 17.6.1996 / 15:46:42 / cg" |
770 "Created: 17.6.1996 / 15:46:42 / cg" |
771 "Modified: 17.6.1996 / 15:47:44 / cg" |
771 "Modified: 17.6.1996 / 15:47:44 / cg" |
772 ! |
772 ! |
773 |
773 |
926 selector == #and: ifTrue:[ |
926 selector == #and: ifTrue:[ |
927 aStream nextPut:#falseJump. |
927 aStream nextPut:#falseJump. |
928 ] ifFalse:[ |
928 ] ifFalse:[ |
929 aStream nextPut:#trueJump. |
929 aStream nextPut:#trueJump. |
930 ]. |
930 ]. |
931 pos1 := aStream position. |
931 pos1 := aStream position1Based. |
932 aStream nextPut:0. |
932 aStream nextPut:0. |
933 |
933 |
934 rightExpr := argArray at:1. |
934 rightExpr := argArray at:1. |
935 rightExpr isBlock ifTrue:[ |
935 rightExpr isBlock ifTrue:[ |
936 rightExpr codeInlineOn:aStream inBlock:b valueNeeded:true for:aCompiler. |
936 rightExpr codeInlineOn:aStream inBlock:b valueNeeded:true for:aCompiler. |
937 ] ifFalse:[ |
937 ] ifFalse:[ |
938 rightExpr codeOn:aStream inBlock:b for:aCompiler. |
938 rightExpr codeOn:aStream inBlock:b for:aCompiler. |
939 ]. |
939 ]. |
940 aStream nextPut:#retTop. |
940 aStream nextPut:#retTop. |
941 |
941 |
942 (aStream contents) at:pos1 put:(aStream position). |
942 (aStream contents) at:pos1 put:(aStream position1Based). |
943 selector == #and: ifTrue:[ |
943 selector == #and: ifTrue:[ |
944 aStream nextPut:#retFalse. |
944 aStream nextPut:#retFalse. |
945 ] ifFalse:[ |
945 ] ifFalse:[ |
946 aStream nextPut:#retTrue |
946 aStream nextPut:#retTrue |
947 ]. |
947 ]. |
952 super |
952 super |
953 codeForSimpleReturnOn:aStream |
953 codeForSimpleReturnOn:aStream |
954 inBlock:b |
954 inBlock:b |
955 lineNumber:lineNrOrNil |
955 lineNumber:lineNrOrNil |
956 for:aCompiler |
956 for:aCompiler |
957 |
|
958 |
|
959 |
|
960 ! |
957 ! |
961 |
958 |
962 codeIfElseOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
959 codeIfElseOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
963 "generate code for x ifxxx:[ ... ] yyy:[ ...]" |
960 "generate code for x ifxxx:[ ... ] yyy:[ ...]" |
964 |
961 |
1017 aStream nextPut:#lineno; nextPut:lineNr. |
1014 aStream nextPut:#lineno; nextPut:lineNr. |
1018 ] |
1015 ] |
1019 ]. |
1016 ]. |
1020 |
1017 |
1021 aStream nextPut:theByteCode. |
1018 aStream nextPut:theByteCode. |
1022 pos := aStream position. |
1019 pos := aStream position1Based. |
1023 aStream nextPut:0. |
1020 aStream nextPut:0. |
1024 needJump := true. |
1021 needJump := true. |
1025 block1 := argArray at:1. |
1022 block1 := argArray at:1. |
1026 block1 isBlock ifTrue:[ |
1023 block1 isBlock ifTrue:[ |
1027 block1 codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1024 block1 codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1041 aStream nextPut:#drop |
1038 aStream nextPut:#drop |
1042 ]. |
1039 ]. |
1043 ]. |
1040 ]. |
1044 needJump ifTrue:[ |
1041 needJump ifTrue:[ |
1045 aStream nextPut:#jump. |
1042 aStream nextPut:#jump. |
1046 pos2 := aStream position. |
1043 pos2 := aStream position1Based. |
1047 aStream nextPut:0. |
1044 aStream nextPut:0. |
1048 ]. |
1045 ]. |
1049 code := aStream contents. |
1046 code := aStream contents. |
1050 code at:pos put:(aStream position). |
1047 code at:pos put:(aStream position1Based). |
1051 block2 := (argArray at:2). |
1048 block2 := (argArray at:2). |
1052 block2 isBlock ifTrue:[ |
1049 block2 isBlock ifTrue:[ |
1053 block2 codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1050 block2 codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1054 ] ifFalse:[ |
1051 ] ifFalse:[ |
1055 block2 codeOn:aStream inBlock:b for:aCompiler. |
1052 block2 codeOn:aStream inBlock:b for:aCompiler. |
1063 valueNeeded ifFalse:[ |
1060 valueNeeded ifFalse:[ |
1064 aStream nextPut:#drop |
1061 aStream nextPut:#drop |
1065 ]. |
1062 ]. |
1066 ]. |
1063 ]. |
1067 needJump ifTrue:[ |
1064 needJump ifTrue:[ |
1068 code at:pos2 put:(aStream position) |
1065 code at:pos2 put:(aStream position1Based) |
1069 ] |
1066 ] |
1070 |
1067 |
1071 "Modified: 9.11.1996 / 19:53:52 / cg" |
1068 "Modified: 9.11.1996 / 19:53:52 / cg" |
1072 ! |
1069 ! |
1073 |
1070 |
1074 codeIfNilNotNilOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1071 codeIfNilNotNilOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1075 "generate code for x ifNil:[ ... ] ifNotNil:[...] |
1072 "generate code for x ifNil:[ ... ] ifNotNil:[...] |
1076 or: x ifNil:const1 ifNotNil:const2" |
1073 or: x ifNil:const1 ifNotNil:const2" |
1077 |
1074 |
1078 |pos pos2 theReceiver theArg theByteCode optByteCode subsel code |
1075 |pos pos2 theReceiver theArg theByteCode code |
1079 needLineNr block1 block2| |
1076 needLineNr block1 block2| |
1080 |
1077 |
1081 theReceiver := receiver. |
1078 theReceiver := receiver. |
1082 |
1079 |
1083 (selector == #ifNil:ifNotNil:) ifTrue:[ |
1080 (selector == #ifNil:ifNotNil:) ifTrue:[ |
1104 aStream nextPut:#lineno; nextPut:lineNr. |
1101 aStream nextPut:#lineno; nextPut:lineNr. |
1105 ] |
1102 ] |
1106 ]. |
1103 ]. |
1107 |
1104 |
1108 aStream nextPut:theByteCode. |
1105 aStream nextPut:theByteCode. |
1109 pos := aStream position. |
1106 pos := aStream position1Based. |
1110 aStream nextPut:0. |
1107 aStream nextPut:0. |
1111 block1 := argArray at: 1. |
1108 block1 := argArray at: 1. |
1112 block1 isBlock ifTrue:[ |
1109 block1 isBlock ifTrue:[ |
1113 block1 codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1110 block1 codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1114 ] ifFalse:[ |
1111 ] ifFalse:[ |
1123 valueNeeded ifFalse:[ |
1120 valueNeeded ifFalse:[ |
1124 aStream nextPut:#drop |
1121 aStream nextPut:#drop |
1125 ]. |
1122 ]. |
1126 ]. |
1123 ]. |
1127 aStream nextPut:#jump. |
1124 aStream nextPut:#jump. |
1128 pos2 := aStream position. |
1125 pos2 := aStream position1Based. |
1129 aStream nextPut:0. |
1126 aStream nextPut:0. |
1130 |
1127 |
1131 code := aStream contents. |
1128 code := aStream contents. |
1132 code at:pos put:(aStream position). |
1129 code at:pos put:(aStream position1Based). |
1133 block2 := argArray at: 2. |
1130 block2 := argArray at: 2. |
1134 block2 isBlock ifTrue:[ |
1131 block2 isBlock ifTrue:[ |
1135 block2 codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1132 block2 codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1136 ] ifFalse:[ |
1133 ] ifFalse:[ |
1137 block2 codeOn:aStream inBlock:b for:aCompiler. |
1134 block2 codeOn:aStream inBlock:b for:aCompiler. |
1146 aStream nextPut:#drop |
1143 aStream nextPut:#drop |
1147 ]. |
1144 ]. |
1148 ]. |
1145 ]. |
1149 |
1146 |
1150 code := aStream contents. |
1147 code := aStream contents. |
1151 code at:pos2 put:(aStream position) |
1148 code at:pos2 put:(aStream position1Based) |
1152 |
1149 |
1153 "Modified: / 11.2.2000 / 12:50:36 / cg" |
1150 "Modified: / 11.2.2000 / 12:50:36 / cg" |
1154 ! |
1151 ! |
1155 |
1152 |
1156 codeIfNilOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1153 codeIfNilOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1157 "generate code for x ifNil:[ ... ]" |
1154 "generate code for x ifNil:[ ... ]" |
1158 |
1155 |
1159 |pos pos2 theReceiver arg theByteCode optByteCode subsel code |
1156 |pos theReceiver arg theByteCode code |
1160 needLineNr| |
1157 needLineNr| |
1161 |
1158 |
1162 theReceiver := receiver. |
1159 theReceiver := receiver. |
1163 |
1160 |
1164 (selector == #ifNil:) ifTrue:[ |
1161 (selector == #ifNil:) ifTrue:[ |
1187 |
1184 |
1188 valueNeeded ifTrue:[ |
1185 valueNeeded ifTrue:[ |
1189 aStream nextPut:#dup. |
1186 aStream nextPut:#dup. |
1190 ]. |
1187 ]. |
1191 aStream nextPut:theByteCode. |
1188 aStream nextPut:theByteCode. |
1192 pos := aStream position. |
1189 pos := aStream position1Based. |
1193 aStream nextPut:0. |
1190 aStream nextPut:0. |
1194 valueNeeded ifTrue:[ |
1191 valueNeeded ifTrue:[ |
1195 aStream nextPut:#drop. |
1192 aStream nextPut:#drop. |
1196 ]. |
1193 ]. |
1197 |
1194 |
1211 aStream nextPut:#drop |
1208 aStream nextPut:#drop |
1212 ]. |
1209 ]. |
1213 ]. |
1210 ]. |
1214 |
1211 |
1215 code := aStream contents. |
1212 code := aStream contents. |
1216 code at:pos put:(aStream position) |
1213 code at:pos put:(aStream position1Based) |
1217 |
1214 |
1218 "Modified: / 28.10.1997 / 18:33:42 / cg" |
1215 "Modified: / 28.10.1997 / 18:33:42 / cg" |
1219 ! |
1216 ! |
1220 |
1217 |
1221 codeIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1218 codeIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1283 aStream nextPut:#lineno; nextPut:lineNr. |
1280 aStream nextPut:#lineno; nextPut:lineNr. |
1284 ] |
1281 ] |
1285 ]. |
1282 ]. |
1286 |
1283 |
1287 aStream nextPut:theByteCode. |
1284 aStream nextPut:theByteCode. |
1288 pos := aStream position. |
1285 pos := aStream position1Based. |
1289 aStream nextPut:0. |
1286 aStream nextPut:0. |
1290 block := (argArray at:1). |
1287 block := (argArray at:1). |
1291 block isBlock ifTrue:[ |
1288 block isBlock ifTrue:[ |
1292 block codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1289 block codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1293 ] ifFalse:[ |
1290 ] ifFalse:[ |
1305 ]. |
1302 ]. |
1306 |
1303 |
1307 code := aStream contents. |
1304 code := aStream contents. |
1308 valueNeeded ifTrue:[ |
1305 valueNeeded ifTrue:[ |
1309 aStream nextPut:#jump. |
1306 aStream nextPut:#jump. |
1310 pos2 := aStream position. |
1307 pos2 := aStream position1Based. |
1311 aStream nextPut:0. |
1308 aStream nextPut:0. |
1312 code at:pos put:(aStream position). |
1309 code at:pos put:(aStream position1Based). |
1313 aStream nextPut:#pushNil. |
1310 aStream nextPut:#pushNil. |
1314 code at:pos2 put:(aStream position) |
1311 code at:pos2 put:(aStream position1Based) |
1315 ] ifFalse:[ |
1312 ] ifFalse:[ |
1316 code at:pos put:(aStream position) |
1313 code at:pos put:(aStream position1Based) |
1317 ] |
1314 ] |
1318 |
1315 |
1319 "Modified: / 28.10.1997 / 18:33:42 / cg" |
1316 "Modified: / 28.10.1997 / 18:33:42 / cg" |
1320 ! |
1317 ! |
1321 |
1318 |
1704 theReceiver codeOn:aStream inBlock:b for:aCompiler. |
1701 theReceiver codeOn:aStream inBlock:b for:aCompiler. |
1705 theArg notNil ifTrue:[ |
1702 theArg notNil ifTrue:[ |
1706 theArg codeOn:aStream inBlock:b for:aCompiler |
1703 theArg codeOn:aStream inBlock:b for:aCompiler |
1707 ]. |
1704 ]. |
1708 aStream nextPut:theByteCode. |
1705 aStream nextPut:theByteCode. |
1709 pos1 := aStream position. "/ remember branch target of left-ok branch |
1706 pos1 := aStream position1Based. "/ remember branch target of left-ok branch |
1710 aStream nextPut:0. |
1707 aStream nextPut:0. |
1711 |
1708 |
1712 "/ code the right of the or-part |
1709 "/ code the right of the or-part |
1713 (selector == #ifTrue:ifFalse:) ifTrue:[ |
1710 (selector == #ifTrue:ifFalse:) ifTrue:[ |
1714 jmp := #falseJump |
1711 jmp := #falseJump |
1740 ] |
1737 ] |
1741 ] ifFalse:[ |
1738 ] ifFalse:[ |
1742 theReceiver codeInlineOn:aStream inBlock:b for:aCompiler. |
1739 theReceiver codeInlineOn:aStream inBlock:b for:aCompiler. |
1743 ]. |
1740 ]. |
1744 aStream nextPut:jmp. |
1741 aStream nextPut:jmp. |
1745 pos2 := aStream position. "/ remember branch target of right-fail branch |
1742 pos2 := aStream position1Based. "/ remember branch target of right-fail branch |
1746 aStream nextPut:0. |
1743 aStream nextPut:0. |
1747 |
1744 |
1748 |
1745 |
1749 code := aStream contents. |
1746 code := aStream contents. |
1750 (selector == #ifTrue:ifFalse:) ifTrue:[ |
1747 (selector == #ifTrue:ifFalse:) ifTrue:[ |
1751 code at:pos1 put:(aStream position) |
1748 code at:pos1 put:(aStream position1Based) |
1752 ]. |
1749 ]. |
1753 |
1750 |
1754 "/ code the if-block |
1751 "/ code the if-block |
1755 block1 := argArray at: 1. |
1752 block1 := argArray at: 1. |
1756 block1 isBlock ifTrue:[ |
1753 block1 isBlock ifTrue:[ |
1768 aStream nextPut:#drop |
1765 aStream nextPut:#drop |
1769 ] |
1766 ] |
1770 ]. |
1767 ]. |
1771 |
1768 |
1772 aStream nextPut:#jump. |
1769 aStream nextPut:#jump. |
1773 pos3 := aStream position. |
1770 pos3 := aStream position1Based. |
1774 aStream nextPut:0. |
1771 aStream nextPut:0. |
1775 |
1772 |
1776 here := aStream position. |
1773 here := aStream position1Based. |
1777 (selector == #ifFalse:ifTrue:) ifTrue:[ |
1774 (selector == #ifFalse:ifTrue:) ifTrue:[ |
1778 code at:pos1 put:here |
1775 code at:pos1 put:here |
1779 ]. |
1776 ]. |
1780 code at:pos2 put:here. |
1777 code at:pos2 put:here. |
1781 |
1778 |
1794 ]. |
1791 ]. |
1795 valueNeeded ifFalse:[ |
1792 valueNeeded ifFalse:[ |
1796 aStream nextPut:#drop |
1793 aStream nextPut:#drop |
1797 ] |
1794 ] |
1798 ]. |
1795 ]. |
1799 code at:pos3 put:(aStream position) |
1796 code at:pos3 put:(aStream position1Based) |
1800 |
1797 |
1801 "Created: 6.9.1996 / 13:08:52 / cg" |
1798 "Created: 6.9.1996 / 13:08:52 / cg" |
1802 ! |
1799 ! |
1803 |
1800 |
1804 codeOrIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1801 codeOrIfOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1821 theReceiver codeOn:aStream inBlock:b for:aCompiler. |
1818 theReceiver codeOn:aStream inBlock:b for:aCompiler. |
1822 theArg notNil ifTrue:[ |
1819 theArg notNil ifTrue:[ |
1823 theArg codeOn:aStream inBlock:b for:aCompiler |
1820 theArg codeOn:aStream inBlock:b for:aCompiler |
1824 ]. |
1821 ]. |
1825 aStream nextPut:theByteCode. |
1822 aStream nextPut:theByteCode. |
1826 pos1 := aStream position. |
1823 pos1 := aStream position1Based. |
1827 aStream nextPut:0. |
1824 aStream nextPut:0. |
1828 |
1825 |
1829 |
1826 |
1830 theReceiver := receiver arg1. |
1827 theReceiver := receiver arg1. |
1831 theArg := nil. |
1828 theArg := nil. |
1861 ] ifFalse:[ |
1858 ] ifFalse:[ |
1862 jmp := #trueJump |
1859 jmp := #trueJump |
1863 ]. |
1860 ]. |
1864 aStream nextPut:jmp |
1861 aStream nextPut:jmp |
1865 ]. |
1862 ]. |
1866 pos2 := aStream position. |
1863 pos2 := aStream position1Based. |
1867 aStream nextPut:0. |
1864 aStream nextPut:0. |
1868 (selector == #ifTrue:) ifTrue:[ |
1865 (selector == #ifTrue:) ifTrue:[ |
1869 (aStream contents) at:pos1 put:(aStream position) |
1866 (aStream contents) at:pos1 put:(aStream position1Based) |
1870 ]. |
1867 ]. |
1871 block := argArray at: 1. |
1868 block := argArray at: 1. |
1872 block isBlock ifTrue:[ |
1869 block isBlock ifTrue:[ |
1873 block codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1870 block codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1874 ] ifFalse:[ |
1871 ] ifFalse:[ |
1886 ]. |
1883 ]. |
1887 |
1884 |
1888 code := aStream contents. |
1885 code := aStream contents. |
1889 valueNeeded ifTrue:[ |
1886 valueNeeded ifTrue:[ |
1890 aStream nextPut:#jump. |
1887 aStream nextPut:#jump. |
1891 pos3 := aStream position. |
1888 pos3 := aStream position1Based. |
1892 aStream nextPut:0. |
1889 aStream nextPut:0. |
1893 here := aStream position. |
1890 here := aStream position1Based. |
1894 (selector == #ifFalse:) ifTrue:[ |
1891 (selector == #ifFalse:) ifTrue:[ |
1895 code at:pos1 put:here |
1892 code at:pos1 put:here |
1896 ]. |
1893 ]. |
1897 code at:pos2 put:here. |
1894 code at:pos2 put:here. |
1898 aStream nextPut:#pushNil. |
1895 aStream nextPut:#pushNil. |
1899 code at:pos3 put:(aStream position) |
1896 code at:pos3 put:(aStream position1Based) |
1900 ] ifFalse:[ |
1897 ] ifFalse:[ |
1901 here := aStream position. |
1898 here := aStream position1Based. |
1902 (selector == #ifFalse:) ifTrue:[ |
1899 (selector == #ifFalse:) ifTrue:[ |
1903 code at:pos1 put:here |
1900 code at:pos1 put:here |
1904 ]. |
1901 ]. |
1905 code at:pos2 put:here |
1902 code at:pos2 put:here |
1906 ] |
1903 ] |
1913 |
1910 |
1914 |pos1 rightExpr| |
1911 |pos1 rightExpr| |
1915 |
1912 |
1916 receiver codeOn:aStream inBlock:b for:aCompiler. |
1913 receiver codeOn:aStream inBlock:b for:aCompiler. |
1917 valueNeeded ifTrue:[ |
1914 valueNeeded ifTrue:[ |
1918 aStream nextPut:#dup. |
1915 aStream nextPut:#dup. |
1919 ]. |
1916 ]. |
1920 aStream nextPut:#trueJump. |
1917 aStream nextPut:#trueJump. |
1921 pos1 := aStream position. |
1918 pos1 := aStream position1Based. |
1922 aStream nextPut:0. |
1919 aStream nextPut:0. |
1923 valueNeeded ifTrue:[ |
1920 valueNeeded ifTrue:[ |
1924 aStream nextPut:#drop. |
1921 aStream nextPut:#drop. |
1925 ]. |
1922 ]. |
1926 rightExpr := argArray at:1. |
1923 rightExpr := argArray at:1. |
1927 rightExpr codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1924 rightExpr codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler. |
1928 |
1925 |
1929 (aStream contents) at:pos1 put:(aStream position) |
1926 (aStream contents) at:pos1 put:(aStream position1Based) |
1930 |
1927 |
1931 "Created: 17.6.1996 / 15:40:22 / cg" |
1928 "Created: 17.6.1996 / 15:40:22 / cg" |
1932 "Modified: 17.6.1996 / 15:47:22 / cg" |
1929 "Modified: 17.6.1996 / 15:47:22 / cg" |
1933 ! |
1930 ! |
1934 |
1931 |
1939 |pos code| |
1936 |pos code| |
1940 |
1937 |
1941 receiver codeOn:aStream inBlock:b for:aCompiler. |
1938 receiver codeOn:aStream inBlock:b for:aCompiler. |
1942 aStream nextPut:#dup. |
1939 aStream nextPut:#dup. |
1943 aStream nextPut:#notNilJump. |
1940 aStream nextPut:#notNilJump. |
1944 pos := aStream position. |
1941 pos := aStream position1Based. |
1945 aStream nextPut:0. |
1942 aStream nextPut:0. |
1946 |
1943 |
1947 aStream nextPut:#drop. |
1944 aStream nextPut:#drop. |
1948 (argArray at: 1) codeOn:aStream inBlock:b for:aCompiler. |
1945 (argArray at: 1) codeOn:aStream inBlock:b for:aCompiler. |
1949 |
1946 |
1950 code := aStream contents. |
1947 code := aStream contents. |
1951 code at:pos put:(aStream position). |
1948 code at:pos put:(aStream position1Based). |
1952 |
1949 |
1953 valueNeeded ifFalse:[ |
1950 valueNeeded ifFalse:[ |
1954 aStream nextPut:#drop. |
1951 aStream nextPut:#drop. |
1955 ]. |
1952 ]. |
1956 |
1953 |
1961 codeRepeatOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1958 codeRepeatOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
1962 "generate code for [ ... ] repeat" |
1959 "generate code for [ ... ] repeat" |
1963 |
1960 |
1964 |pos| |
1961 |pos| |
1965 |
1962 |
1966 pos := aStream position. |
1963 pos := aStream position1Based. |
1967 receiver codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
1964 receiver codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
1968 aStream nextPut:#jump; nextPut:pos. |
1965 aStream nextPut:#jump; nextPut:pos. |
1969 |
1966 |
1970 "Created: 29.8.1997 / 08:14:58 / cg" |
1967 "Created: 29.8.1997 / 08:14:58 / cg" |
1971 ! |
1968 ! |
2135 ]. |
2132 ]. |
2136 ]. |
2133 ]. |
2137 |
2134 |
2138 loopCount isNil ifTrue:[ |
2135 loopCount isNil ifTrue:[ |
2139 aStream nextPut:#pushgt0; nextPut:lineNr; nextPut:#falseJump. |
2136 aStream nextPut:#pushgt0; nextPut:lineNr; nextPut:#falseJump. |
2140 pos2 := aStream position. |
2137 pos2 := aStream position1Based. |
2141 aStream nextPut:0. |
2138 aStream nextPut:0. |
2142 ]. |
2139 ]. |
2143 |
2140 |
2144 pos1 := aStream position. |
2141 pos1 := aStream position1Based. |
2145 (argArray at:1) codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
2142 (argArray at:1) codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
2146 aStream nextPut:#minus1; nextPut:lineNr. |
2143 aStream nextPut:#minus1; nextPut:lineNr. |
2147 aStream nextPut:#pushgt0; nextPut:lineNr. |
2144 aStream nextPut:#pushgt0; nextPut:lineNr. |
2148 aStream nextPut:#trueJump; nextPut:pos1. |
2145 aStream nextPut:#trueJump; nextPut:pos1. |
2149 |
2146 |
2150 pos2 notNil ifTrue:[ |
2147 pos2 notNil ifTrue:[ |
2151 (aStream contents) at:pos2 put:(aStream position). |
2148 (aStream contents) at:pos2 put:(aStream position1Based). |
2152 ]. |
2149 ]. |
2153 aStream nextPut:#drop. "/ drop run variable |
2150 aStream nextPut:#drop. "/ drop run variable |
2154 |
2151 |
2155 lateEval ifTrue:[ |
2152 lateEval ifTrue:[ |
2156 receiver codeOn:aStream inBlock:b for:aCompiler. |
2153 receiver codeOn:aStream inBlock:b for:aCompiler. |
2213 aStream nextPut:#storeBlockVar; nextPut:stopVarIndex. |
2210 aStream nextPut:#storeBlockVar; nextPut:stopVarIndex. |
2214 ]. |
2211 ]. |
2215 ] |
2212 ] |
2216 ]. |
2213 ]. |
2217 |
2214 |
2218 pos := aStream position. |
2215 pos := aStream position1Based. |
2219 |
2216 |
2220 aStream nextPut:#dup. |
2217 aStream nextPut:#dup. |
2221 stopVarIndex notNil ifTrue:[ |
2218 stopVarIndex notNil ifTrue:[ |
2222 b isNil ifTrue:[ |
2219 b isNil ifTrue:[ |
2223 aStream nextPut:#pushMethodVar; nextPut:stopVarIndex. |
2220 aStream nextPut:#pushMethodVar; nextPut:stopVarIndex. |
2234 ]. |
2231 ]. |
2235 (aCompiler hasLineNumber:selector) ifTrue:[ |
2232 (aCompiler hasLineNumber:selector) ifTrue:[ |
2236 aStream nextPut:lineNr. |
2233 aStream nextPut:lineNr. |
2237 ]. |
2234 ]. |
2238 aStream nextPut:#trueJump. |
2235 aStream nextPut:#trueJump. |
2239 pos2 := aStream position. |
2236 pos2 := aStream position1Based. |
2240 aStream nextPut:0. |
2237 aStream nextPut:0. |
2241 |
2238 |
2242 theBlock := argArray at:3. |
2239 theBlock := argArray at:3. |
2243 |
2240 |
2244 "/ need a temporary in the outer context for |
2241 "/ need a temporary in the outer context for |
2272 ] |
2269 ] |
2273 ]. |
2270 ]. |
2274 |
2271 |
2275 aStream nextPut:#jump; nextPut:pos. |
2272 aStream nextPut:#jump; nextPut:pos. |
2276 |
2273 |
2277 (aStream contents) at:pos2 put:(aStream position). |
2274 (aStream contents) at:pos2 put:(aStream position1Based). |
2278 aStream nextPut:#drop. "/ drop run variable |
2275 aStream nextPut:#drop. "/ drop run variable |
2279 lateEval ifTrue:[ |
2276 lateEval ifTrue:[ |
2280 start codeOn:aStream inBlock:b for:aCompiler. |
2277 start codeOn:aStream inBlock:b for:aCompiler. |
2281 ]. |
2278 ]. |
2282 |
2279 |
2320 start codeOn:aStream inBlock:b for:aCompiler. |
2317 start codeOn:aStream inBlock:b for:aCompiler. |
2321 |
2318 |
2322 lateEval := false. |
2319 lateEval := false. |
2323 |
2320 |
2324 valueNeeded ifTrue:[ |
2321 valueNeeded ifTrue:[ |
2325 "/ easily reconstructable - no need to keep on stack |
2322 "/ easily reconstructable - no need to keep on stack |
2326 start isConstant ifTrue:[ |
2323 start isConstant ifTrue:[ |
2327 (start evaluate isMemberOf:SmallInteger) ifTrue:[ |
2324 (start evaluate isMemberOf:SmallInteger) ifTrue:[ |
2328 lateEval := true. |
2325 lateEval := true. |
2329 ] |
2326 ] |
2330 ]. |
2327 ]. |
2331 lateEval ifFalse:[ |
2328 lateEval ifFalse:[ |
2332 aStream nextPut:#dup |
2329 aStream nextPut:#dup |
2333 ]. |
2330 ]. |
2334 ]. |
2331 ]. |
2335 |
2332 |
2336 "/ if stop is not constant, and not an argVar, |
2333 "/ if stop is not constant, and not an argVar, |
2337 "/ evaluate it into a temp slot ... |
2334 "/ evaluate it into a temp slot ... |
2338 |
2335 |
2339 (stop isConstant and:[stop type == #Integer]) ifFalse:[ |
2336 (stop isConstant and:[stop type == #Integer]) ifFalse:[ |
2340 "/ a method/blockArg is constant as well ... |
2337 "/ a method/blockArg is constant as well ... |
2341 (stop isVariable and:[stop isArgument]) ifFalse:[ |
2338 (stop isVariable and:[stop isArgument]) ifFalse:[ |
2342 stop codeOn:aStream inBlock:b for:aCompiler. |
2339 stop codeOn:aStream inBlock:b for:aCompiler. |
2343 |
2340 |
2344 b isNil ifTrue:[ |
2341 b isNil ifTrue:[ |
2345 stopVarIndex := aCompiler addTempVar. |
2342 stopVarIndex := aCompiler addTempVar. |
2346 aStream nextPut:#storeMethodVar; nextPut:stopVarIndex. |
2343 aStream nextPut:#storeMethodVar; nextPut:stopVarIndex. |
2347 ] ifFalse:[ |
2344 ] ifFalse:[ |
2348 stopVarIndex := b addTempVar. |
2345 stopVarIndex := b addTempVar. |
2349 aStream nextPut:#storeBlockVar; nextPut:stopVarIndex. |
2346 aStream nextPut:#storeBlockVar; nextPut:stopVarIndex. |
2350 ]. |
2347 ]. |
2351 ] |
2348 ] |
2352 ]. |
2349 ]. |
2353 |
2350 |
2354 pos := aStream position. |
2351 pos := aStream position1Based. |
2355 |
2352 |
2356 aStream nextPut:#lineno; nextPut:lineNr. |
2353 aStream nextPut:#lineno; nextPut:lineNr. |
2357 |
2354 |
2358 aStream nextPut:#dup. |
2355 aStream nextPut:#dup. |
2359 stopVarIndex notNil ifTrue:[ |
2356 stopVarIndex notNil ifTrue:[ |
2360 b isNil ifTrue:[ |
2357 b isNil ifTrue:[ |
2361 aStream nextPut:#pushMethodVar; nextPut:stopVarIndex. |
2358 aStream nextPut:#pushMethodVar; nextPut:stopVarIndex. |
2362 ] ifFalse:[ |
2359 ] ifFalse:[ |
2363 aStream nextPut:#pushBlockVar; nextPut:stopVarIndex. |
2360 aStream nextPut:#pushBlockVar; nextPut:stopVarIndex. |
2364 ] |
2361 ] |
2365 ] ifFalse:[ |
2362 ] ifFalse:[ |
2366 stop codeOn:aStream inBlock:b for:aCompiler. |
2363 stop codeOn:aStream inBlock:b for:aCompiler. |
2367 ]. |
2364 ]. |
2368 aStream nextPut:#>. |
2365 aStream nextPut:#>. |
2369 (aCompiler hasLineNumber:selector) ifTrue:[ |
2366 (aCompiler hasLineNumber:selector) ifTrue:[ |
2370 aStream nextPut:lineNr. |
2367 aStream nextPut:lineNr. |
2371 ]. |
2368 ]. |
2372 aStream nextPut:#trueJump. |
2369 aStream nextPut:#trueJump. |
2373 pos2 := aStream position. |
2370 pos2 := aStream position1Based. |
2374 aStream nextPut:0. |
2371 aStream nextPut:0. |
2375 |
2372 |
2376 theBlock := argArray at:2. |
2373 theBlock := argArray at:2. |
2377 |
2374 |
2378 "/ need a temporary in the outer context for |
2375 "/ need a temporary in the outer context for |
2379 "/ the loop ... |
2376 "/ the loop ... |
2380 b isNil ifTrue:[ |
2377 b isNil ifTrue:[ |
2381 loopVarIndex := aCompiler addTempVar. |
2378 loopVarIndex := aCompiler addTempVar. |
2382 aStream nextPut:#dup. |
2379 aStream nextPut:#dup. |
2383 aStream nextPut:#storeMethodVar; nextPut:loopVarIndex. |
2380 aStream nextPut:#storeMethodVar; nextPut:loopVarIndex. |
2384 ] ifFalse:[ |
2381 ] ifFalse:[ |
2385 loopVarIndex := b addTempVar. |
2382 loopVarIndex := b addTempVar. |
2386 aStream nextPut:#dup. |
2383 aStream nextPut:#dup. |
2387 aStream nextPut:#storeBlockVar; nextPut:loopVarIndex. |
2384 aStream nextPut:#storeBlockVar; nextPut:loopVarIndex. |
2388 ]. |
2385 ]. |
2389 theBlock indexOfFirstTemp:loopVarIndex. |
2386 theBlock indexOfFirstTemp:loopVarIndex. |
2390 |
2387 |
2391 theBlock codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
2388 theBlock codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
2392 |
2389 |
2393 "/ increment counter & jump back. |
2390 "/ increment counter & jump back. |
2394 |
2391 |
2395 aStream nextPut:#plus1; nextPut:lineNr; nextPut:#jump; nextPut:pos. |
2392 aStream nextPut:#plus1; nextPut:lineNr; nextPut:#jump; nextPut:pos. |
2396 |
2393 |
2397 (aStream contents) at:pos2 put:(aStream position). |
2394 (aStream contents) at:pos2 put:(aStream position1Based). |
2398 aStream nextPut:#drop. "/ drop run variable |
2395 aStream nextPut:#drop. "/ drop run variable |
2399 lateEval ifTrue:[ |
2396 lateEval ifTrue:[ |
2400 start codeOn:aStream inBlock:b for:aCompiler. |
2397 start codeOn:aStream inBlock:b for:aCompiler. |
2401 ]. |
2398 ]. |
2402 |
2399 |
2403 "/ no need to nil-out loop-tempVar to help GC |
2400 "/ no need to nil-out loop-tempVar to help GC |
2404 "/ (its integer, anyway). |
2401 "/ (its integer, anyway). |
2405 |
2402 |
2406 b isNil ifTrue:[ |
2403 b isNil ifTrue:[ |
2407 aCompiler removeTempVar |
2404 aCompiler removeTempVar |
2408 ] ifFalse:[ |
2405 ] ifFalse:[ |
2409 b removeTempVar |
2406 b removeTempVar |
2410 ]. |
2407 ]. |
2411 |
2408 |
2412 stopVarIndex notNil ifTrue:[ |
2409 stopVarIndex notNil ifTrue:[ |
2413 b isNil ifTrue:[ |
2410 b isNil ifTrue:[ |
2414 aCompiler removeTempVar |
2411 aCompiler removeTempVar |
2415 ] ifFalse:[ |
2412 ] ifFalse:[ |
2416 b removeTempVar |
2413 b removeTempVar |
2417 ] |
2414 ] |
2418 ]. |
2415 ]. |
2419 |
2416 |
2420 "Created: 26.6.1997 / 10:58:47 / cg" |
2417 "Created: 26.6.1997 / 10:58:47 / cg" |
2421 "Modified: 19.10.1997 / 01:31:40 / cg" |
2418 "Modified: 19.10.1997 / 01:31:40 / cg" |
2422 ! |
2419 ! |
2471 "/ OLD: |
2468 "/ OLD: |
2472 "/ valueNeeded ifTrue:[aStream nextPut:#pushNil]. |
2469 "/ valueNeeded ifTrue:[aStream nextPut:#pushNil]. |
2473 "/ |
2470 "/ |
2474 needLineNr := true. |
2471 needLineNr := true. |
2475 |
2472 |
2476 pos := aStream position. |
2473 pos := aStream position1Based. |
2477 |
2474 |
2478 "/ aCompiler lineNumberInfo == #full ifTrue:[ |
2475 "/ aCompiler lineNumberInfo == #full ifTrue:[ |
2479 self codeLineNumber:lineNr on:aStream for:aCompiler. |
2476 self codeLineNumber:lineNr on:aStream for:aCompiler. |
2480 needLineNr := false. |
2477 needLineNr := false. |
2481 "/ ]. |
2478 "/ ]. |
2547 |
2544 |
2548 "/ [...] whileXXX:[...] |
2545 "/ [...] whileXXX:[...] |
2549 |
2546 |
2550 theByteCode ~~ #never ifTrue:[ |
2547 theByteCode ~~ #never ifTrue:[ |
2551 aStream nextPut:theByteCode. |
2548 aStream nextPut:theByteCode. |
2552 pos2 := aStream position. |
2549 pos2 := aStream position1Based. |
2553 aStream nextPut:0. |
2550 aStream nextPut:0. |
2554 ]. |
2551 ]. |
2555 |
2552 |
2556 (argArray at:1) codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
2553 (argArray at:1) codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
2557 aStream nextPut:#jump; nextPut:pos. |
2554 aStream nextPut:#jump; nextPut:pos. |
2558 theByteCode ~~ #never ifTrue:[ |
2555 theByteCode ~~ #never ifTrue:[ |
2559 (aStream contents) at:pos2 put:(aStream position). |
2556 (aStream contents) at:pos2 put:(aStream position1Based). |
2560 ]. |
2557 ]. |
2561 |
2558 |
2562 valueNeeded ifTrue:[aStream nextPut:#pushNil]. |
2559 valueNeeded ifTrue:[aStream nextPut:#pushNil]. |
2563 |
2560 |
2564 "Modified: 22.10.1996 / 21:34:37 / cg" |
2561 "Modified: 22.10.1996 / 21:34:37 / cg" |
2619 needLineNr := true. |
2616 needLineNr := true. |
2620 |
2617 |
2621 hasLoopBlock ifTrue:[ |
2618 hasLoopBlock ifTrue:[ |
2622 (argArray at:1) isEmptyBlock ifFalse:[ |
2619 (argArray at:1) isEmptyBlock ifFalse:[ |
2623 aStream nextPut:#jump. |
2620 aStream nextPut:#jump. |
2624 pos0 := aStream position. |
2621 pos0 := aStream position1Based. |
2625 aStream nextPut:0. |
2622 aStream nextPut:0. |
2626 |
2623 |
2627 pos := aStream position. |
2624 pos := aStream position1Based. |
2628 (argArray at:1) codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
2625 (argArray at:1) codeInlineOn:aStream inBlock:b valueNeeded:false for:aCompiler. |
2629 |
2626 |
2630 (aStream contents) at:pos0 put:(aStream position). |
2627 (aStream contents) at:pos0 put:(aStream position1Based). |
2631 ] |
2628 ] |
2632 ] ifFalse:[ |
2629 ] ifFalse:[ |
2633 pos := aStream position. |
2630 pos := aStream position1Based. |
2634 ]. |
2631 ]. |
2635 |
2632 |
2636 optByteCode isNil ifTrue:[ |
2633 optByteCode isNil ifTrue:[ |
2637 blockExpr := theReceiver simpleSendBlockExpression. |
2634 blockExpr := theReceiver simpleSendBlockExpression. |
2638 blockExpr notNil ifTrue:[ |
2635 blockExpr notNil ifTrue:[ |
3073 ! ! |
3070 ! ! |
3074 |
3071 |
3075 !MessageNode class methodsFor:'documentation'! |
3072 !MessageNode class methodsFor:'documentation'! |
3076 |
3073 |
3077 version |
3074 version |
3078 ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.124 2002-06-19 12:08:34 cg Exp $' |
3075 ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.125 2003-02-25 11:47:23 cg Exp $' |
3079 ! ! |
3076 ! ! |