OLD | NEW |
1 // Inferno utils/5c/reg.c | 1 // Inferno utils/5c/reg.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/5c/reg.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/5c/reg.c |
3 // | 3 // |
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. | 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. |
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) | 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) |
6 // Portions Copyright © 1997-1999 Vita Nuova Limited | 6 // Portions Copyright © 1997-1999 Vita Nuova Limited |
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) | 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) |
8 // Portions Copyright © 2004,2006 Bruce Ellis | 8 // Portions Copyright © 2004,2006 Bruce Ellis |
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) | 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) |
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others | 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others |
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 case ARET: | 1068 case ARET: |
1069 for(z=0; z<BITS; z++) { | 1069 for(z=0; z<BITS; z++) { |
1070 cal.b[z] = externs.b[z] | ovar.b[z]; | 1070 cal.b[z] = externs.b[z] | ovar.b[z]; |
1071 ref.b[z] = 0; | 1071 ref.b[z] = 0; |
1072 } | 1072 } |
1073 break; | 1073 break; |
1074 | 1074 |
1075 default: | 1075 default: |
1076 // Work around for issue 1304: | 1076 // Work around for issue 1304: |
1077 // flush modified globals before each instruction. | 1077 // flush modified globals before each instruction. |
1078 » » » for(z=0; z<BITS; z++) | 1078 » » » for(z=0; z<BITS; z++) { |
1079 cal.b[z] |= externs.b[z]; | 1079 cal.b[z] |= externs.b[z]; |
| 1080 // issue 4066: flush modified return variables i
n case of panic |
| 1081 if(hasdefer) |
| 1082 cal.b[z] |= ovar.b[z]; |
| 1083 } |
1080 break; | 1084 break; |
1081 } | 1085 } |
1082 for(z=0; z<BITS; z++) { | 1086 for(z=0; z<BITS; z++) { |
1083 ref.b[z] = (ref.b[z] & ~r1->set.b[z]) | | 1087 ref.b[z] = (ref.b[z] & ~r1->set.b[z]) | |
1084 r1->use1.b[z] | r1->use2.b[z]; | 1088 r1->use1.b[z] | r1->use2.b[z]; |
1085 cal.b[z] &= ~(r1->set.b[z] | r1->use1.b[z] | r1->use2.b[
z]); | 1089 cal.b[z] &= ~(r1->set.b[z] | r1->use1.b[z] | r1->use2.b[
z]); |
1086 r1->refbehind.b[z] = ref.b[z]; | 1090 r1->refbehind.b[z] = ref.b[z]; |
1087 r1->calbehind.b[z] = cal.b[z]; | 1091 r1->calbehind.b[z] = cal.b[z]; |
1088 } | 1092 } |
1089 if(r1->active) | 1093 if(r1->active) |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 last->link = P; | 1782 last->link = P; |
1779 } | 1783 } |
1780 ········ | 1784 ········ |
1781 if(debug['R'] && debug['v']) { | 1785 if(debug['R'] && debug['v']) { |
1782 print("\n"); | 1786 print("\n"); |
1783 for(p=firstp; p; p=p->link) | 1787 for(p=firstp; p; p=p->link) |
1784 print("%P\n", p); | 1788 print("%P\n", p); |
1785 print("\n"); | 1789 print("\n"); |
1786 } | 1790 } |
1787 } | 1791 } |
OLD | NEW |