Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
}
/* }}} */

#ifdef FAST_ZPP
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
{
zend_function *active_function = EG(current_execute_data)->func;
Expand Down Expand Up @@ -291,7 +290,6 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
return 1;
}
/* }}} */
#endif

ZEND_API int ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
{
Expand Down
8 changes: 2 additions & 6 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,11 @@ END_EXTERN_C()

/* Fast parameter parsing API */

/* This API should be used only for really often used functions.
* (Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
/* Fast ZPP is always enabled now; this define is left in for compatibility
* with any existing conditional compilation blocks.
*/
#define FAST_ZPP 1

#ifdef FAST_ZPP

#define Z_EXPECTED_TYPES(_) \
_(Z_EXPECTED_LONG, "integer") \
_(Z_EXPECTED_BOOL, "boolean") \
Expand Down Expand Up @@ -1034,8 +1032,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, in
#define Z_PARAM_VARIADIC(spec, dest, dest_num) \
Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)

#endif /* FAST_ZPP */

/* End of new parameter parsing API */

/* Inlined implementations shared by new and old parameter parsing APIs */
Expand Down
67 changes: 1 addition & 66 deletions Zend/zend_builtin_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,9 @@ ZEND_FUNCTION(strlen)
{
zend_string *s;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &s) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(s)
ZEND_PARSE_PARAMETERS_END();
#endif

RETVAL_LONG(ZSTR_LEN(s));
}
Expand Down Expand Up @@ -692,16 +686,10 @@ ZEND_FUNCTION(error_reporting)
zval *err;
int old_error_reporting;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &err) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_ZVAL(err)
ZEND_PARSE_PARAMETERS_END();
#endif

old_error_reporting = EG(error_reporting);
if (ZEND_NUM_ARGS() != 0) {
Expand Down Expand Up @@ -815,18 +803,12 @@ ZEND_FUNCTION(define)
int case_sensitive = CONST_CS;
zend_constant c;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &name, &val, &non_cs) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_STR(name)
Z_PARAM_ZVAL(val)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(non_cs)
ZEND_PARSE_PARAMETERS_END();
#endif

if (non_cs) {
case_sensitive = 0;
Expand Down Expand Up @@ -907,15 +889,9 @@ ZEND_FUNCTION(defined)
{
zend_string *name;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
#endif

if (zend_get_constant_ex(name, NULL, ZEND_FETCH_CLASS_SILENT)) {
RETURN_TRUE;
Expand Down Expand Up @@ -1011,18 +987,12 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /*
zend_bool allow_string = only_subclass;
zend_bool retval;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS|b", &obj, &class_name, &allow_string) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ZVAL(obj)
Z_PARAM_STR(class_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(allow_string)
ZEND_PARSE_PARAMETERS_END();
#endif
/*
* allow_string - is_a default is no, is_subclass_of is yes.
* if it's allowed, then the autoloader will be called if the class does not exist.
Expand Down Expand Up @@ -1162,15 +1132,9 @@ ZEND_FUNCTION(get_object_vars)
zend_string *key;
zend_object *zobj;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_OBJECT(obj)
ZEND_PARSE_PARAMETERS_END();
#endif

if (Z_OBJ_HT_P(obj)->get_properties == NULL) {
RETURN_FALSE;
Expand Down Expand Up @@ -1306,16 +1270,11 @@ ZEND_FUNCTION(method_exists)
zend_string *lcname;
zend_class_entry * ce;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS", &klass, &method_name) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_ZVAL(klass)
Z_PARAM_STR(method_name)
ZEND_PARSE_PARAMETERS_END();
#endif
if (Z_TYPE_P(klass) == IS_OBJECT) {
ce = Z_OBJCE_P(klass);
} else if (Z_TYPE_P(klass) == IS_STRING) {
Expand Down Expand Up @@ -1411,17 +1370,11 @@ ZEND_FUNCTION(class_exists)
zend_class_entry *ce;
zend_bool autoload = 1;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &class_name, &autoload) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(class_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(autoload)
ZEND_PARSE_PARAMETERS_END();
#endif

if (!autoload) {
if (ZSTR_VAL(class_name)[0] == '\\') {
Expand Down Expand Up @@ -1454,17 +1407,11 @@ ZEND_FUNCTION(interface_exists)
zend_class_entry *ce;
zend_bool autoload = 1;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &iface_name, &autoload) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(iface_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(autoload)
ZEND_PARSE_PARAMETERS_END();
#endif

if (!autoload) {
if (ZSTR_VAL(iface_name)[0] == '\\') {
Expand Down Expand Up @@ -1496,17 +1443,11 @@ ZEND_FUNCTION(trait_exists)
zend_class_entry *ce;
zend_bool autoload = 1;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &trait_name, &autoload) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(trait_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(autoload)
ZEND_PARSE_PARAMETERS_END();
#endif

if (!autoload) {
if (ZSTR_VAL(trait_name)[0] == '\\') {
Expand Down Expand Up @@ -1539,15 +1480,9 @@ ZEND_FUNCTION(function_exists)
zend_function *func;
zend_string *lcname;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
#endif

if (ZSTR_VAL(name)[0] == '\\') {
/* Ignore leading "\" */
Expand Down
12 changes: 0 additions & 12 deletions Zend/zend_generators.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,15 +872,9 @@ ZEND_METHOD(Generator, send)
zval *value;
zend_generator *generator, *root;

#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

generator = (zend_generator *) Z_OBJ_P(getThis());

Expand Down Expand Up @@ -916,15 +910,9 @@ ZEND_METHOD(Generator, throw)
zval *exception, exception_copy;
zend_generator *generator;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &exception) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ZVAL(exception)
ZEND_PARSE_PARAMETERS_END();
#endif

ZVAL_DUP(&exception_copy, exception);

Expand Down
6 changes: 0 additions & 6 deletions ext/gettext/gettext.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,9 @@ PHP_NAMED_FUNCTION(zif_gettext)
char *msgstr;
zend_string *msgid;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &msgid) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(msgid)
ZEND_PARSE_PARAMETERS_END();
#endif

PHP_GETTEXT_LENGTH_CHECK("msgid", ZSTR_LEN(msgid))
msgstr = gettext(ZSTR_VAL(msgid));
Expand Down
Loading