Menu

#634 Calling convention like "class method"

open
nobody
None
5
2019-07-19
2019-07-19
No

I suggest to add support for additional calling convention called, for example, __classcall. I think, it should be like fastcall, but first parameter (mostly pointer) pass in rare used (index) register. For example for z80: IY.
void objectReset(Object *obj); //here obj will be passed in IY
void objectUpdate(Object *obj, int value); //here IY=obj, HL=value
void objectProcess(Object *obj, void *buf, int size); //here IY=obj, (IX+2)=buf, (IX+4)=size
Currently Object-Oriented code produces much overhead, because each time first parameter is copied from one stack frame to another.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB