[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] [supercollider/supercollider] bf8c91: class library: bitTest method minor speed improvem...



On 04.11.2013, at 15:56, Jonatan Liljedahl <lijon@xxxxxxxxxxxx> wrote:

> Would it be possible to create real method "aliases", that would just
> forward to another method without actually parsing and re-passing the
> args?
> 

Many optimisations seem to be in place, if you look into PyrMessage.cpp:
HOT void sendMessage(VMGlobals *g, PyrSymbol *selector, long numArgsPushed)


case methRedirect : /* send a different selector to self, e.g. this.subclassResponsibility */
if (numArgsPushed < methraw->numargs) { // not enough args pushed
	/* push default arg values */
	PyrSlot *pslot, *qslot;
	long m, mmax;
	pslot = g->sp;
	qslot = slotRawObject(&meth->prototypeFrame)->slots + numArgsPushed - 1;
	for (m=0, mmax=methraw->numargs - numArgsPushed; m<mmax; ++m) slotCopy(++pslot, ++qslot);
	numArgsPushed = methraw->numargs;
	g->sp += mmax;
}
selector = slotRawSymbol(&meth->selectors);
goto lookup_again;
case methRedirectSuper : /* send a different selector to self, e.g. this.subclassResponsibility */
if (numArgsPushed < methraw->numargs) { // not enough args pushed
	/* push default arg values */
	PyrSlot *pslot, *qslot;
	long m, mmax;
	pslot = g->sp;
	qslot = slotRawObject(&meth->prototypeFrame)->slots + numArgsPushed - 1;
	for (m=0, mmax=methraw->numargs - numArgsPushed; m<mmax; ++m) slotCopy(++pslot, ++qslot);
	numArgsPushed = methraw->numargs;
	g->sp += mmax;
}
selector = slotRawSymbol(&meth->selectors);
classobj = slotRawSymbol(&slotRawClass(&meth->ownerclass)->superclass)->u.classobj;
goto lookup_again;






_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/