Changeset 1442 in svn


Ignore:
Timestamp:
2013-11-06T17:57:52+01:00 (21 months ago)
Author:
Xuefer
Message:

rename ptrmove to relocate, reduce export to only necessary onces

Location:
trunk/processor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r1440 r1442  
    115115};
    116116/* }}} */
    117 /* export: typedef struct _xc_ptrmove_t { ptrdiff_t src; ptrdiff_t ptrdiff; } xc_ptrmove_t; :export {{{ */
     117/* export: typedef struct _xc_relocate_t { ptrdiff_t src; ptrdiff_t dst; ptrdiff_t ptrdiff; } xc_relocate_t; :export {{{ */
    118118/* }}} */
    119119/* export: typedef struct _xc_dasm_t { const zend_op_array *active_op_array_src; } xc_dasm_t; :export {{{ */
     
    513513}
    514514/* }}} */
    515 /* export: xc_entry_var_t *xc_processor_restore_xc_entry_var_t(xc_entry_var_t *dst, const xc_entry_var_t *src TSRMLS_DC); :export {{{ */
    516 xc_entry_var_t *xc_processor_restore_xc_entry_var_t(xc_entry_var_t *dst, const xc_entry_var_t *src TSRMLS_DC) {
    517     xc_processor_t processor;
    518 
    519     memset(&processor, 0, sizeof(processor));
    520     xc_restore_xc_entry_var_t(&processor, dst, src TSRMLS_CC);
    521 
    522     return dst;
    523 }
    524 /* }}} */
    525515/* export: zval *xc_processor_restore_zval(zval *dst, const zval *src, zend_bool have_references TSRMLS_DC); :export {{{ */
    526516zval *xc_processor_restore_zval(zval *dst, const zval *src, zend_bool have_references TSRMLS_DC) {
     
    543533}
    544534/* }}} */
     535define(`DEFINE_RELOCATE_API', `
     536/* export: void xc_processor_relocate_$1(int a TSRMLS_DC); :export {{{ */
     537void xc_processor_relocate_$1(int a TSRMLS_DC) {
     538}
     539/* }}} */
     540')
     541DEFINE_RELOCATE_API(`xc_entry_var_t')
     542DEFINE_RELOCATE_API(`xc_entry_php_t')
     543DEFINE_RELOCATE_API(`xc_entry_data_php_t')
    545544/* export: void xc_dprint(xc_entry_php_t *src, int indent TSRMLS_DC); :export {{{ */
    546545#ifdef HAVE_XCACHE_DPRINT
  • trunk/processor/main.m4

    r1440 r1442  
    2727dnl {{{ SRCPTR(1:type, 2:elm)
    2828define(`SRCPTR', `SRCPTR_EX(`$1', `SRC(`$2')')')
    29 define(`SRCPTR_EX', `IFPTRMOVE(`(($1 *) (((char *) $2) + ptrmove->src))', `$2')')
    30 dnl }}}
    31 dnl {{{ SRCPTR(1:type, 2:elm)
     29define(`SRCPTR_EX', `IFPTRMOVE(`(($1 *) (((char *) $2) + relocate->src))', `$2')')
     30dnl }}}
     31dnl {{{ DSTPTR(1:type, 2:elm)
    3232define(`DSTPTR', `DSTPTR_EX(`$1', `DST(`$2')')')
    33 define(`DSTPTR_EX', `SRCPTR_EX($@)')
     33define(`DSTPTR_EX', `IFPTRMOVE(`(($1 *) (((char *) $2) + relocate->dst))', `$2')')
    3434dnl }}}
    3535dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5:realtype=$2)
     
    128128')')
    129129dnl }}}
    130 dnl {{{ EXPORT
    131 define(`EXPORT', `define(`EXPORT_$1')')
     130dnl {{{ EXPORT(1:type, 2:processor)
     131define(`EXPORT', `define(`EXPORT_$1_$2', 1)')
    132132dnl }}}
    133133dnl {{{ FIXPOINTER(1:type, 2:ele)
     
    137137define(`FIXPOINTER_EX', `
    138138    IFSTORE(`$2 = ($1 *) processor->shm->handlers->to_readonly(processor->shm, (void *)$2);')
    139     IFPTRMOVE(`$2 = ($1 *) (((char *) $3) + ptrmove->ptrdiff);')
     139    IFPTRMOVE(`$2 = ($1 *) (((char *) $3) + relocate->ptrdiff);')
    140140')
    141141dnl }}}
     
    237237define(`IFCALCSTORE', `IFSTORE(`$1', `IFCALC(`$1', `$2')')')
    238238define(`IFRESTORE', `ifelse(PROCESSOR_TYPE, `restore', `$1', `$2')')
    239 define(`IFPTRMOVE', `ifelse(PROCESSOR_TYPE, `ptrmove', `$1', `$2')')
     239define(`IFPTRMOVE', `ifelse(PROCESSOR_TYPE, `relocate', `$1', `$2')')
    240240define(`IFCOPY', `IFSTORE(`$1', `IFRESTORE(`$1', `$2')')')
    241241define(`IFCALCCOPY', `IFCALC(`$1', `IFCOPY(`$1', `$2')')')
     
    244244dnl }}}
    245245
    246 EXPORT(`zend_op')
    247 EXPORT(`zend_op_array')
    248 EXPORT(`zend_function')
    249 EXPORT(`HashTable_zend_function')
    250 EXPORT(`zend_class_entry')
    251 EXPORT(`xc_classinfo_t')
    252 EXPORT(`xc_funcinfo_t')
    253 EXPORT(`xc_entry_var_t')
    254 EXPORT(`xc_entry_php_t')
    255 EXPORT(`xc_entry_data_php_t')
    256 EXPORT(`zval')
     246EXPORT(`dasm', `zend_op_array')
     247EXPORT(`dasm', `zend_function')
     248EXPORT(`dasm', `zend_class_entry')
     249
     250EXPORT(`calc',    `xc_entry_data_php_t')
     251EXPORT(`calc',    `xc_entry_php_t')
     252EXPORT(`calc',    `xc_entry_var_t')
     253EXPORT(`store',   `xc_entry_data_php_t')
     254EXPORT(`store',   `xc_entry_php_t')
     255EXPORT(`store',   `xc_entry_var_t')
     256EXPORT(`restore', `xc_entry_data_php_t')
     257EXPORT(`restore', `xc_entry_php_t')
     258EXPORT(`dasm',    `xc_entry_data_php_t')
     259EXPORT(`dprint',  `xc_entry_php_t')
     260
     261EXPORT(`restore', `zval')
     262EXPORT(`dprint',  `zval')
    257263
    258264include(srcdir`/processor/hashtable.m4')
     
    265271REDEF(`PROCESSOR_TYPE', `store') include(srcdir`/processor/processor.m4')
    266272REDEF(`PROCESSOR_TYPE', `restore') include(srcdir`/processor/processor.m4')
    267 REDEF(`PROCESSOR_TYPE', `ptrmove') include(srcdir`/processor/processor.m4')
     273REDEF(`PROCESSOR_TYPE', `relocate') include(srcdir`/processor/processor.m4')
    268274
    269275#ifdef HAVE_XCACHE_DPRINT
  • trunk/processor/struct.m4

    r1440 r1442  
    55define(`DECL_STRUCT_P_FUNC', `translit(
    66    pushdefFUNC_NAME(`$1', `$2')
    7     define(`DEFINED_'ifelse(`$2', `', `$1', `$2'), `')
    8     ifdef(`EXPORT_'ifelse(`$2', `', `$1', `$2'), `void', `static void inline')
     7    pushdef(`type', `ifelse(`$2', `', `$1', `$2')')
     8    define(`DEFINED_'type, `')
     9    ifelse(ifdef(`EXPORT_'PROCESSOR_TYPE`_'type,1)ifdef(`EXPORT_'PROCESSOR_TYPE`_',1)ifdef(`EXPORT__'type,1), `', `static void inline',
     10        `', `', `void')
     11    popdef(`type')
    912    FUNC_NAME`'(
    1013        IFDPRINT( `const $1 * const src, int indent')
     
    1215        IFSTORE(  `xc_processor_t *processor, $1 *dst, const $1 * const src')
    1316        IFRESTORE(`xc_processor_t *processor, $1 *dst, const $1 * const src')
    14         IFPTRMOVE(`const xc_ptrmove_t *ptrmove, $1 * const dst, const $1 * const src')
     17        IFPTRMOVE(`const xc_relocate_t *relocate, $1 * const dst, const $1 * const src')
    1518        IFDASM(   `xc_dasm_t *dasm, zval *dst, const $1 * const src')
    1619        TSRMLS_DC
     
    2427    pushdefFUNC_NAME(`$1', `$2')
    2528/* {`{'{ FUNC_NAME */
    26     ifdef(`EXPORT_'ifelse(`$2', `', `$1', `$2'), `
    27         /* export: DECL_STRUCT_P_FUNC(`$1', `$2') :export */
    28     ')
    29 DECL_STRUCT_P_FUNC(`$1', `$2', 1)
     29    pushdef(`type', `ifelse(`$2', `', `$1', `$2')')
     30    define(`DEFINED_'type, `')
     31    ifelse(ifdef(`EXPORT_'PROCESSOR_TYPE`_'type,1)ifdef(`EXPORT_'PROCESSOR_TYPE`_',1)ifdef(`EXPORT__'type,1), `', `',
     32        `', `', `/* export: DECL_STRUCT_P_FUNC(`$1', `$2') :export */')
     33    popdef(`type')
     34DECL_STRUCT_P_FUNC(`$1', `$2', ` ')
    3035    {
    3136        pushdef(`ELEMENTS_DONE')
     
    144149        IFRESTORE(`processor, $6 $2, $6 $3')
    145150        IFPTRMOVE(`
    146             ptrmove
     151            relocate
    147152            , ifelse(`$6', `', `DSTPTR_EX(`$1', `$2')', `$6 $2')
    148153            , ifelse(`$6', `', `SRCPTR_EX(`$1', `$3')', `$6 $3')
Note: See TracChangeset for help on using the changeset viewer.