mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Refactored API for constant array element propagation
This commit is contained in:
parent
76db01d9ff
commit
8bb29704ea
3 changed files with 8 additions and 15 deletions
|
@ -432,11 +432,7 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
|
|||
} else {
|
||||
zval tmp;
|
||||
|
||||
if (ast->attr == ZEND_DIM_IS) {
|
||||
zend_fetch_dimension_by_zval_is(&tmp, &op1, &op2, IS_CONST);
|
||||
} else {
|
||||
zend_fetch_dimension_by_zval(&tmp, &op1, &op2);
|
||||
}
|
||||
zend_fetch_dimension_const(&tmp, &op1, &op2, (ast->attr == ZEND_DIM_IS) ? BP_VAR_IS : BP_VAR_R);
|
||||
|
||||
if (UNEXPECTED(Z_ISREF(tmp))) {
|
||||
ZVAL_DUP(result, Z_REFVAL(tmp));
|
||||
|
|
|
@ -1827,17 +1827,15 @@ static zend_never_inline void zend_fetch_dimension_address_read_LIST(zval *resul
|
|||
zend_fetch_dimension_address_read(result, container, dim, IS_TMP_VAR, BP_VAR_R, 0, 0);
|
||||
}
|
||||
|
||||
ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim)
|
||||
ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type)
|
||||
{
|
||||
zend_fetch_dimension_address_read_R(result, container, dim, IS_TMP_VAR);
|
||||
if (type == BP_VAR_IS) {
|
||||
zend_fetch_dimension_address_read_IS(result, container, dim, IS_CONST);
|
||||
} else {
|
||||
zend_fetch_dimension_address_read_R(result, container, dim, IS_CONST);
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API void zend_fetch_dimension_by_zval_is(zval *result, zval *container, zval *dim, int dim_type)
|
||||
{
|
||||
zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_IS, 1, 0);
|
||||
}
|
||||
|
||||
|
||||
static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type)
|
||||
{
|
||||
if (container_op_type != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
|
||||
|
|
|
@ -298,8 +298,7 @@ ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_t
|
|||
ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type);
|
||||
void zend_verify_abstract_class(zend_class_entry *ce);
|
||||
|
||||
ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim);
|
||||
ZEND_API void zend_fetch_dimension_by_zval_is(zval *result, zval *container, zval *dim, int dim_type);
|
||||
ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type);
|
||||
|
||||
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue