Merge common code

This commit is contained in:
Dmitry Stogov 2019-07-18 16:46:25 +03:00
parent be7f405f6b
commit 7cf651c39e
2 changed files with 333 additions and 518 deletions

View File

@ -2457,8 +2457,8 @@ ZEND_VM_HANDLER(24, ZEND_ASSIGN_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_
}
object = make_real_object(object, property OPLINE_CC EXECUTE_DATA_CC);
if (UNEXPECTED(!object)) {
FREE_OP_DATA();
ZEND_VM_C_GOTO(exit_assign_obj);
value = &EG(uninitialized_zval);
ZEND_VM_C_GOTO(free_and_exit_assign_obj);
}
}
@ -2488,15 +2488,12 @@ ZEND_VM_C_LABEL(assign_object):
if (OP_DATA_TYPE == IS_CONST && Z_TYPE_P(value) == orig_type) {
CACHE_PTR_EX(cache_slot + 2, NULL);
}
FREE_OP_DATA();
ZEND_VM_C_GOTO(free_and_exit_assign_obj);
} else {
ZEND_VM_C_LABEL(fast_assign_obj):
value = zend_assign_to_variable(property_val, value, OP_DATA_TYPE, EX_USES_STRICT_TYPES());
ZEND_VM_C_GOTO(exit_assign_obj);
}
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
ZEND_VM_C_GOTO(exit_assign_obj);
}
} else {
if (EXPECTED(zobj->properties != NULL)) {
@ -2542,9 +2539,6 @@ ZEND_VM_C_LABEL(fast_assign_obj):
}
}
zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
ZEND_VM_C_GOTO(exit_assign_obj);
}
}
@ -2554,13 +2548,14 @@ ZEND_VM_C_LABEL(fast_assign_obj):
ZVAL_DEREF(value);
}
property = Z_OBJ_HT_P(object)->write_property(object, property, value, (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
value = Z_OBJ_HT_P(object)->write_property(object, property, value, (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), property);
}
ZEND_VM_C_LABEL(free_and_exit_assign_obj):
FREE_OP_DATA();
ZEND_VM_C_LABEL(exit_assign_obj):
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
}
FREE_OP2();
FREE_OP1_VAR_PTR();
/* assign_obj has two opcodes! */

File diff suppressed because it is too large Load Diff