Skip to content

Commit 585b5bc

Browse files
committed
Generate optimizer func info from stubs for ext/standard - part 1
1 parent fdc6082 commit 585b5bc

File tree

4 files changed

+236
-101
lines changed

4 files changed

+236
-101
lines changed

Zend/Optimizer/zend_func_info.c

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -93,95 +93,6 @@ static const func_info_t old_func_infos[] = {
9393
F1("get_defined_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
9494

9595
/* ext/standard */
96-
F1("bin2hex", MAY_BE_STRING),
97-
F1("hex2bin", MAY_BE_FALSE | MAY_BE_STRING),
98-
#if HAVE_STRPTIME
99-
F1("strptime", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
100-
#endif
101-
F1("wordwrap", MAY_BE_STRING),
102-
F1("htmlspecialchars", MAY_BE_STRING),
103-
F1("htmlentities", MAY_BE_STRING),
104-
F1("get_html_translation_table", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
105-
F1("sha1", MAY_BE_STRING),
106-
F1("sha1_file", MAY_BE_FALSE | MAY_BE_STRING),
107-
F1("md5", MAY_BE_STRING),
108-
F1("md5_file", MAY_BE_FALSE | MAY_BE_STRING),
109-
F1("iptcparse", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
110-
F1("iptcembed", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
111-
F1("getimagesize", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
112-
F1("getimagesizefromstring", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
113-
F1("image_type_to_mime_type", MAY_BE_STRING),
114-
F1("image_type_to_extension", MAY_BE_FALSE | MAY_BE_STRING),
115-
F0("phpinfo", MAY_BE_TRUE),
116-
F1("phpversion", MAY_BE_FALSE | MAY_BE_STRING),
117-
F0("phpcredits", MAY_BE_TRUE),
118-
F1("php_sapi_name", MAY_BE_FALSE | MAY_BE_STRING),
119-
F1("php_uname", MAY_BE_STRING),
120-
F1("php_ini_scanned_files", MAY_BE_FALSE | MAY_BE_STRING),
121-
F1("php_ini_loaded_file", MAY_BE_FALSE | MAY_BE_STRING),
122-
F1("strtok", MAY_BE_FALSE | MAY_BE_STRING),
123-
F1("strrev", MAY_BE_STRING),
124-
F1("hebrev", MAY_BE_STRING),
125-
F1("basename", MAY_BE_STRING),
126-
F1("dirname", MAY_BE_STRING),
127-
F1("pathinfo", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
128-
F1("stripslashes", MAY_BE_STRING),
129-
F1("stripcslashes", MAY_BE_STRING),
130-
F1("strstr", MAY_BE_FALSE | MAY_BE_STRING),
131-
F1("stristr", MAY_BE_FALSE | MAY_BE_STRING),
132-
F1("strrchr", MAY_BE_FALSE | MAY_BE_STRING),
133-
F1("str_shuffle", MAY_BE_STRING),
134-
F1("str_word_count", MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
135-
F1("str_split", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
136-
F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING),
137-
FN("substr_replace", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING),
138-
F1("quotemeta", MAY_BE_STRING),
139-
F1("ucwords", MAY_BE_STRING),
140-
F1("addcslashes", MAY_BE_STRING),
141-
FN("str_replace", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY | MAY_BE_ARRAY_OF_OBJECT),
142-
FN("str_ireplace", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY | MAY_BE_ARRAY_OF_OBJECT),
143-
F1("str_repeat", MAY_BE_STRING),
144-
F1("count_chars", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
145-
F1("chunk_split", MAY_BE_STRING),
146-
F1("strip_tags", MAY_BE_STRING),
147-
F1("explode", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
148-
F1("localeconv", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
149-
#if HAVE_NL_LANGINFO
150-
F1("nl_langinfo", MAY_BE_FALSE | MAY_BE_STRING),
151-
#endif
152-
F1("soundex", MAY_BE_STRING),
153-
F1("chr", MAY_BE_STRING),
154-
F1("str_getcsv", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
155-
F1("strchr", MAY_BE_FALSE | MAY_BE_STRING),
156-
F1("sprintf", MAY_BE_STRING),
157-
F1("vsprintf", MAY_BE_STRING),
158-
F1("sscanf", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
159-
F1("fscanf", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
160-
F1("parse_url", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_LONG),
161-
F1("urlencode", MAY_BE_STRING),
162-
F1("urldecode", MAY_BE_STRING),
163-
F1("rawurlencode", MAY_BE_STRING),
164-
F1("rawurldecode", MAY_BE_STRING),
165-
F1("http_build_query", MAY_BE_STRING),
166-
#if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
167-
F1("readlink", MAY_BE_FALSE | MAY_BE_STRING),
168-
#endif
169-
F1("exec", MAY_BE_FALSE | MAY_BE_STRING),
170-
F1("system", MAY_BE_FALSE | MAY_BE_STRING),
171-
F1("escapeshellcmd", MAY_BE_STRING),
172-
F1("escapeshellarg", MAY_BE_STRING),
173-
F0("passthru", MAY_BE_NULL | MAY_BE_FALSE),
174-
F1("shell_exec", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
175-
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
176-
F1("proc_get_status", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
177-
#endif
178-
F1("random_bytes", MAY_BE_STRING),
179-
#if HAVE_GETSERVBYPORT
180-
F1("getservbyport", MAY_BE_FALSE | MAY_BE_STRING),
181-
#endif
182-
#if HAVE_GETPROTOBYNUMBER
183-
F1("getprotobynumber", MAY_BE_FALSE | MAY_BE_STRING),
184-
#endif
18596
F1("base64_decode", MAY_BE_FALSE | MAY_BE_STRING),
18697
F1("base64_encode", MAY_BE_STRING),
18798
F1("password_hash", MAY_BE_STRING),

Zend/Optimizer/zend_func_infos.h

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,102 @@ static const func_info_t func_infos[] = {
101101
#if HAVE_NANOSLEEP
102102
F1("time_nanosleep", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_BOOL),
103103
#endif
104+
#if HAVE_GETSERVBYPORT
105+
F1("getservbyport", MAY_BE_STRING|MAY_BE_FALSE),
106+
#endif
107+
#if HAVE_GETPROTOBYNUMBER
108+
F1("getprotobynumber", MAY_BE_STRING|MAY_BE_FALSE),
109+
#endif
110+
#if HAVE_STRPTIME
111+
F1("strptime", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
112+
#endif
104113
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
105114
F1("dns_get_record", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
106115
#endif
116+
F1("md5", MAY_BE_STRING),
117+
F1("md5_file", MAY_BE_STRING|MAY_BE_FALSE),
118+
F1("sha1", MAY_BE_STRING),
119+
F1("sha1_file", MAY_BE_STRING|MAY_BE_FALSE),
120+
F1("htmlspecialchars", MAY_BE_STRING),
121+
F1("htmlentities", MAY_BE_STRING),
122+
F1("get_html_translation_table", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING),
123+
F1("bin2hex", MAY_BE_STRING),
124+
F1("hex2bin", MAY_BE_STRING|MAY_BE_FALSE),
125+
#if HAVE_NL_LANGINFO
126+
F1("nl_langinfo", MAY_BE_STRING|MAY_BE_FALSE),
127+
#endif
128+
F1("wordwrap", MAY_BE_STRING),
129+
F1("explode", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
130+
F1("strtok", MAY_BE_STRING|MAY_BE_FALSE),
131+
F1("basename", MAY_BE_STRING),
132+
F1("dirname", MAY_BE_STRING),
133+
F1("pathinfo", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_STRING),
134+
F1("stristr", MAY_BE_STRING|MAY_BE_FALSE),
135+
F1("strstr", MAY_BE_STRING|MAY_BE_FALSE),
136+
F1("strrchr", MAY_BE_STRING|MAY_BE_FALSE),
137+
F1("chunk_split", MAY_BE_STRING),
138+
FN("substr_replace", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING),
139+
F1("quotemeta", MAY_BE_STRING),
140+
F1("chr", MAY_BE_STRING),
141+
F1("ucwords", MAY_BE_STRING),
142+
F1("strrev", MAY_BE_STRING),
143+
F1("addcslashes", MAY_BE_STRING),
144+
F1("addslashes", MAY_BE_STRING),
145+
F1("stripcslashes", MAY_BE_STRING),
146+
F1("stripslashes", MAY_BE_STRING),
147+
F1("str_replace", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_OBJECT),
148+
F1("str_ireplace", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_OBJECT),
149+
F1("hebrev", MAY_BE_STRING),
150+
F1("strip_tags", MAY_BE_STRING),
151+
F1("str_getcsv", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_NULL),
152+
F1("str_repeat", MAY_BE_STRING),
153+
F1("count_chars", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_STRING),
154+
F1("localeconv", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY),
155+
F1("sscanf", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY|MAY_BE_LONG|MAY_BE_NULL),
156+
F1("str_shuffle", MAY_BE_STRING),
157+
F1("str_word_count", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_LONG),
158+
F1("str_split", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
159+
F1("strpbrk", MAY_BE_STRING|MAY_BE_FALSE),
107160
FN("opendir", MAY_BE_RESOURCE|MAY_BE_FALSE),
161+
F1("exec", MAY_BE_STRING|MAY_BE_FALSE),
162+
F1("system", MAY_BE_STRING|MAY_BE_FALSE),
163+
F0("passthru", MAY_BE_FALSE|MAY_BE_NULL),
164+
F1("escapeshellcmd", MAY_BE_STRING),
165+
F1("escapeshellarg", MAY_BE_STRING),
166+
F1("shell_exec", MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL),
108167
F1("popen", MAY_BE_RESOURCE|MAY_BE_FALSE),
109168
F1("fopen", MAY_BE_RESOURCE|MAY_BE_FALSE),
169+
F1("fscanf", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY|MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_NULL),
110170
F1("tmpfile", MAY_BE_RESOURCE|MAY_BE_FALSE),
171+
F1("sprintf", MAY_BE_STRING),
172+
F1("vsprintf", MAY_BE_STRING),
111173
F1("fsockopen", MAY_BE_RESOURCE|MAY_BE_FALSE),
112174
FN("pfsockopen", MAY_BE_RESOURCE|MAY_BE_FALSE),
175+
F1("http_build_query", MAY_BE_STRING),
176+
F1("image_type_to_mime_type", MAY_BE_STRING),
177+
F1("image_type_to_extension", MAY_BE_STRING|MAY_BE_FALSE),
178+
F1("getimagesize", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
179+
F1("getimagesizefromstring", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
180+
F0("phpinfo", MAY_BE_TRUE),
181+
F1("phpversion", MAY_BE_STRING|MAY_BE_FALSE),
182+
F0("phpcredits", MAY_BE_TRUE),
183+
F1("php_sapi_name", MAY_BE_STRING|MAY_BE_FALSE),
184+
F1("php_uname", MAY_BE_STRING),
185+
F1("php_ini_scanned_files", MAY_BE_STRING|MAY_BE_FALSE),
186+
F1("php_ini_loaded_file", MAY_BE_STRING|MAY_BE_FALSE),
187+
F1("iptcembed", MAY_BE_STRING|MAY_BE_BOOL),
188+
F1("iptcparse", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
189+
#if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
190+
F1("readlink", MAY_BE_STRING|MAY_BE_FALSE),
191+
#endif
113192
#if defined(PHP_CAN_SUPPORT_PROC_OPEN)
114193
F1("proc_open", MAY_BE_RESOURCE|MAY_BE_FALSE),
115194
#endif
195+
#if defined(PHP_CAN_SUPPORT_PROC_OPEN)
196+
F1("proc_get_status", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING),
197+
#endif
198+
F1("random_bytes", MAY_BE_STRING),
199+
F1("soundex", MAY_BE_STRING),
116200
F1("stream_context_create", MAY_BE_RESOURCE),
117201
FN("stream_context_get_default", MAY_BE_RESOURCE),
118202
FN("stream_context_set_default", MAY_BE_RESOURCE),
@@ -121,6 +205,11 @@ static const func_info_t func_infos[] = {
121205
F1("stream_socket_client", MAY_BE_RESOURCE|MAY_BE_FALSE),
122206
F1("stream_socket_server", MAY_BE_RESOURCE|MAY_BE_FALSE),
123207
F1("stream_socket_accept", MAY_BE_RESOURCE|MAY_BE_FALSE),
208+
F1("parse_url", MAY_BE_LONG|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL|MAY_BE_FALSE),
209+
F1("urlencode", MAY_BE_STRING),
210+
F1("urldecode", MAY_BE_STRING),
211+
F1("rawurlencode", MAY_BE_STRING),
212+
F1("rawurldecode", MAY_BE_STRING),
124213
FN("zip_open", MAY_BE_RESOURCE|MAY_BE_LONG|MAY_BE_FALSE),
125214
FN("zip_read", MAY_BE_RESOURCE|MAY_BE_FALSE),
126215
F1("curl_copy_handle", MAY_BE_OBJECT|MAY_BE_FALSE),

0 commit comments

Comments
 (0)