nr = n->right;
switch(n->op) {
+ case ODOT:
+ case ODOTPTR:
+ case OCALLFUNC:
+ case OCALLMETH:
+ case OCALLINTER:
+ igen(n, &n1, res);
+ regalloc(a, types[tptr], &n1);
+ agen(&n1, a);
+ regfree(&n1);
+ break;
+
+ case OIND:
+ cgenr(n->left, a, res);
+ break;
+
case OINDEX:
p2 = nil; // to be patched to panicindex.
w = n->type->width;
regpc[i] = (uintptr)getcallerpc(&n);
goto out;
}
+ print("registers allocated at\n");
for(i=REGALLOC_R0; i<=REGALLOC_RMAX; i++)
print("%d %p\n", i, regpc[i]);
yyerror("out of fixed registers");
nr = n->right;
switch(n->op) {
+ case ODOT:
+ case ODOTPTR:
+ case OCALLFUNC:
+ case OCALLMETH:
+ case OCALLINTER:
+ igen(n, &n1, res);
+ regalloc(a, types[tptr], &n1);
+ agen(&n1, a);
+ regfree(&n1);
+ break;
+
+ case OIND:
+ cgenr(n->left, a, res);
+ break;
+
case OINDEX:
freelen = 0;
w = n->type->width;
void
sgen(Node *n, Node *ns, int64 w)
{
- Node nodl, nodr, oldl, oldr, cx, oldcx, tmp;
+ Node nodl, nodr, nodsi, noddi, cx, oldcx, tmp;
int32 c, q, odst, osrc;
if(debug['g']) {
}
if(n->ullman >= ns->ullman) {
- savex(D_SI, &nodr, &oldr, N, types[tptr]);
- agen(n, &nodr);
-
- regalloc(&nodr, types[tptr], &nodr); // mark nodr as live
- savex(D_DI, &nodl, &oldl, N, types[tptr]);
- agen(ns, &nodl);
- regfree(&nodr);
+ agenr(n, &nodr, N);
+ agenr(ns, &nodl, N);
} else {
- savex(D_DI, &nodl, &oldl, N, types[tptr]);
- agen(ns, &nodl);
-
- regalloc(&nodl, types[tptr], &nodl); // mark nodl as live
- savex(D_SI, &nodr, &oldr, N, types[tptr]);
- agen(n, &nodr);
- regfree(&nodl);
+ agenr(ns, &nodl, N);
+ agenr(n, &nodr, N);
}
+ nodreg(&noddi, types[tptr], D_DI);
+ nodreg(&nodsi, types[tptr], D_SI);
+ gmove(&nodl, &noddi);
+ gmove(&nodr, &nodsi);
+ regfree(&nodl);
+ regfree(&nodr);
c = w % 8; // bytes
q = w / 8; // quads
}
}
-
- restx(&nodl, &oldl);
- restx(&nodr, &oldr);
restx(&cx, &oldcx);
}
Children[0].(*UArr).
Children[0].(*UArr).
Children[0].(*UArr).
- // Children[0].(*UArr).
- // Children[0].(*UArr).
- // Children[0].(*UArr).
- // Children[0].(*UArr).
- // Children[0].(*UArr).
- // Children[0].(*UArr).
+ Children[0].(*UArr).
+ Children[0].(*UArr).
+ Children[0].(*UArr).
+ Children[0].(*UArr).
+ Children[0].(*UArr).
+ Children[0].(*UArr).
Children[0]
}
func (u *UArrPtr) Child(n int) J { return u.Children[n] }
func ChainAssertArrayptrIndex(u *UArrPtr) J {
- // TODO: don't crash on longer chains.
return u.
Children[0].(*UArrPtr).
Children[0].(*UArrPtr).
Children[0].(*UArrPtr).
Children[0].(*UArrPtr).
- // Children[0].(*UArrPtr).
- // Children[0].(*UArrPtr).
- // Children[0].(*UArrPtr).
- // Children[0].(*UArrPtr).
- // Children[0].(*UArrPtr).
- // Children[0].(*UArrPtr).
- // Children[0].(*UArrPtr).
- // Children[0].(*UArrPtr).
- // Children[0].(*UArrPtr).
+ Children[0].(*UArrPtr).
+ Children[0].(*UArrPtr).
+ Children[0].(*UArrPtr).
+ Children[0].(*UArrPtr).
+ Children[0].(*UArrPtr).
+ Children[0].(*UArrPtr).
+ Children[0].(*UArrPtr).
+ Children[0].(*UArrPtr).
+ Children[0].(*UArrPtr).
Children[0]
}