Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel/fcall.c optimizations #843

Merged
merged 23 commits into from Jul 15, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed not used functions
  • Loading branch information
sjinks committed Jul 14, 2013
commit ff759f17d0dcb2cc0a20b0b265b256f83dc45417
61 changes: 0 additions & 61 deletions ext/kernel/fcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,30 +386,6 @@ int phalcon_call_parent_func_two_params(zval *return_value, zval *object, char *
return phalcon_call_parent_func_params(return_value, object, active_class, active_class_len, method_name, method_len, 2, params TSRMLS_CC);
}

/**
* Call parent static function that requires three parameters
*/
int phalcon_call_parent_func_three_params(zval *return_value, zval *object, char *active_class, int active_class_len, char *method_name, int method_len, zval *param1, zval *param2, zval *param3 TSRMLS_DC){
zval *params[] = { param1, param2, param3 };
return phalcon_call_parent_func_params(return_value, object, active_class, active_class_len, method_name, method_len, 3, params TSRMLS_CC);
}

/**
* Call parent static function that requires four parameters
*/
int phalcon_call_parent_func_four_params(zval *return_value, zval *object, char *active_class, int active_class_len, char *method_name, int method_len, zval *param1, zval *param2, zval *param3, zval *param4 TSRMLS_DC){
zval *params[] = { param1, param2, param3, param4 };
return phalcon_call_parent_func_params(return_value, object, active_class, active_class_len, method_name, method_len, 4, params TSRMLS_CC);
}

/**
* Call parent static function that requires five parameters
*/
int phalcon_call_parent_func_five_params(zval *return_value, zval *object, char *active_class, int active_class_len, char *method_name, int method_len, zval *param1, zval *param2, zval *param3, zval *param4, zval *param5 TSRMLS_DC){
zval *params[] = { param1, param2, param3, param4, param5 };
return phalcon_call_parent_func_params(return_value, object, active_class, active_class_len, method_name, method_len, 5, params TSRMLS_CC);
}

/**
* Call self-class static function which requires parameters
*/
Expand Down Expand Up @@ -454,11 +430,6 @@ int phalcon_call_self_func_four_params(zval *return_value, zval *object, char *m
return phalcon_call_self_func_params(return_value, object, method_name, method_len, 4, params TSRMLS_CC);
}

int phalcon_call_self_func_five_params(zval *return_value, zval *object, char *method_name, int method_len, zval *param1, zval *param2, zval *param3, zval *param4, zval *param5 TSRMLS_DC){
zval *params[] = { param1, param2, param3, param4, param5 };
return phalcon_call_self_func_params(return_value, object, method_name, method_len, 5, params TSRMLS_CC);
}

/**
* Call single static function that requires one parameter
*/
Expand All @@ -483,14 +454,6 @@ int phalcon_call_static_func_three_params(zval *return_value, char *class_name,
return phalcon_call_static_func_params(return_value, class_name, class_length, method_name, method_len, 3, params TSRMLS_CC);
}

/**
* Call single static function that requires four parameters
*/
int phalcon_call_static_func_four_params(zval *return_value, char *class_name, int class_length, char *method_name, int method_len, zval *param1, zval *param2, zval *param3, zval *param4 TSRMLS_DC){
zval *params[] = { param1, param2, param3, param4 };
return phalcon_call_static_func_params(return_value, class_name, class_length, method_name, method_len, 4, params TSRMLS_CC);
}

/**
* Call single static function that requires five parameters
*/
Expand Down Expand Up @@ -578,14 +541,6 @@ int phalcon_call_static_zval_func_params(zval *return_value, zval *mixed_name, z
return phalcon_call_static_zval_str_func_params(return_value, mixed_name, Z_STRVAL_P(method), Z_STRLEN_P(method), param_count, params TSRMLS_CC);
}

/**
* Call single static function on a zval that requires one parameter
*/
int phalcon_call_static_zval_func_one_param(zval *return_value, zval *mixed_name, zval *method, zval *param1 TSRMLS_DC){
zval *params[] = { param1 };
return phalcon_call_static_zval_func_params(return_value, mixed_name, method, 1, params TSRMLS_CC);
}

/**
* Call single static function on a zval that requires one parameter
*/
Expand All @@ -594,22 +549,6 @@ int phalcon_call_static_zval_str_func_one_param(zval *return_value, zval *mixed_
return phalcon_call_static_zval_str_func_params(return_value, mixed_name, method_name, method_len, 1, params TSRMLS_CC);
}

/**
* Call single static function on a zval that requires one parameter
*/
int phalcon_call_static_zval_func_two_params(zval *return_value, zval *mixed_name, zval *method, int method_len, zval *param1, zval *param2 TSRMLS_DC){
zval *params[] = { param1, param2 };
return phalcon_call_static_zval_func_params(return_value, mixed_name, method, 2, params TSRMLS_CC);
}

/**
* Call single static function on a zval that requires one parameter
*/
int phalcon_call_static_zval_func_three_params(zval *return_value, zval *mixed_name, zval *method, zval *param1, zval *param2, zval *param3 TSRMLS_DC){
zval *params[] = { param1, param2, param3 };
return phalcon_call_static_zval_func_params(return_value, mixed_name, method, 3, params TSRMLS_CC);
}

int phalcon_call_static_ce_func_params(zval *return_value, zend_class_entry *ce, char *method_name, int method_len, zend_uint param_count, zval *params[] TSRMLS_DC)
{
return phalcon_call_static_func_params(return_value, (char*)ce->name, ce->name_length, method_name, method_len, param_count, params TSRMLS_CC);
Expand Down
7 changes: 0 additions & 7 deletions ext/kernel/fcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@
#define PHALCON_CALL_PARENT_PARAMS(return_value, object, active_class, method_name, param_count, params) if (phalcon_call_parent_func_params(return_value, object, active_class, sizeof(active_class)-1, method_name, sizeof(method_name)-1, param_count, params TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_PARENT_PARAMS_1(return_value, object, active_class, method_name, p1) if (phalcon_call_parent_func_one_param(return_value, object, active_class, sizeof(active_class)-1, method_name, sizeof(method_name)-1, p1 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_PARENT_PARAMS_2(return_value, object, active_class, method_name, p1, p2) if (phalcon_call_parent_func_two_params(return_value, object, active_class, sizeof(active_class)-1, method_name, sizeof(method_name)-1, p1, p2 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_PARENT_PARAMS_3(return_value, object, active_class, method_name, p1, p2, p3) if (phalcon_call_parent_func_three_params(return_value, object, active_class, sizeof(active_class)-1, method_name, sizeof(method_name)-1, p1, p2, p3 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_PARENT_PARAMS_NORETURN(object, active_class, method_name, param_count, params) if (phalcon_call_parent_func_params(NULL, object, active_class, sizeof(active_class)-1, method_name, sizeof(method_name)-1, param_count, params TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_PARENT_PARAMS_1_NORETURN(object, active_class, method_name, p1) if (phalcon_call_parent_func_one_param(NULL, object, active_class, sizeof(active_class)-1, method_name, sizeof(method_name)-1, p1 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_PARENT_PARAMS_2_NORETURN(object, active_class, method_name, p1, p2) if (phalcon_call_parent_func_two_params(NULL, object, active_class, sizeof(active_class)-1, method_name, sizeof(method_name)-1, p1, p2 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_PARENT_PARAMS_3_NORETURN(object, active_class, method_name, p1, p2, p3) if (phalcon_call_parent_func_three_params(NULL, object, active_class, sizeof(active_class)-1, method_name, sizeof(method_name)-1, p1, p2, p3 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_PARENT_NORETURN(object, active_class, method_name) if (phalcon_call_parent_func_params(NULL, object, active_class, sizeof(active_class)-1, method_name, sizeof(method_name)-1, 0, NULL TSRMLS_CC)==FAILURE) return;;

/** Use these functions to call static functions on the current class */
Expand All @@ -115,8 +113,6 @@
#define PHALCON_CALL_STATIC_PARAMS_2_NORETURN(class_name, method_name, p1, p2) if (phalcon_call_static_func_two_params(NULL, class_name, sizeof(class_name)-1, method_name, sizeof(method_name)-1, p1, p2 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_STATIC_PARAMS_3(return_value, class_name, method_name, p1, p2, p3) if (phalcon_call_static_func_three_params(return_value, class_name, sizeof(class_name)-1, method_name, sizeof(method_name)-1, p1, p2, p3 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_STATIC_PARAMS_3_NORETURN(class_name, method_name, p1, p2, p3) if (phalcon_call_static_func_three_params(NULL, class_name, sizeof(class_name)-1, method_name, sizeof(method_name)-1, p1, p2, p3 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_STATIC_PARAMS_4(return_value, class_name, method_name, p1, p2, p3, p4) if (phalcon_call_static_func_four_params(return_value, class_name, sizeof(class_name)-1, method_name, sizeof(method_name)-1, p1, p2, p3, p4 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_STATIC_PARAMS_4_NORETURN(class_name, method_name, p1, p2, p3, p4) if (phalcon_call_static_func_four_params(NULL, class_name, sizeof(class_name)-1, method_name, sizeof(method_name)-1, p1, p2, p3, p4 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_STATIC_PARAMS_5(return_value, class_name, method_name, p1, p2, p3, p4, p5) if (phalcon_call_static_func_five_params(return_value, class_name, sizeof(class_name)-1, method_name, sizeof(method_name)-1, p1, p2, p3, p4, p5 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_STATIC_PARAMS_5_NORETURN(class_name, method_name, p1, p2, p3, p4, p5) if (phalcon_call_static_func_five_params(NULL, class_name, sizeof(class_name)-1, method_name, sizeof(method_name)-1, p1, p2, p3, p4, p5 TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_STATIC(return_value, class_name, method_name) if (phalcon_call_static_func_params(return_value, class_name, sizeof(class_name)-1, method_name, sizeof(method_name)-1, 0, NULL TSRMLS_CC)==FAILURE) return;
Expand All @@ -125,7 +121,6 @@
/** Use these functions to call static functions using a zval as callable */
#define PHALCON_CALL_ZVAL_STATIC(return_value, class_zval, method) if (phalcon_call_static_zval_func_params(return_value, class_zval, method, 0, NULL TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_STATIC_ZVAL_PARAMS(return_value, class_zval, method, param_count, params) if (phalcon_call_static_zval_func_params(return_value, class_zval, method, param_count, params TSRMLS_CC)==FAILURE) return;
#define PHALCON_CALL_STATIC_ZVAL_PARAMS_1(return_value, class_zval, method, param1) if (phalcon_call_static_zval_func_one_param(return_value, class_zval, method, param1 TSRMLS_CC)==FAILURE) return;

#define phalcon_call_zval_static(return_value, class_zval, method) if (phalcon_call_static_zval_func_params(return_value, class_zval, method, 0, NULL TSRMLS_CC)==FAILURE) return;
#define phalcon_call_zval_static_params(return_value, class_zval, method, param_count, params) if (phalcon_call_static_zval_func_params(return_value, class_zval, method, param_count, params TSRMLS_CC)==FAILURE) return;
Expand Down Expand Up @@ -164,7 +159,6 @@ extern int phalcon_call_method_zval_params(zval *return_value, zval *object, zva
extern int phalcon_call_parent_func_params(zval *return_value, zval *object, char *active_class, int active_class_len, char *method_name, int method_len, zend_uint param_count, zval *params[] TSRMLS_DC);
extern int phalcon_call_parent_func_one_param(zval *return_value, zval *object, char *active_class, int active_class_len, char *method_name, int method_len, zval *param1 TSRMLS_DC);
extern int phalcon_call_parent_func_two_params(zval *return_value, zval *object, char *active_class, int active_class_len, char *method_name, int method_len, zval *param1, zval *param2 TSRMLS_DC);
extern int phalcon_call_parent_func_three_params(zval *return_value, zval *object, char *active_class, int active_class_len, char *method_name, int method_len, zval *param1, zval *param2, zval *param3 TSRMLS_DC);

/** Call methods on self class */
extern int phalcon_call_self_func_params(zval *return_value, zval *object, char *method_name, int method_len, zend_uint param_count, zval *params[] TSRMLS_DC);
Expand All @@ -178,7 +172,6 @@ extern int phalcon_call_static_func_params(zval *return_value, char *class_name,
extern int phalcon_call_static_func_one_param(zval *return_value, char *class_name, int class_name_len, char *method_name, int method_len, zval *param1 TSRMLS_DC);
extern int phalcon_call_static_func_two_params(zval *return_value, char *class_name, int class_name_len, char *method_name, int method_len, zval *param1, zval *param2 TSRMLS_DC);
extern int phalcon_call_static_func_three_params(zval *return_value, char *class_name, int class_name_len, char *method_name, int method_len, zval *param1, zval *param2, zval *param3 TSRMLS_DC);
extern int phalcon_call_static_func_four_params(zval *return_value, char *class_name, int class_name_len, char *method_name, int method_len, zval *param1, zval *param2, zval *param3, zval *param4 TSRMLS_DC);
extern int phalcon_call_static_func_five_params(zval *return_value, char *class_name, int class_name_len, char *method_name, int method_len, zval *param1, zval *param2, zval *param3, zval *param4, zval *param5 TSRMLS_DC);

extern int phalcon_call_static_zval_str_func_params(zval *return_value, zval *mixed_name, char *method_name, int method_len, zend_uint param_count, zval *params[] TSRMLS_DC);
Expand Down