Skip to content

Commit 8312bf8

Browse files
committed
Zend/zend_execute.c: mark error functions as zend_never_inline
For consistency with other functions
1 parent 58f5039 commit 8312bf8

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

Zend/zend_execute.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static zend_never_inline ZEND_COLD zval *zend_wrong_assign_to_variable_reference
604604
return zend_assign_to_variable_ex(variable_ptr, value_ptr, IS_TMP_VAR, EX_USES_STRICT_TYPES(), garbage_ptr);
605605
}
606606

607-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num)
607+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num)
608608
{
609609
const zend_execute_data *execute_data = EG(current_execute_data);
610610
zend_string *func_name = get_function_or_method_name(EX(call)->func);
@@ -680,7 +680,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_throw_non_object_erro
680680
}
681681
}
682682

683-
static ZEND_COLD void zend_verify_type_error_common(
683+
static zend_never_inline ZEND_COLD void zend_verify_type_error_common(
684684
const zend_function *zf, const zend_arg_info *arg_info, const zval *value,
685685
const char **fname, const char **fsep, const char **fclass,
686686
zend_string **need_msg, const char **given_kind)
@@ -703,7 +703,7 @@ static ZEND_COLD void zend_verify_type_error_common(
703703
}
704704
}
705705

706-
ZEND_API ZEND_COLD void zend_verify_arg_error(
706+
ZEND_API zend_never_inline ZEND_COLD void zend_verify_arg_error(
707707
const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, const zval *value)
708708
{
709709
const zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
@@ -880,7 +880,7 @@ static zend_never_inline ZEND_COLD void zend_magic_get_property_type_inconsisten
880880
zend_string_release(type_str);
881881
}
882882

883-
ZEND_COLD void zend_match_unhandled_error(const zval *value)
883+
zend_never_inline ZEND_COLD void zend_match_unhandled_error(const zval *value)
884884
{
885885
zend_long max_len = EG(exception_string_param_max_len);
886886
smart_str msg = {0};
@@ -900,35 +900,35 @@ ZEND_COLD void zend_match_unhandled_error(const zval *value)
900900
smart_str_free(&msg);
901901
}
902902

903-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error(
903+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error(
904904
const zend_property_info *info) {
905905
zend_readonly_property_modification_error_ex(
906906
ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name));
907907
}
908908

909-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error_ex(
909+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error_ex(
910910
const char *class_name, const char *prop_name) {
911911
zend_throw_error(NULL, "Cannot modify readonly property %s::$%s", class_name, prop_name);
912912
}
913913

914-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info)
914+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info)
915915
{
916916
zend_throw_error(NULL, "Cannot indirectly modify readonly property %s::$%s",
917917
ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name));
918918
}
919919

920-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(const uint8_t type)
920+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(const uint8_t type)
921921
{
922922
zend_type_error("Cannot use value of type %s as class constant name", zend_get_type_by_const(type));
923923
}
924924

925-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info)
925+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info)
926926
{
927927
zend_throw_error(NULL, "Object was released while assigning to property %s::$%s",
928928
ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name));
929929
}
930930

931-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error(
931+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error(
932932
const zend_property_info *prop_info, const char *operation
933933
) {
934934
const zend_class_entry *scope;
@@ -1321,7 +1321,7 @@ ZEND_API bool zend_internal_call_should_throw(const zend_function *fbc, zend_exe
13211321
return 0;
13221322
}
13231323

1324-
ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc)
1324+
ZEND_API zend_never_inline ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc)
13251325
{
13261326
zend_error_noreturn(E_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()",
13271327
fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "",
@@ -1392,7 +1392,7 @@ static void zend_verify_internal_func_info(const zend_function *fn, const zval *
13921392
}
13931393
#endif
13941394

1395-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data)
1395+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data)
13961396
{
13971397
const zend_execute_data *ptr = EX(prev_execute_data);
13981398

@@ -1417,7 +1417,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_
14171417
}
14181418
}
14191419

1420-
ZEND_API ZEND_COLD void zend_verify_return_error(const zend_function *zf, const zval *value)
1420+
ZEND_API zend_never_inline ZEND_COLD void zend_verify_return_error(const zend_function *zf, const zval *value)
14211421
{
14221422
const zend_arg_info *arg_info = &zf->common.arg_info[-1];
14231423
const char *fname, *fsep, *fclass;
@@ -1433,7 +1433,7 @@ ZEND_API ZEND_COLD void zend_verify_return_error(const zend_function *zf, const
14331433
zend_string_release(need_msg);
14341434
}
14351435

1436-
ZEND_API ZEND_COLD void zend_verify_never_error(const zend_function *zf)
1436+
ZEND_API zend_never_inline ZEND_COLD void zend_verify_never_error(const zend_function *zf)
14371437
{
14381438
zend_string *func_name = get_function_or_method_name(zf);
14391439

@@ -1444,7 +1444,7 @@ ZEND_API ZEND_COLD void zend_verify_never_error(const zend_function *zf)
14441444
}
14451445

14461446
#if ZEND_DEBUG
1447-
static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, const zval *value)
1447+
static zend_never_inline ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, const zval *value)
14481448
{
14491449
const zend_arg_info *arg_info = &zf->common.arg_info[-1];
14501450
const char *fname, *fsep, *fclass;
@@ -1458,7 +1458,7 @@ static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf,
14581458
fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg);
14591459
}
14601460

1461-
static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, const char *returned_msg, const char *returned_kind)
1461+
static zend_never_inline ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, const char *returned_msg, const char *returned_kind)
14621462
{
14631463
const char *fname = ZSTR_VAL(zf->common.function_name);
14641464
const char *fsep;
@@ -1497,7 +1497,7 @@ ZEND_API bool zend_verify_internal_return_type(const zend_function *zf, zval *re
14971497
}
14981498
#endif
14991499

1500-
static ZEND_COLD void zend_verify_missing_return_type(const zend_function *zf)
1500+
static zend_never_inline ZEND_COLD void zend_verify_missing_return_type(const zend_function *zf)
15011501
{
15021502
/* VERIFY_RETURN_TYPE is not emitted for "void" functions, so this is always an error. */
15031503
zend_verify_return_error(zf, NULL);
@@ -1754,7 +1754,7 @@ static zend_never_inline zend_long zend_check_string_offset(const zval *dim, int
17541754
return zval_get_long_func(dim, /* is_strict */ false);
17551755
}
17561756

1757-
ZEND_API ZEND_COLD void zend_wrong_string_offset_error(void)
1757+
ZEND_API zend_never_inline ZEND_COLD void zend_wrong_string_offset_error(void)
17581758
{
17591759
const char *msg = NULL;
17601760
const zend_execute_data *execute_data = EG(current_execute_data);
@@ -2184,7 +2184,7 @@ static zend_property_info *zend_get_prop_not_accepting_double(zend_reference *re
21842184
return NULL;
21852185
}
21862186

2187-
static ZEND_COLD zend_long zend_throw_incdec_ref_error(const zend_property_info *error_prop OPLINE_DC)
2187+
static zend_never_inline ZEND_COLD zend_long zend_throw_incdec_ref_error(const zend_property_info *error_prop OPLINE_DC)
21882188
{
21892189
zend_string *type_str = zend_type_to_string(error_prop->type);
21902190
if (ZEND_IS_INCREMENT(opline->opcode)) {
@@ -2206,7 +2206,7 @@ static ZEND_COLD zend_long zend_throw_incdec_ref_error(const zend_property_info
22062206
}
22072207
}
22082208

2209-
static ZEND_COLD zend_long zend_throw_incdec_prop_error(const zend_property_info *prop OPLINE_DC) {
2209+
static zend_never_inline ZEND_COLD zend_long zend_throw_incdec_prop_error(const zend_property_info *prop OPLINE_DC) {
22102210
zend_string *type_str = zend_type_to_string(prop->type);
22112211
if (ZEND_IS_INCREMENT(opline->opcode)) {
22122212
zend_type_error("Cannot increment property %s::$%s of type %s past its maximal value",
@@ -3425,7 +3425,7 @@ static zend_never_inline bool ZEND_FASTCALL zend_array_key_exists_fast(HashTable
34253425
}
34263426
}
34273427

3428-
static ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error(
3428+
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error(
34293429
const zval *subject, const zval *key OPLINE_DC EXECUTE_DATA_DC)
34303430
{
34313431
if (Z_TYPE_P(key) == IS_UNDEF) {
@@ -3894,7 +3894,7 @@ ZEND_API zval* ZEND_FASTCALL zend_fetch_static_property(zend_execute_data *ex, i
38943894
return result;
38953895
}
38963896

3897-
ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) {
3897+
ZEND_API zend_never_inline ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) {
38983898
zend_string *type1_str = zend_type_to_string(prop1->type);
38993899
zend_string *type2_str = zend_type_to_string(prop2->type);
39003900
zend_type_error("Reference with value of type %s held by property %s::$%s of type %s is not compatible with property %s::$%s of type %s",
@@ -3910,7 +3910,7 @@ ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info
39103910
zend_string_release(type2_str);
39113911
}
39123912

3913-
ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info *prop, const zval *zv) {
3913+
ZEND_API zend_never_inline ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info *prop, const zval *zv) {
39143914
zend_string *type_str = zend_type_to_string(prop->type);
39153915
zend_type_error("Cannot assign %s to reference held by property %s::$%s of type %s",
39163916
zend_zval_value_name(zv),
@@ -3921,7 +3921,7 @@ ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info
39213921
zend_string_release(type_str);
39223922
}
39233923

3924-
static ZEND_COLD void zend_throw_conflicting_coercion_error(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) {
3924+
static zend_never_inline ZEND_COLD void zend_throw_conflicting_coercion_error(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) {
39253925
zend_string *type1_str = zend_type_to_string(prop1->type);
39263926
zend_string *type2_str = zend_type_to_string(prop2->type);
39273927
zend_type_error("Cannot assign %s to reference held by property %s::$%s of type %s and property %s::$%s of type %s, as this would result in an inconsistent type conversion",

Zend/zend_execute.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ZEND_API zend_result zend_eval_stringl_ex(const char *str, size_t str_len, zval
6060
/* export zend_pass_function to allow comparisons against it */
6161
extern ZEND_API const zend_internal_function zend_pass_function;
6262

63-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data);
63+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data);
6464
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc);
6565
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_nodiscard_function(const zend_function *fbc);
6666
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_class_constant(const zend_class_constant *c, const zend_string *constant_name);
@@ -80,39 +80,39 @@ typedef enum {
8080
ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref_ex(const zend_property_info *prop_info, zval *orig_val, bool strict, zend_verify_prop_assignable_by_ref_context context);
8181
ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(const zend_property_info *prop_info, zval *orig_val, bool strict);
8282

83-
ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info *prop, const zval *zv);
84-
ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv);
83+
ZEND_API zend_never_inline ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info *prop, const zval *zv);
84+
ZEND_API zend_never_inline ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv);
8585
ZEND_API ZEND_COLD zval* ZEND_FASTCALL zend_undefined_offset_write(HashTable *ht, zend_long lval);
8686
ZEND_API ZEND_COLD zval* ZEND_FASTCALL zend_undefined_index_write(HashTable *ht, zend_string *offset);
87-
ZEND_API ZEND_COLD void zend_wrong_string_offset_error(void);
87+
ZEND_API zend_never_inline ZEND_COLD void zend_wrong_string_offset_error(void);
8888

89-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error(const zend_property_info *info);
90-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error_ex(const char *class_name, const char *prop_name);
91-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info);
89+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error(const zend_property_info *info);
90+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error_ex(const char *class_name, const char *prop_name);
91+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info);
9292

93-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(uint8_t type);
93+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(uint8_t type);
9494

95-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info);
95+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info);
9696

97-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_add_element(void);
97+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_cannot_add_element(void);
9898

9999
ZEND_API bool ZEND_FASTCALL zend_asymmetric_property_has_set_access(const zend_property_info *prop_info);
100-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error(const zend_property_info *prop_info, const char *operation);
100+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error(const zend_property_info *prop_info, const char *operation);
101101

102102
ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg);
103-
ZEND_API ZEND_COLD void zend_verify_arg_error(
103+
ZEND_API zend_never_inline ZEND_COLD void zend_verify_arg_error(
104104
const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, const zval *value);
105-
ZEND_API ZEND_COLD void zend_verify_return_error(
105+
ZEND_API zend_never_inline ZEND_COLD void zend_verify_return_error(
106106
const zend_function *zf, const zval *value);
107-
ZEND_API ZEND_COLD void zend_verify_never_error(
107+
ZEND_API zend_never_inline ZEND_COLD void zend_verify_never_error(
108108
const zend_function *zf);
109109
ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref);
110110
ZEND_API bool zend_check_user_type_slow(
111111
const zend_type *type, zval *arg, const zend_reference *ref, bool is_return_type);
112112

113113
#if ZEND_DEBUG
114114
ZEND_API bool zend_internal_call_should_throw(const zend_function *fbc, zend_execute_data *call);
115-
ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc);
115+
ZEND_API zend_never_inline ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc);
116116
ZEND_API bool zend_verify_internal_return_type(const zend_function *zf, zval *ret);
117117
#endif
118118

@@ -471,7 +471,7 @@ ZEND_API zend_string *zend_get_executed_filename_ex(void);
471471
ZEND_API uint32_t zend_get_executed_lineno(void);
472472
ZEND_API zend_class_entry *zend_get_executed_scope(void);
473473
ZEND_API bool zend_is_executing(void);
474-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num);
474+
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num);
475475

476476
ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals);
477477
ZEND_API void zend_unset_timeout(void);
@@ -615,7 +615,7 @@ ZEND_API bool zend_verify_property_type(const zend_property_info *info, zval *pr
615615
} \
616616
} while (0)
617617

618-
ZEND_COLD void zend_match_unhandled_error(const zval *value);
618+
zend_never_inline ZEND_COLD void zend_match_unhandled_error(const zval *value);
619619

620620
/* Call this to handle the timeout or the interrupt function. It will set
621621
* EG(vm_interrupt) to false.

0 commit comments

Comments
 (0)