|
|
|
|
|
by topkekz
3269 days ago
|
|
Only skimmed the article but i think they want something like this <T> objc_msgSend(Object *receiver, String *method, ...)
{
return get_method(receiver->class, method)(receiver, ...);
}
where the tail call is translated into an unconditional jump (like goto).EDIT: this GNU C extension could help avoiding assembly for implementing objc_msgSend https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Constructing-Ca... |
|
"It is not always simple to compute the proper value for size. The value is used by __builtin_apply to compute the amount of data that should be pushed on the stack and copied from the incoming argument area."
If there was a variant that didn't need this size argument (would probably require being a tail call) then that would do it.