Intriduced ZEND_ACC_INHERITED class flag.

It's going to be helpful for static optimisations, when "parent" is not known yet.
This commit is contained in:
Dmitry Stogov 2016-11-01 22:56:25 +03:00
parent b281362681
commit bdc1ba3e3a
3 changed files with 3 additions and 1 deletions

View File

@ -5949,6 +5949,7 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
}
zend_compile_class_ref(&extends_node, extends_ast, 0);
ce->ce_flags |= ZEND_ACC_INHERITED;
}
opline = get_next_op(CG(active_op_array));

View File

@ -213,6 +213,7 @@ typedef struct _zend_oparray_context {
#define ZEND_ACC_TRAIT 0x80
#define ZEND_ACC_ANON_CLASS 0x100
#define ZEND_ACC_ANON_BOUND 0x200
#define ZEND_ACC_INHERITED 0x400
/* method flags (visibility) */
/* The order of those must be kept - public < protected < private */

View File

@ -4783,7 +4783,7 @@ ZEND_METHOD(reflection_class, getModifiers)
}
GET_REFLECTION_OBJECT_PTR(ce);
RETURN_LONG(ce->ce_flags & ~(ZEND_ACC_CONSTANTS_UPDATED|ZEND_ACC_USE_GUARDS));
RETURN_LONG(ce->ce_flags & ~(ZEND_ACC_CONSTANTS_UPDATED|ZEND_ACC_USE_GUARDS|ZEND_ACC_INHERITED));
}
/* }}} */