Skip to content

Commit

Permalink
Revert unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iluuu1994 committed Feb 24, 2025
1 parent a48f879 commit 21ec227
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
5 changes: 1 addition & 4 deletions Zend/zend_compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,7 @@ typedef struct _zend_property_info {
#define OBJ_PROP_TO_OFFSET(num) \
((uint32_t)(XtOffsetOf(zend_object, properties_table) + sizeof(zval) * (num)))
#define OBJ_PROP_TO_NUM(offset) \
(((offset) - OBJ_PROP_TO_OFFSET(0)) / sizeof(zval))

#define Z_PROP_TABLE_OFFSET(prop_info) \
OBJ_PROP_TO_NUM(!((prop_info)->prototype->flags & ZEND_ACC_VIRTUAL) ? (prop_info)->prototype->offset : (prop_info)->offset)
((offset - OBJ_PROP_TO_OFFSET(0)) / sizeof(zval))

typedef struct _zend_class_constant {
zval value; /* flags are stored in u2 */
Expand Down
3 changes: 2 additions & 1 deletion Zend/zend_inheritance.c
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,8 @@ void zend_build_properties_info_table(zend_class_entry *ce)
ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop) {
if (prop->ce == ce && (prop->flags & ZEND_ACC_STATIC) == 0
&& !(prop->flags & ZEND_ACC_VIRTUAL)) {
table[Z_PROP_TABLE_OFFSET(prop)] = prop;
uint32_t prop_table_offset = OBJ_PROP_TO_NUM(!(prop->prototype->flags & ZEND_ACC_VIRTUAL) ? prop->prototype->offset : prop->offset);
table[prop_table_offset] = prop;
}
} ZEND_HASH_FOREACH_END();
}
Expand Down
12 changes: 8 additions & 4 deletions ext/opcache/jit/zend_jit_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -14376,7 +14376,8 @@ static int zend_jit_fetch_obj(zend_jit_ctx *jit,
if (ce && ce->ce_flags & ZEND_ACC_IMMUTABLE) {
ref = ir_CONST_ADDR(prop_info);
} else {
int prop_info_offset = Z_PROP_TABLE_OFFSET(prop_info) * sizeof(void*);
int prop_info_offset =
(((prop_info->offset - (sizeof(zend_object) - sizeof(zval))) / sizeof(zval)) * sizeof(void*));

ref = ir_LOAD_A(ir_ADD_OFFSET(obj_ref, offsetof(zend_object, ce)));
ref = ir_LOAD_A(ir_ADD_OFFSET(ref, offsetof(zend_class_entry, properties_info_table)));
Expand Down Expand Up @@ -14776,7 +14777,8 @@ static int zend_jit_assign_obj(zend_jit_ctx *jit,
if (ce && ce->ce_flags & ZEND_ACC_IMMUTABLE) {
ref = ir_CONST_ADDR(prop_info);
} else {
int prop_info_offset = Z_PROP_TABLE_OFFSET(prop_info) * sizeof(void*);
int prop_info_offset =
(((prop_info->offset - (sizeof(zend_object) - sizeof(zval))) / sizeof(zval)) * sizeof(void*));

ref = ir_LOAD_A(ir_ADD_OFFSET(obj_ref, offsetof(zend_object, ce)));
ref = ir_LOAD_A(ir_ADD_OFFSET(ref, offsetof(zend_class_entry, properties_info_table)));
Expand Down Expand Up @@ -15131,7 +15133,8 @@ static int zend_jit_assign_obj_op(zend_jit_ctx *jit,
if (ce && ce->ce_flags & ZEND_ACC_IMMUTABLE) {
ref = ir_CONST_ADDR(prop_info);
} else {
int prop_info_offset = Z_PROP_TABLE_OFFSET(prop_info) * sizeof(void*);
int prop_info_offset =
(((prop_info->offset - (sizeof(zend_object) - sizeof(zval))) / sizeof(zval)) * sizeof(void*));

ref = ir_LOAD_A(ir_ADD_OFFSET(obj_ref, offsetof(zend_object, ce)));
ref = ir_LOAD_A(ir_ADD_OFFSET(ref, offsetof(zend_class_entry, properties_info_table)));
Expand Down Expand Up @@ -15520,7 +15523,8 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit,
if (ce && ce->ce_flags & ZEND_ACC_IMMUTABLE) {
ref = ir_CONST_ADDR(prop_info);
} else {
int prop_info_offset = Z_PROP_TABLE_OFFSET(prop_info) * sizeof(void*);
int prop_info_offset =
(((prop_info->offset - (sizeof(zend_object) - sizeof(zval))) / sizeof(zval)) * sizeof(void*));

ref = ir_LOAD_A(ir_ADD_OFFSET(obj_ref, offsetof(zend_object, ce)));
ref = ir_LOAD_A(ir_ADD_OFFSET(ref, offsetof(zend_class_entry, properties_info_table)));
Expand Down

0 comments on commit 21ec227

Please sign in to comment.