Skip to content

Commit 1498694

Browse files
ext/ffi: convert zend_parse_parameters_none() to fast ZPP (#20644)
1 parent d4f1300 commit 1498694

File tree

1 file changed

+14
-39
lines changed

1 file changed

+14
-39
lines changed

ext/ffi/ffi.c

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4717,9 +4717,8 @@ ZEND_METHOD(FFI, isNull) /* {{{ */
47174717
ZEND_METHOD(FFI_CType, getName) /* {{{ */
47184718
{
47194719
zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
4720-
if (zend_parse_parameters_none() == FAILURE) {
4721-
RETURN_THROWS();
4722-
}
4720+
4721+
ZEND_PARSE_PARAMETERS_NONE();
47234722

47244723
zend_ffi_ctype_name_buf buf;
47254724

@@ -4739,9 +4738,7 @@ ZEND_METHOD(FFI_CType, getKind) /* {{{ */
47394738
const zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
47404739
const zend_ffi_type *type;
47414740

4742-
if (zend_parse_parameters_none() == FAILURE) {
4743-
RETURN_THROWS();
4744-
}
4741+
ZEND_PARSE_PARAMETERS_NONE();
47454742

47464743
type = ZEND_FFI_TYPE(ctype->type);
47474744
RETURN_LONG(type->kind);
@@ -4753,9 +4750,7 @@ ZEND_METHOD(FFI_CType, getSize) /* {{{ */
47534750
const zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
47544751
const zend_ffi_type *type;
47554752

4756-
if (zend_parse_parameters_none() == FAILURE) {
4757-
RETURN_THROWS();
4758-
}
4753+
ZEND_PARSE_PARAMETERS_NONE();
47594754

47604755
type = ZEND_FFI_TYPE(ctype->type);
47614756
RETURN_LONG(type->size);
@@ -4767,9 +4762,7 @@ ZEND_METHOD(FFI_CType, getAlignment) /* {{{ */
47674762
const zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
47684763
const zend_ffi_type *type;
47694764

4770-
if (zend_parse_parameters_none() == FAILURE) {
4771-
RETURN_THROWS();
4772-
}
4765+
ZEND_PARSE_PARAMETERS_NONE();
47734766

47744767
type = ZEND_FFI_TYPE(ctype->type);
47754768
RETURN_LONG(type->align);
@@ -4781,9 +4774,7 @@ ZEND_METHOD(FFI_CType, getAttributes) /* {{{ */
47814774
const zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
47824775
const zend_ffi_type *type;
47834776

4784-
if (zend_parse_parameters_none() == FAILURE) {
4785-
RETURN_THROWS();
4786-
}
4777+
ZEND_PARSE_PARAMETERS_NONE();
47874778

47884779
type = ZEND_FFI_TYPE(ctype->type);
47894780
RETURN_LONG(type->attr);
@@ -4795,9 +4786,7 @@ ZEND_METHOD(FFI_CType, getEnumKind) /* {{{ */
47954786
const zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
47964787
const zend_ffi_type *type;
47974788

4798-
if (zend_parse_parameters_none() == FAILURE) {
4799-
RETURN_THROWS();
4800-
}
4789+
ZEND_PARSE_PARAMETERS_NONE();
48014790

48024791
type = ZEND_FFI_TYPE(ctype->type);
48034792
if (type->kind != ZEND_FFI_TYPE_ENUM) {
@@ -4814,9 +4803,7 @@ ZEND_METHOD(FFI_CType, getArrayElementType) /* {{{ */
48144803
zend_ffi_type *type;
48154804
zend_ffi_ctype *ret;
48164805

4817-
if (zend_parse_parameters_none() == FAILURE) {
4818-
RETURN_THROWS();
4819-
}
4806+
ZEND_PARSE_PARAMETERS_NONE();
48204807

48214808
type = ZEND_FFI_TYPE(ctype->type);
48224809
if (type->kind != ZEND_FFI_TYPE_ARRAY) {
@@ -4835,9 +4822,7 @@ ZEND_METHOD(FFI_CType, getArrayLength) /* {{{ */
48354822
const zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
48364823
const zend_ffi_type *type;
48374824

4838-
if (zend_parse_parameters_none() == FAILURE) {
4839-
RETURN_THROWS();
4840-
}
4825+
ZEND_PARSE_PARAMETERS_NONE();
48414826

48424827
type = ZEND_FFI_TYPE(ctype->type);
48434828
if (type->kind != ZEND_FFI_TYPE_ARRAY) {
@@ -4854,9 +4839,7 @@ ZEND_METHOD(FFI_CType, getPointerType) /* {{{ */
48544839
zend_ffi_ctype *ret;
48554840
zend_ffi_type *type;
48564841

4857-
if (zend_parse_parameters_none() == FAILURE) {
4858-
RETURN_THROWS();
4859-
}
4842+
ZEND_PARSE_PARAMETERS_NONE();
48604843

48614844
type = ZEND_FFI_TYPE(ctype->type);
48624845
if (type->kind != ZEND_FFI_TYPE_POINTER) {
@@ -4878,9 +4861,7 @@ ZEND_METHOD(FFI_CType, getStructFieldNames) /* {{{ */
48784861
zend_string* name;
48794862
zval zv;
48804863

4881-
if (zend_parse_parameters_none() == FAILURE) {
4882-
RETURN_THROWS();
4883-
}
4864+
ZEND_PARSE_PARAMETERS_NONE();
48844865

48854866
type = ZEND_FFI_TYPE(ctype->type);
48864867
if (type->kind != ZEND_FFI_TYPE_STRUCT) {
@@ -4958,9 +4939,7 @@ ZEND_METHOD(FFI_CType, getFuncABI) /* {{{ */
49584939
const zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
49594940
const zend_ffi_type *type;
49604941

4961-
if (zend_parse_parameters_none() == FAILURE) {
4962-
RETURN_THROWS();
4963-
}
4942+
ZEND_PARSE_PARAMETERS_NONE();
49644943

49654944
type = ZEND_FFI_TYPE(ctype->type);
49664945
if (type->kind != ZEND_FFI_TYPE_FUNC) {
@@ -4977,9 +4956,7 @@ ZEND_METHOD(FFI_CType, getFuncReturnType) /* {{{ */
49774956
zend_ffi_ctype *ret;
49784957
zend_ffi_type *type;
49794958

4980-
if (zend_parse_parameters_none() == FAILURE) {
4981-
RETURN_THROWS();
4982-
}
4959+
ZEND_PARSE_PARAMETERS_NONE();
49834960

49844961
type = ZEND_FFI_TYPE(ctype->type);
49854962
if (type->kind != ZEND_FFI_TYPE_FUNC) {
@@ -4998,9 +4975,7 @@ ZEND_METHOD(FFI_CType, getFuncParameterCount) /* {{{ */
49984975
const zend_ffi_ctype *ctype = (zend_ffi_ctype*)(Z_OBJ_P(ZEND_THIS));
49994976
const zend_ffi_type *type;
50004977

5001-
if (zend_parse_parameters_none() == FAILURE) {
5002-
RETURN_THROWS();
5003-
}
4978+
ZEND_PARSE_PARAMETERS_NONE();
50044979

50054980
type = ZEND_FFI_TYPE(ctype->type);
50064981
if (type->kind != ZEND_FFI_TYPE_FUNC) {

0 commit comments

Comments
 (0)