From: Xinchen Hui Date: Tue, 23 Dec 2014 07:43:34 +0000 (-0500) Subject: FAST_ZPP for hot functions X-Git-Tag: PRE_PHP7_REMOVALS~35^2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3139ba61166fc0406e776ebcf69dd1e7cabe8f6d;p=php FAST_ZPP for hot functions --- diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index af5743c124..ff88aceb67 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -2078,9 +2078,18 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ if (into_object) { zend_string *class_name = NULL; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|Sz", &res, &class_name, &ctor_params) == FAILURE) { return; } +#else + ZEND_PARSE_PARAMETERS_START(1, 3) + Z_PARAM_ZVAL(res) + Z_PARAM_OPTIONAL + Z_PARAM_STR(class_name) + Z_PARAM_ZVAL(ctor_params) + ZEND_PARSE_PARAMETERS_END(); +#endif if (ZEND_NUM_ARGS() < 2) { ce = zend_standard_class_def; @@ -2092,11 +2101,18 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ return; } result_type = MYSQL_ASSOC; - } else - { + } else { +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &res, &result_type) == FAILURE) { return; } +#else + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_RESOURCE(res) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(result_type) + ZEND_PARSE_PARAMETERS_END(); +#endif if (!result_type) { /* result_type might have been set outside, so only overwrite when not set */ result_type = MYSQL_BOTH; diff --git a/ext/standard/array.c b/ext/standard/array.c index d2367385e0..e226b62ad2 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -240,9 +240,17 @@ PHP_FUNCTION(ksort) zval *array; zend_long sort_type = PHP_SORT_REGULAR; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) { RETURN_FALSE; } +#else + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ARRAY_EX(array, 0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(sort_type) + ZEND_PARSE_PARAMETERS_END(); +#endif php_set_compare_func(sort_type); @@ -1366,9 +1374,18 @@ PHP_FUNCTION(extract) int extract_refs = 0; zend_array *symbol_table; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|lz/", &var_array, &extract_type, &prefix) == FAILURE) { return; } +#else + ZEND_PARSE_PARAMETERS_START(1, 3) + Z_PARAM_ARRAY(var_array) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(extract_type) + Z_PARAM_ZVAL_EX(prefix, 0, 1) + ZEND_PARSE_PARAMETERS_END(); +#endif extract_refs = (extract_type & EXTR_REFS); if (extract_refs) { diff --git a/ext/standard/math.c b/ext/standard/math.c index 6d18c0b2dd..0704195e51 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -295,9 +295,16 @@ PHP_FUNCTION(abs) { zval *value; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } +#else + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + convert_scalar_to_number_ex(value); if (Z_TYPE_P(value) == IS_DOUBLE) {