Commit 8e96b45f authored by Kai Backman's avatar Kai Backman

genembedtramp for arm

R=rsc
APPROVED=rsc
DELTA=104  (0 added, 33 deleted, 71 changed)
OCL=33531
CL=33535
parent 22140a17
...@@ -570,110 +570,77 @@ dsymptr(Sym *s, int off, Sym *x, int xoff) ...@@ -570,110 +570,77 @@ dsymptr(Sym *s, int off, Sym *x, int xoff)
void void
genembedtramp(Type *rcvr, Type *method, Sym *newnam) genembedtramp(Type *rcvr, Type *method, Sym *newnam)
{ {
fatal("genembedtramp not implemented"); Sym *e;
// TODO(kaib): re-lift from 8g int c, d, o;
// Sym *e; Prog *p;
// int c, d, o, loaded; Type *f;
// Prog *p;
// Type *f; e = method->sym;
for(d=0; d<nelem(dotlist); d++) {
// e = lookup(b->name); c = adddot1(e, rcvr, d, nil);
// for(d=0; d<nelem(dotlist); d++) { if(c == 1)
// c = adddot1(e, t, d, nil); goto out;
// if(c == 1) }
// goto out; fatal("genembedtramp %T.%S", rcvr, method->sym);
// }
// fatal("genembedtramp %T.%s", t, b->name); out:
newplist()->name = newname(newnam);
// out:
// // print("genembedtramp %d\n", d); //TEXT main·S_test2(SB),7,$0
// // print(" t = %lT\n", t); p = pc;
// // print(" name = %s\n", b->name); gins(ATEXT, N, N);
// // print(" sym = %S\n", b->sym); p->from.type = D_OREG;
// // print(" hash = 0x%ux\n", b->hash); p->from.name = D_EXTERN;
p->from.sym = newnam;
// newplist()->name = newname(b->sym); p->to.type = D_CONST2;
p->reg = 7;
// //TEXT main·S_test2(SB),7,$0 p->to.offset2 = 0;
// p = pc; p->to.reg = NREG;
// gins(ATEXT, N, N); print("1. %P\n", p);
// p->from.type = D_EXTERN;
// p->from.sym = b->sym; o = 0;
// p->to.type = D_CONST; for(c=d-1; c>=0; c--) {
// p->to.offset = 0; f = dotlist[c].field;
// p->reg = 7; o += f->width;
// //print("1. %P\n", p); if(!isptr[f->type->etype])
continue;
// loaded = 0;
// o = 0; //MOVW o(R0), R0
// for(c=d-1; c>=0; c--) { p = pc;
// f = dotlist[c].field; gins(AMOVW, N, N);
// o += f->width; p->from.type = D_OREG;
// if(!isptr[f->type->etype]) p->from.reg = REGARG;
// continue; p->from.offset = o;
// if(!loaded) { p->to.type = D_REG;
// loaded = 1; p->to.reg = REGARG;
// //MOVQ 8(SP), AX print("2. %P\n", p);
// p = pc; o = 0;
// gins(AMOVQ, N, N); }
// p->from.type = D_INDIR+D_SP; if(o != 0) {
// p->from.offset = 8; //MOVW $XX(R0), R0
// p->to.type = D_AX; p = pc;
// //print("2. %P\n", p); gins(AMOVW, N, N);
// } p->from.type = D_CONST;
p->from.reg = REGARG;
// //MOVQ o(AX), AX p->from.offset = o;
// p = pc; p->to.type = D_REG;
// gins(AMOVQ, N, N); p->to.reg = REGARG;
// p->from.type = D_INDIR+D_AX; print("3. %P\n", p);
// p->from.offset = o; }
// p->to.type = D_AX;
// //print("3. %P\n", p); f = dotlist[0].field;
// o = 0; //B main·*Sub_test2(SB)
// } if(isptr[f->type->etype])
// if(o != 0) { f = f->type;
// //ADDQ $XX, AX p = pc;
// p = pc; gins(AB, N, N);
// gins(AADDQ, N, N); p->to.type = D_OREG;
// p->from.type = D_CONST; p->to.reg = NREG;
// p->from.offset = o; p->to.name = D_EXTERN;
// if(loaded) p->to.sym = methodsym(method->sym, ptrto(f->type));
// p->to.type = D_AX; print("4. %P\n", p);
// else {
// p->to.type = D_INDIR+D_SP; pc->as = ARET; // overwrite AEND
// p->to.offset = 8;
// }
// //print("4. %P\n", p);
// }
// //MOVQ AX, 8(SP)
// if(loaded) {
// p = pc;
// gins(AMOVQ, N, N);
// p->from.type = D_AX;
// p->to.type = D_INDIR+D_SP;
// p->to.offset = 8;
// //print("5. %P\n", p);
// } else {
// // TODO(rsc): obviously this is unnecessary,
// // but 6l has a bug, and it can't handle
// // JMP instructions too close to the top of
// // a new function.
// p = pc;
// gins(ANOP, N, N);
// }
// f = dotlist[0].field;
// //JMP main·*Sub_test2(SB)
// if(isptr[f->type->etype])
// f = f->type;
// p = pc;
// gins(AJMP, N, N);
// p->to.type = D_EXTERN;
// p->to.sym = methodsym(lookup(b->name), ptrto(f->type));
// //print("6. %P\n", p);
// pc->as = ARET; // overwrite AEND
} }
void void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment