Skip to content

Commit 6d89553

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Mark "cold" functions
2 parents 1aa8d0e + e14d773 commit 6d89553

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

Zend/zend_API.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,15 +2642,15 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_lengt
26422642

26432643
/* Disabled functions support */
26442644

2645-
zend_op_array *display_disabled_compile_string(zval *source_string, char *filename)
2645+
static ZEND_COLD zend_op_array *display_disabled_compile_string(zval *source_string, char *filename)
26462646
{
26472647
zend_error(E_WARNING, "eval() has been disabled for security reasons");
26482648
return NULL;
26492649
}
26502650

26512651
/* {{{ proto void display_disabled_function(void)
26522652
Dummy function which displays an error when a disabled function is called. */
2653-
ZEND_API ZEND_FUNCTION(display_disabled_function)
2653+
ZEND_API ZEND_COLD ZEND_FUNCTION(display_disabled_function)
26542654
{
26552655
zend_error(E_WARNING, "%s() has been disabled for security reasons", get_active_function_name());
26562656
}
@@ -2679,7 +2679,7 @@ ZEND_API int zend_disable_function(char *function_name, size_t function_name_len
26792679
#ifdef ZEND_WIN32
26802680
#pragma optimize("", off)
26812681
#endif
2682-
static zend_object *display_disabled_class(zend_class_entry *class_type) /* {{{ */
2682+
static ZEND_COLD zend_object *display_disabled_class(zend_class_entry *class_type) /* {{{ */
26832683
{
26842684
zend_object *intern;
26852685

Zend/zend_API.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,6 @@ ZEND_API zend_bool zend_is_iterable(zval *iterable);
538538
ZEND_API zend_bool zend_is_countable(zval *countable);
539539

540540
ZEND_API ZEND_FUNCTION(display_disabled_function);
541-
ZEND_API ZEND_FUNCTION(display_disabled_class);
542541
END_EXTERN_C()
543542

544543
#if ZEND_DEBUG

Zend/zend_closures.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,28 +408,28 @@ static zend_function *zend_closure_get_method(zend_object **object, zend_string
408408
}
409409
/* }}} */
410410

411-
static zval *zend_closure_read_property(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv) /* {{{ */
411+
static ZEND_COLD zval *zend_closure_read_property(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv) /* {{{ */
412412
{
413413
ZEND_CLOSURE_PROPERTY_ERROR();
414414
return &EG(uninitialized_zval);
415415
}
416416
/* }}} */
417417

418-
static zval *zend_closure_write_property(zend_object *object, zend_string *member, zval *value, void **cache_slot) /* {{{ */
418+
static ZEND_COLD zval *zend_closure_write_property(zend_object *object, zend_string *member, zval *value, void **cache_slot) /* {{{ */
419419
{
420420
ZEND_CLOSURE_PROPERTY_ERROR();
421421
return value;
422422
}
423423
/* }}} */
424424

425-
static zval *zend_closure_get_property_ptr_ptr(zend_object *object, zend_string *member, int type, void **cache_slot) /* {{{ */
425+
static ZEND_COLD zval *zend_closure_get_property_ptr_ptr(zend_object *object, zend_string *member, int type, void **cache_slot) /* {{{ */
426426
{
427427
ZEND_CLOSURE_PROPERTY_ERROR();
428428
return NULL;
429429
}
430430
/* }}} */
431431

432-
static int zend_closure_has_property(zend_object *object, zend_string *member, int has_set_exists, void **cache_slot) /* {{{ */
432+
static ZEND_COLD int zend_closure_has_property(zend_object *object, zend_string *member, int has_set_exists, void **cache_slot) /* {{{ */
433433
{
434434
if (has_set_exists != ZEND_PROPERTY_EXISTS) {
435435
ZEND_CLOSURE_PROPERTY_ERROR();
@@ -438,7 +438,7 @@ static int zend_closure_has_property(zend_object *object, zend_string *member, i
438438
}
439439
/* }}} */
440440

441-
static void zend_closure_unset_property(zend_object *object, zend_string *member, void **cache_slot) /* {{{ */
441+
static ZEND_COLD void zend_closure_unset_property(zend_object *object, zend_string *member, void **cache_slot) /* {{{ */
442442
{
443443
ZEND_CLOSURE_PROPERTY_ERROR();
444444
}

Zend/zend_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
166166

167167
ZEND_API int zval_update_constant(zval *pp);
168168
ZEND_API int zval_update_constant_ex(zval *pp, zend_class_entry *scope);
169-
ZEND_API int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result);
169+
ZEND_API ZEND_COLD int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result);
170170

171171
/* dedicated Zend executor functions - do not use! */
172172
struct _zend_vm_stack {

Zend/zend_execute_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static void zend_unclean_zval_ptr_dtor(zval *zv) /* {{{ */
210210
}
211211
/* }}} */
212212

213-
static void zend_throw_or_error(int fetch_type, zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
213+
static ZEND_COLD void zend_throw_or_error(int fetch_type, zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
214214
{
215215
va_list va;
216216
char *message = NULL;
@@ -562,7 +562,7 @@ ZEND_API zend_bool zend_is_executing(void) /* {{{ */
562562
}
563563
/* }}} */
564564

565-
ZEND_API int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result) /* {{{ */
565+
ZEND_API ZEND_COLD int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result) /* {{{ */
566566
{
567567
char *colon;
568568

Zend/zend_ini.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
2727

2828
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, zend_string *new_value, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage)
29-
#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)
29+
#define ZEND_INI_DISP(name) ZEND_COLD void name(zend_ini_entry *ini_entry, int type)
3030

3131
typedef struct _zend_ini_entry_def {
3232
const char *name;

Zend/zend_object_handlers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static zend_always_inline uintptr_t zend_get_property_offset(zend_class_entry *c
462462
}
463463
/* }}} */
464464

465-
static zend_never_inline void zend_wrong_offset(zend_class_entry *ce, zend_string *member) /* {{{ */
465+
static ZEND_COLD void zend_wrong_offset(zend_class_entry *ce, zend_string *member) /* {{{ */
466466
{
467467
zend_property_info *dummy;
468468

0 commit comments

Comments
 (0)