|
|
|
@ -11,9 +11,7 @@ DECL_STRUCT_P_FUNC(`zend_constant')
|
|
|
|
|
DECL_STRUCT_P_FUNC(`zend_function')
|
|
|
|
|
DECL_STRUCT_P_FUNC(`xc_entry_var_t')
|
|
|
|
|
DECL_STRUCT_P_FUNC(`xc_entry_php_t')
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
DECL_STRUCT_P_FUNC(`zend_property_info')
|
|
|
|
|
#endif
|
|
|
|
|
/* }}} */
|
|
|
|
|
dnl ====================================================
|
|
|
|
|
#ifdef IS_CV
|
|
|
|
@ -33,18 +31,6 @@ DEF_STRUCT_P_FUNC(`zend_uint', , `dnl {{{
|
|
|
|
|
DONE_SIZE(sizeof(src[0]))
|
|
|
|
|
')
|
|
|
|
|
dnl }}}
|
|
|
|
|
#ifndef ZEND_ENGINE_2
|
|
|
|
|
DEF_STRUCT_P_FUNC(`int', , `dnl {{{
|
|
|
|
|
IFCOPY(`*dst = *src;')
|
|
|
|
|
IFDPRINT(`
|
|
|
|
|
INDENT()
|
|
|
|
|
fprintf(stderr, "%d\n", src[0]);
|
|
|
|
|
')
|
|
|
|
|
DONE_SIZE(sizeof(src[0]))
|
|
|
|
|
')
|
|
|
|
|
dnl }}}
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
DEF_STRUCT_P_FUNC(`zend_try_catch_element', , `dnl {{{
|
|
|
|
|
PROCESS(zend_uint, try_op)
|
|
|
|
|
PROCESS(zend_uint, catch_op)
|
|
|
|
@ -54,7 +40,6 @@ DEF_STRUCT_P_FUNC(`zend_try_catch_element', , `dnl {{{
|
|
|
|
|
#endif
|
|
|
|
|
')
|
|
|
|
|
dnl }}}
|
|
|
|
|
#endif
|
|
|
|
|
DEF_STRUCT_P_FUNC(`zend_brk_cont_element', , `dnl {{{
|
|
|
|
|
#ifdef ZEND_ENGINE_2_2
|
|
|
|
|
PROCESS(int, start)
|
|
|
|
@ -66,9 +51,7 @@ DEF_STRUCT_P_FUNC(`zend_brk_cont_element', , `dnl {{{
|
|
|
|
|
dnl }}}
|
|
|
|
|
DEF_HASH_TABLE_FUNC(`HashTable_zval_ptr', `zval_ptr')
|
|
|
|
|
DEF_HASH_TABLE_FUNC(`HashTable_zend_function', `zend_function')
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
DEF_HASH_TABLE_FUNC(`HashTable_zend_property_info', `zend_property_info')
|
|
|
|
|
#endif
|
|
|
|
|
DEF_STRUCT_P_FUNC(`zval', , `dnl {{{
|
|
|
|
|
IFDASM(`do {
|
|
|
|
|
zval_dtor(dst);
|
|
|
|
@ -132,10 +115,6 @@ proc_unicode:
|
|
|
|
|
case IS_OBJECT:
|
|
|
|
|
IFNOTMEMCPY(`IFCOPY(`memcpy(dst, src, sizeof(src[0]));')')
|
|
|
|
|
dnl STRUCT(value.obj)
|
|
|
|
|
#ifndef ZEND_ENGINE_2
|
|
|
|
|
STRUCT_P(zend_class_entry, value.obj.ce)
|
|
|
|
|
STRUCT_P(HashTable, value.obj.properties, HashTable_zval_ptr)
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
@ -153,10 +132,8 @@ dnl }}}
|
|
|
|
|
|
|
|
|
|
#ifdef ZEND_ENGINE_2_3
|
|
|
|
|
PROCESS(zend_uint, refcount__gc)
|
|
|
|
|
#elif defined(ZEND_ENGINE_2)
|
|
|
|
|
PROCESS(zend_uint, refcount)
|
|
|
|
|
#else
|
|
|
|
|
PROCESS(zend_ushort, refcount)
|
|
|
|
|
PROCESS(zend_uint, refcount)
|
|
|
|
|
#endif
|
|
|
|
|
')dnl IFDASM
|
|
|
|
|
')
|
|
|
|
@ -225,7 +202,6 @@ DEF_STRUCT_P_FUNC(`zval_ptr_nullable', , `dnl {{{
|
|
|
|
|
DONE_SIZE(sizeof(zval_ptr_nullable))
|
|
|
|
|
')
|
|
|
|
|
dnl }}}
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
DEF_STRUCT_P_FUNC(`zend_arg_info', , `dnl {{{
|
|
|
|
|
PROCESS(zend_uint, name_len)
|
|
|
|
|
PROC_ZSTRING_L(, name, name_len)
|
|
|
|
@ -244,7 +220,6 @@ DEF_STRUCT_P_FUNC(`zend_arg_info', , `dnl {{{
|
|
|
|
|
#endif
|
|
|
|
|
')
|
|
|
|
|
dnl }}}
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_XCACHE_CONSTANT
|
|
|
|
|
DEF_STRUCT_P_FUNC(`zend_constant', , `dnl {{{
|
|
|
|
|
STRUCT(zval, value)
|
|
|
|
@ -278,7 +253,6 @@ DEF_STRUCT_P_FUNC(`zend_function', , `dnl {{{
|
|
|
|
|
DONE_SIZE(sizeof(src[0]))
|
|
|
|
|
')
|
|
|
|
|
dnl }}}
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
DEF_STRUCT_P_FUNC(`zend_property_info', , `dnl {{{
|
|
|
|
|
PROCESS(zend_uint, flags)
|
|
|
|
|
PROCESS(int, name_length)
|
|
|
|
@ -297,7 +271,6 @@ DEF_STRUCT_P_FUNC(`zend_property_info', , `dnl {{{
|
|
|
|
|
#endif
|
|
|
|
|
')
|
|
|
|
|
dnl }}}
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_ENGINE_2_4
|
|
|
|
|
DEF_STRUCT_P_FUNC(`zend_trait_method_reference', , `dnl {{{
|
|
|
|
|
PROCESS(unsigned int, mname_len)
|
|
|
|
@ -360,31 +333,14 @@ DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
|
|
|
|
|
PROCESS(char, type)
|
|
|
|
|
PROCESS(zend_uint, name_length)
|
|
|
|
|
PROC_ZSTRING_L(, name, name_length)
|
|
|
|
|
IFRESTORE(`
|
|
|
|
|
#ifndef ZEND_ENGINE_2
|
|
|
|
|
/* just copy parent and resolve on install_class */
|
|
|
|
|
COPY(parent)
|
|
|
|
|
#else
|
|
|
|
|
PROC_CLASS_ENTRY_P(parent)
|
|
|
|
|
#endif
|
|
|
|
|
', `
|
|
|
|
|
PROC_CLASS_ENTRY_P(parent)
|
|
|
|
|
')
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
PROC_CLASS_ENTRY_P(parent)
|
|
|
|
|
PROCESS(int, refcount)
|
|
|
|
|
#else
|
|
|
|
|
STRUCT_P(int, refcount)
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef ZEND_ENGINE_2_4
|
|
|
|
|
PROCESS(zend_bool, constants_updated)
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
PROCESS(zend_uint, ce_flags)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
STRUCT(HashTable, properties_info, HashTable_zend_property_info)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef ZEND_ENGINE_2_4
|
|
|
|
|
STRUCT_ARRAY(int, default_properties_count, zval_ptr_nullable, default_properties_table)
|
|
|
|
@ -401,12 +357,11 @@ DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
|
|
|
|
|
STRUCT(HashTable, default_static_members, HashTable_zval_ptr)
|
|
|
|
|
IFCOPY(`dst->static_members = &dst->default_static_members;')
|
|
|
|
|
DONE(static_members)
|
|
|
|
|
# elif defined(ZEND_ENGINE_2)
|
|
|
|
|
# else
|
|
|
|
|
STRUCT_P(HashTable, static_members, HashTable_zval_ptr)
|
|
|
|
|
# endif
|
|
|
|
|
#endif /* ZEND_ENGINE_2_4 */
|
|
|
|
|
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
STRUCT(HashTable, constants_table, HashTable_zval_ptr)
|
|
|
|
|
|
|
|
|
|
#ifdef ZEND_ENGINE_2_2
|
|
|
|
@ -489,11 +444,6 @@ DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
|
|
|
|
|
/* # NOT DONE */
|
|
|
|
|
COPY(module)
|
|
|
|
|
# endif
|
|
|
|
|
#else /* ZEND_ENGINE_2 */
|
|
|
|
|
COPY(handle_function_call)
|
|
|
|
|
COPY(handle_property_get)
|
|
|
|
|
COPY(handle_property_set)
|
|
|
|
|
#endif
|
|
|
|
|
dnl must do after SETNULL(constructor) and dst->parent
|
|
|
|
|
STRUCT(HashTable, function_table, HashTable_zend_function)
|
|
|
|
|
IFRESTORE(`dst->function_table.pDestructor = ZEND_FUNCTION_DTOR;')
|
|
|
|
@ -600,9 +550,6 @@ DEF_STRUCT_P_FUNC(`znode', , `dnl {{{
|
|
|
|
|
case IS_UNUSED:
|
|
|
|
|
IFDASM(`PROCESS(zend_uint, u.var)')
|
|
|
|
|
PROCESS(zend_uint, u.opline_num)
|
|
|
|
|
#ifndef ZEND_ENGINE_2
|
|
|
|
|
PROCESS(zend_uint, u.fetch_type)
|
|
|
|
|
#endif
|
|
|
|
|
PROCESS(zend_uint, u.EA.type)
|
|
|
|
|
break;
|
|
|
|
|
')
|
|
|
|
@ -664,11 +611,9 @@ DEF_STRUCT_P_FUNC(`zend_op', , `dnl {{{
|
|
|
|
|
#ifdef ZEND_FAST_CALL
|
|
|
|
|
case ZEND_FAST_CALL:
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
assert(Z_OP(src->op1).jmp_addr >= processor->active_op_array_src->opcodes && Z_OP(src->op1).jmp_addr - processor->active_op_array_src->opcodes < processor->active_op_array_src->last);
|
|
|
|
|
Z_OP(dst->op1).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op1).jmp_addr - processor->active_op_array_src->opcodes);
|
|
|
|
|
assert(Z_OP(dst->op1).jmp_addr >= processor->active_op_array_dst->opcodes && Z_OP(dst->op1).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ZEND_JMPZ:
|
|
|
|
@ -681,11 +626,9 @@ DEF_STRUCT_P_FUNC(`zend_op', , `dnl {{{
|
|
|
|
|
#ifdef ZEND_JMP_SET_VAR
|
|
|
|
|
case ZEND_JMP_SET_VAR:
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
assert(Z_OP(src->op2).jmp_addr >= processor->active_op_array_src->opcodes && Z_OP(src->op2).jmp_addr - processor->active_op_array_src->opcodes < processor->active_op_array_src->last);
|
|
|
|
|
Z_OP(dst->op2).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op2).jmp_addr - processor->active_op_array_src->opcodes);
|
|
|
|
|
assert(Z_OP(dst->op2).jmp_addr >= processor->active_op_array_dst->opcodes && Z_OP(dst->op2).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
@ -740,10 +683,8 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
#endif
|
|
|
|
|
/* deep */
|
|
|
|
|
STRUCT_P(HashTable, static_variables, HashTable_zval_ptr)
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
|
|
|
|
|
gc_arg_info = 1;
|
|
|
|
|
#endif
|
|
|
|
|
dst->filename = processor->entry_php_src->filepath;
|
|
|
|
|
#ifdef ZEND_ENGINE_2_4
|
|
|
|
|
if (src->literals) {
|
|
|
|
@ -787,9 +728,7 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
#ifdef ZEND_FAST_CALL
|
|
|
|
|
case ZEND_FAST_CALL:
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
Z_OP(opline->op1).jmp_addr = &dst->opcodes[Z_OP(opline->op1).jmp_addr - src->opcodes];
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ZEND_JMPZ:
|
|
|
|
@ -802,9 +741,7 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
#ifdef ZEND_JMP_SET_VAR
|
|
|
|
|
case ZEND_JMP_SET_VAR:
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
Z_OP(opline->op2).jmp_addr = &dst->opcodes[Z_OP(opline->op2).jmp_addr - src->opcodes];
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
@ -818,10 +755,8 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
#endif
|
|
|
|
|
) {
|
|
|
|
|
xc_gc_op_array_t gc_op_array;
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
gc_op_array.num_args = gc_arg_info ? dst->num_args : 0;
|
|
|
|
|
gc_op_array.arg_info = gc_arg_info ? dst->arg_info : NULL;
|
|
|
|
|
#endif
|
|
|
|
|
gc_op_array.opcodes = gc_opcodes ? dst->opcodes : NULL;
|
|
|
|
|
#ifdef ZEND_ENGINE_2_4
|
|
|
|
|
gc_op_array.literals = gc_literals ? dst->literals : NULL;
|
|
|
|
@ -838,7 +773,6 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
/* Common elements */
|
|
|
|
|
PROCESS(zend_uchar, type)
|
|
|
|
|
PROC_ZSTRING(, function_name)
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
PROCESS(zend_uint, fn_flags)
|
|
|
|
|
STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
|
|
|
|
|
PROCESS(zend_uint, num_args)
|
|
|
|
@ -846,26 +780,6 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
# ifndef ZEND_ENGINE_2_4
|
|
|
|
|
PROCESS(zend_bool, pass_rest_by_reference)
|
|
|
|
|
# endif
|
|
|
|
|
#else
|
|
|
|
|
if (src->arg_types) {
|
|
|
|
|
ALLOC(dst->arg_types, zend_uchar, src->arg_types[0] + 1)
|
|
|
|
|
IFCOPY(`memcpy(dst->arg_types, src->arg_types, sizeof(src->arg_types[0]) * (src->arg_types[0]+1));')
|
|
|
|
|
IFDASM(`do {
|
|
|
|
|
int i;
|
|
|
|
|
zval *zv;
|
|
|
|
|
ALLOC_INIT_ZVAL(zv);
|
|
|
|
|
array_init(zv);
|
|
|
|
|
for (i = 0; i < src->arg_types[0]; i ++) {
|
|
|
|
|
add_next_index_long(zv, src->arg_types[i + 1]);
|
|
|
|
|
}
|
|
|
|
|
add_assoc_zval_ex(dst, ZEND_STRS("arg_types"), zv);
|
|
|
|
|
} while (0);')
|
|
|
|
|
DONE(arg_types)
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
COPYNULL(arg_types)
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef ZEND_ENGINE_2_4
|
|
|
|
|
PROCESS(unsigned char, return_reference)
|
|
|
|
|
#endif
|
|
|
|
@ -916,14 +830,9 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
#ifndef ZEND_ENGINE_2_4
|
|
|
|
|
PROCESS(zend_uint, current_brk_cont)
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef ZEND_ENGINE_2
|
|
|
|
|
PROCESS(zend_bool, uses_globals)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
STRUCT_ARRAY(int, last_try_catch, zend_try_catch_element, try_catch_array)
|
|
|
|
|
PROCESS(int, last_try_catch)
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_ENGINE_2_5
|
|
|
|
|
PROCESS(zend_bool, has_finally_block)
|
|
|
|
|
#endif
|
|
|
|
@ -954,12 +863,10 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
PROC_STRING(script_encoding)
|
|
|
|
|
')
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
PROCESS(zend_uint, line_start)
|
|
|
|
|
PROCESS(zend_uint, line_end)
|
|
|
|
|
PROCESS(int, doc_comment_len)
|
|
|
|
|
PROC_ZSTRING_L(, doc_comment, doc_comment_len)
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZEND_COMPILE_DELAYED_BINDING
|
|
|
|
|
PROCESS(zend_uint, early_binding);
|
|
|
|
|
#endif
|
|
|
|
@ -976,7 +883,6 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
} while (0);
|
|
|
|
|
IFRESTORE(`xc_fix_op_array_info(processor->entry_php_src, processor->php_src, dst, shallow_copy, op_array_info TSRMLS_CC);')
|
|
|
|
|
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
dnl mark it as -1 on store, and lookup parent on restore
|
|
|
|
|
IFSTORE(`dst->prototype = (processor->active_class_entry_src && src->prototype) ? (zend_function *) -1 : NULL;', `
|
|
|
|
|
IFRESTORE(`do {
|
|
|
|
@ -1005,16 +911,12 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
|
|
|
|
|
')
|
|
|
|
|
DONE(prototype)
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
PROC_CLASS_ENTRY_P(scope)
|
|
|
|
|
IFCOPY(`
|
|
|
|
|
if (src->scope) {
|
|
|
|
|
xc_fix_method(processor, dst TSRMLS_CC);
|
|
|
|
|
}
|
|
|
|
|
')
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
IFRESTORE(`
|
|
|
|
|
if (xc_have_op_array_ctor) {
|
|
|
|
@ -1099,11 +1001,7 @@ DEF_STRUCT_P_FUNC(`xc_classinfo_t', , `dnl {{{
|
|
|
|
|
processor->active_op_array_infos_src = src->methodinfos;
|
|
|
|
|
processor->active_op_array_index = 0;
|
|
|
|
|
')
|
|
|
|
|
#ifdef ZEND_ENGINE_2
|
|
|
|
|
STRUCT_P(zend_class_entry, cest)
|
|
|
|
|
#else
|
|
|
|
|
STRUCT(zend_class_entry, cest)
|
|
|
|
|
#endif
|
|
|
|
|
STRUCT_P(zend_class_entry, class_entry)
|
|
|
|
|
#ifndef ZEND_COMPILE_DELAYED_BINDING
|
|
|
|
|
PROCESS(int, oplineno)
|
|
|
|
|
#endif
|
|
|
|
|