LEFT | RIGHT |
(no file at all) | |
1 // Derived from Inferno utils/6c/reg.c | 1 // Derived from Inferno utils/6c/reg.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/6c/reg.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/6c/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 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 mark(Prog *firstp) | 1598 mark(Prog *firstp) |
1599 { | 1599 { |
1600 Prog *p; | 1600 Prog *p; |
1601 ········ | 1601 ········ |
1602 for(p=firstp; p; p=p->link) { | 1602 for(p=firstp; p; p=p->link) { |
1603 if(p->reg != dead) | 1603 if(p->reg != dead) |
1604 break; | 1604 break; |
1605 p->reg = alive; | 1605 p->reg = alive; |
1606 if(p->as != ACALL && p->to.type == D_BRANCH && p->to.branch) | 1606 if(p->as != ACALL && p->to.type == D_BRANCH && p->to.branch) |
1607 mark(p->to.branch); | 1607 mark(p->to.branch); |
1608 » » if(p->as == AJMP || p->as == ARET || (p->as == ACALL && noreturn
(p))) | 1608 » » if(p->as == AJMP || p->as == ARET || p->as == AUNDEF) |
1609 break; | 1609 break; |
1610 } | 1610 } |
1611 } | 1611 } |
1612 | 1612 |
1613 static void | 1613 static void |
1614 fixjmp(Prog *firstp) | 1614 fixjmp(Prog *firstp) |
1615 { | 1615 { |
1616 int jmploop; | 1616 int jmploop; |
1617 Prog *p, *last; | 1617 Prog *p, *last; |
1618 ········ | 1618 ········ |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 last->link = P; | 1673 last->link = P; |
1674 } | 1674 } |
1675 ········ | 1675 ········ |
1676 if(debug['R'] && debug['v']) { | 1676 if(debug['R'] && debug['v']) { |
1677 print("\n"); | 1677 print("\n"); |
1678 for(p=firstp; p; p=p->link) | 1678 for(p=firstp; p; p=p->link) |
1679 print("%P\n", p); | 1679 print("%P\n", p); |
1680 print("\n"); | 1680 print("\n"); |
1681 } | 1681 } |
1682 } | 1682 } |
LEFT | RIGHT |