]> granicus.if.org Git - php/commitdiff
FAST_ZPP for hot functions
authorXinchen Hui <laruence@php.net>
Tue, 23 Dec 2014 07:43:34 +0000 (02:43 -0500)
committerXinchen Hui <laruence@php.net>
Wed, 24 Dec 2014 04:07:55 +0000 (23:07 -0500)
ext/mysql/php_mysql.c
ext/standard/array.c
ext/standard/math.c

index af5743c1245ee5a984fba1f949d5c6f0b9f0ccee..ff88aceb676712679f26b21cef983bef9b920950 100644 (file)
@@ -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;
index d2367385e0208dd5d60d23008a4e59209a8ded5e..e226b62ad2b0c12a0ff37a23416509fbe07dca73 100644 (file)
@@ -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) {
index 6d18c0b2ddf897545f2082bc968221f3b88f138f..0704195e5104ef2fdb1438ae8856d7f989ddca48 100644 (file)
@@ -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) {