~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/cmd/6g/ggen.c

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
        ptxt->to.offset |= rnd(stksize+maxarg, widthptr);
19
19
}
20
20
 
 
21
// Sweep the prog list to mark any used nodes.
 
22
void
 
23
markautoused(Prog* p)
 
24
{
 
25
        for (; p; p = p->link) {
 
26
                if (p->from.type == D_AUTO && p->from.node)
 
27
                        p->from.node->used++;
 
28
 
 
29
                if (p->to.type == D_AUTO && p->to.node)
 
30
                        p->to.node->used++;
 
31
        }
 
32
}
 
33
 
 
34
// Fixup instructions after compactframe has moved all autos around.
 
35
void
 
36
fixautoused(Prog* p)
 
37
{
 
38
        for (; p; p = p->link) {
 
39
                if (p->from.type == D_AUTO && p->from.node)
 
40
                        p->from.offset += p->from.node->stkdelta;
 
41
 
 
42
                if (p->to.type == D_AUTO && p->to.node)
 
43
                        p->to.offset += p->to.node->stkdelta;
 
44
        }
 
45
}
 
46
 
21
47
 
22
48
/*
23
49
 * generate:
102
128
 
103
129
        nodindreg(&nodsp, types[tptr], D_SP);
104
130
        nodo.xoffset += widthptr;
105
 
        cgen(&nodo, &nodsp);    // 0(SP) = 8(REG) -- i.s
 
131
        cgen(&nodo, &nodsp);    // 0(SP) = 8(REG) -- i.data
106
132
 
107
133
        nodo.xoffset -= widthptr;
108
 
        cgen(&nodo, &nodr);     // REG = 0(REG) -- i.m
 
134
        cgen(&nodo, &nodr);     // REG = 0(REG) -- i.tab
109
135
 
110
136
        nodo.xoffset = n->left->xoffset + 3*widthptr + 8;
111
 
        cgen(&nodo, &nodr);     // REG = 32+offset(REG) -- i.m->fun[f]
 
137
        cgen(&nodo, &nodr);     // REG = 32+offset(REG) -- i.tab->fun[f]
112
138
 
113
139
        // BOTCH nodr.type = fntype;
114
140
        nodr.type = n->left->type;