]> granicus.if.org Git - php/commit
Use zend_type inside type lists
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 16 Jan 2020 16:04:11 +0000 (17:04 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 17 Jan 2020 08:37:54 +0000 (09:37 +0100)
commitbd1977282c14c1daa1718a82eb4b3bf79250ca16
treef24251eb550ff4533ee0699114bdd34440dba3fe
parentafdaa91170a1f7b0387cf577d957d4d6c015c136
Use zend_type inside type lists

Instead of having a completely independent encoding for type list
entries. This is going to use more memory, but I'm not particularly
concerned about that, as type unions that contain multiple classes
should be uncommon. On the other hand, this allows us to treat
top-level types and types inside lists mostly the same.

A new ZEND_TYPE_FOREACH macros allows to transparently treat list
and non-list types the same way. I'm not using it everywhere it could be
used for now, just the places that seemed most obvious.

Of course, this will make any future type system changes much simpler,
as it will not be necessary to duplicate all logic two times.
14 files changed:
Zend/zend.c
Zend/zend_compile.c
Zend/zend_execute.c
Zend/zend_inheritance.c
Zend/zend_opcode.c
Zend/zend_types.h
ext/opcache/ZendAccelerator.c
ext/opcache/jit/zend_jit_helpers.c
ext/opcache/zend_accelerator_util_funcs.c
ext/opcache/zend_file_cache.c
ext/opcache/zend_persist.c
ext/opcache/zend_persist_calc.c
ext/reflection/php_reflection.c
ext/zend_test/test.c