summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_API.c2
-rw-r--r--Zend/zend_API.h8
-rw-r--r--Zend/zend_builtin_functions.c67
-rw-r--r--Zend/zend_generators.c12
4 files changed, 3 insertions, 86 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 55c6be8711..4c77aa9575 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -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;
@@ -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) /* {{{ */
{
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 822dbb08b8..7fd7756674 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -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") \
@@ -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 */
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 6a0970d373..4f2a62d822 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -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));
}
@@ -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) {
@@ -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;
@@ -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;
@@ -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.
@@ -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;
@@ -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) {
@@ -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] == '\\') {
@@ -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] == '\\') {
@@ -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] == '\\') {
@@ -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 "\" */
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index 04fedbe200..6055e76e96 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -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());
@@ -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);