phalcon/cphalcon — pull request #954 by sjinks (2013-07-30 03:55:09+00:00)
Title: kernel/fcall.c optimizations

* renamed all macros to follow the same style: phalcon_call_WHAT_pX(_noret)
* fixed inconsistencies in restoring memory frame on failure in phalcon_create_instance(_params)
* use variadic arguments instead of arrays in phalcon_call_WHAT_params()
* added phalcon_has_constructor_ce() which reuses the existing class entry (calls to Z_OBJCE_P() are expensive)
* removed a lot of functions from kernel/fcall.h — now that we don't need array to pass the parameters, we can use variadic macros instead
* introduced optimized macros PHALCON_CALL_FUNCTION, PHALCON_CALL_METHOD, PHALCON_CALL_PARENT, PHALCON_CALL_SELF, PHALCON_CALL_STATIC: they wrap phalcon_call_XXX_params() functions and restore memory frame on failures. If the compiler is GCC, these macros expand to pretty optimized calls: when the method or function name is a known compile time constant, its hash can also be computed at **compile time**. If the name is not a literal (say, a variable), then instead of `sizeof()` we use `strlen()` to make sure that the length will be correct.

PS: I will address failed Mongo tests in my next PR as they are not related to fcall.