Browse Source

PHP_5_6: finish support for zend_ast

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1487 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
master
Xuefer 7 years ago
parent
commit
23d83bef26
  1. 4
      ChangeLog
  2. 23
      processor/processor.m4

4
ChangeLog

@ -7,9 +7,11 @@ API Changes
ChangeLog
========
* cacher:
* PHP_5_6 support
* (WIP) defragment
* (WIP) cache to disk
* (WIP) PHP_5_6 support
* disassembler, decompiler:
* PHP_5_6 support
* misc:
* Reflection info added for APIs

23
processor/processor.m4

@ -70,10 +70,10 @@ DEF_HASH_TABLE_FUNC(`HashTable_zend_function', `zend_function')
DEF_HASH_TABLE_FUNC(`HashTable_zend_property_info', `zend_property_info')
#endif
#ifdef IS_CONSTANT_AST
define(`ZEND_AST_HELPER', `
{
define(`ZEND_AST_HELPER', `dnl {{{
{
IFCALCCOPY(`
size_t zend_ast_size = $1->kind == ZEND_CONST
size_t zend_ast_size = ($1->kind == ZEND_CONST)
? sizeof(zend_ast) + sizeof(zval)
: sizeof(zend_ast) + sizeof(zend_ast *) * ($1->children - 1);
')
@ -81,8 +81,9 @@ define(`ZEND_AST_HELPER', `
pushdef(`ALLOC_SIZE_HELPER', `zend_ast_size')
$2
popdef(`ALLOC_SIZE_HELPER')
}
}
')
dnl }}}
DEF_STRUCT_P_FUNC(`zend_ast', , `dnl {{{
zend_ushort i;
PROCESS(zend_ushort, kind)
@ -92,6 +93,7 @@ DEF_STRUCT_P_FUNC(`zend_ast', , `dnl {{{
if (SRC()->kind == ZEND_CONST) {
assert(SRC()->u.val);
IFCOPY(`
DST()->u.val = (zval *) (DST() + 1);
memcpy(DST()->u.val, SRC()->u.val, sizeof(zval));
')
STRUCT_P_EX(zval, DST()->u.val, SRC()->u.val, `', `', ` ')
@ -100,9 +102,16 @@ DEF_STRUCT_P_FUNC(`zend_ast', , `dnl {{{
else {
for (i = 0; i < SRC()->children; ++i) {
zend_ast *src_ast = (&SRC()->u.child)[i];
ALLOC(`(&DST()->u.child)[i]', zend_ast)
ZEND_AST_HELPER(`src_ast', `STRUCT_P_EX(zend_ast, (&DST()->u.child)[i], src_ast, `[i]', `', ` ')')
RELOCATE_EX(zend_ast, (&DST()->u.child)[i])
if (src_ast) {
ZEND_AST_HELPER(`src_ast', `
ALLOC(`(&DST()->u.child)[i]', zend_ast)
STRUCT_P_EX(zend_ast, (&DST()->u.child)[i], src_ast, `[i]', `', ` ')
')
RELOCATE_EX(zend_ast, (&DST()->u.child)[i])
}
else {
COPYNULL_EX(`(&DST()->u.child)[i]')
}
}
}
')

Loading…
Cancel
Save