Convert zend_parse_parameters_none() to fast ZPP

I've done the conversion in those extensions where fast ZPP is predominant.
This commit is contained in:
Máté Kocsis 2020-01-03 12:11:45 +01:00
parent b7d2882fee
commit 8f4f1dea34
No known key found for this signature in database
GPG key ID: FD055E41728BF310
9 changed files with 60 additions and 130 deletions

View file

@ -190,9 +190,7 @@ int zend_startup_builtin_functions(void) /* {{{ */
Get the version of the Zend Engine */
ZEND_FUNCTION(zend_version)
{
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
RETURN_STRINGL(ZEND_VERSION, sizeof(ZEND_VERSION)-1);
}
@ -203,9 +201,7 @@ ZEND_FUNCTION(zend_version)
Returns number of freed bytes */
ZEND_FUNCTION(gc_mem_caches)
{
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
RETURN_LONG(zend_mm_gc(zend_mm_get_heap()));
}
@ -216,9 +212,7 @@ ZEND_FUNCTION(gc_mem_caches)
Returns number of freed zvals */
ZEND_FUNCTION(gc_collect_cycles)
{
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
RETURN_LONG(gc_collect_cycles());
}
@ -228,9 +222,7 @@ ZEND_FUNCTION(gc_collect_cycles)
Returns status of the circular reference collector */
ZEND_FUNCTION(gc_enabled)
{
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
RETURN_BOOL(gc_enabled());
}
@ -242,9 +234,7 @@ ZEND_FUNCTION(gc_enable)
{
zend_string *key;
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
zend_alter_ini_entry_chars(key, "1", sizeof("1")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
@ -258,9 +248,7 @@ ZEND_FUNCTION(gc_disable)
{
zend_string *key;
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
zend_alter_ini_entry_chars(key, "0", sizeof("0")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
@ -274,9 +262,7 @@ ZEND_FUNCTION(gc_status)
{
zend_gc_status status;
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
zend_gc_get_status(&status);
@ -295,9 +281,7 @@ ZEND_FUNCTION(func_num_args)
{
zend_execute_data *ex = EX(prev_execute_data);
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
zend_error(E_WARNING, "func_num_args(): Called from the global scope - no function context");
@ -759,9 +743,7 @@ ZEND_FUNCTION(get_called_class)
{
zend_class_entry *called_scope;
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
called_scope = zend_get_called_scope(execute_data);
if (called_scope) {
@ -1352,9 +1334,7 @@ ZEND_FUNCTION(get_included_files)
{
zend_string *entry;
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
ZEND_HASH_FOREACH_STR_KEY(&EG(included_files), entry) {
@ -1436,9 +1416,7 @@ ZEND_FUNCTION(set_error_handler)
Restores the previously defined error handler function */
ZEND_FUNCTION(restore_error_handler)
{
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
if (Z_TYPE(EG(user_error_handler)) != IS_UNDEF) {
zval zeh;
@ -1501,9 +1479,7 @@ ZEND_FUNCTION(set_exception_handler)
Restores the previously defined exception handler function */
ZEND_FUNCTION(restore_exception_handler)
{
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) {
zval_ptr_dtor(&EG(user_exception_handler));
@ -1534,9 +1510,7 @@ static inline void get_declared_class_impl(INTERNAL_FUNCTION_PARAMETERS, int fla
zend_string *key;
zend_class_entry *ce;
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
ZEND_HASH_FOREACH_STR_KEY_PTR(EG(class_table), key, ce) {