cappuccino/cappuccino — pull request #2103 by mrcarlberg (2014-04-08 19:40:40+00:00)
Title: Fixed: Faster objj_msgSend

This is an experimental speed improvement of the function objj_msgSend.

The function objj_msgSend is the most used function in Cappuccino and a speedup will help almost all part of a Cappuccino application.

I need help from others to test this and get feedback on what kind of speedup or slowdown we get from this. I have seen a speedup in some cases of up to 5-10%. Does this have any other undesired effects?

Some test cases don't work but they are related to how the compiler generates code for the objj_msgSend function. Also the last flatten test case fails for some unknown reason.
The debug objj_msgSend_set_decorators are not supported right now. Maybe they don't need to if we only use this speed improvement for release builds.

Ok, how is this speed improvement done?

The old objj_msgSend function always checks if the class needs to be initialized. It also checks how many arguments are passed into the method. The last check is to improve the call to the method implementation with the correct number of arguments.

These two checks are eliminated by this pull request.