Changeset 1475 for trunk


Ignore:
Timestamp:
2013-11-13T09:20:22+01:00 (10 months ago)
Author:
moo
Message:

processor: code clean up

Location:
trunk/processor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/main.m4

    r1474 r1475  
    242242define(`IFCOPY', `IFSTORE(`$1', `IFRESTORE(`$1', `$2')')') 
    243243define(`IFCALCCOPY', `IFCALC(`$1', `IFCOPY(`$1', `$2')')') 
    244 define(`IFRELOCATEONLY', `ifelse(PROCESSOR_TYPE, `relocate', `$1', `$2')') 
    245 define(`IFRELOCATE', `IFSTORE(`$1', `IFRELOCATEONLY(`$1', `$2')')') 
     244define(`PROCRELOCATE', `ifelse(PROCESSOR_TYPE, `relocate', `$1', `$2')') 
     245define(`IFRELOCATE', `ifelse(defn(`RELOCATE_EX'), `', `$2', `$1')') 
    246246define(`IFDPRINT', `ifelse(PROCESSOR_TYPE, `dprint', `$1', `$2')') 
    247247define(`IFDASM', `ifelse(PROCESSOR_TYPE, `dasm', `$1', `$2')') 
     
    259259include(__dir__`/head.m4') 
    260260 
    261 REDEF(`PROCESSOR_TYPE', `calc') include(__dir__`/processor.m4') 
    262  
     261dnl ==== calc ==== 
     262REDEF(`PROCESSOR_TYPE', `calc') 
     263include(__dir__`/processor.m4') 
     264 
     265dnl ==== store ==== 
    263266pushdef(`RELOCATE_EX', `$2 = ptradd($1 *, notnullable($2), processor->relocatediff);') 
    264 REDEF(`PROCESSOR_TYPE', `store') include(__dir__`/processor.m4') 
     267REDEF(`PROCESSOR_TYPE', `store') 
     268include(__dir__`/processor.m4') 
    265269popdef(`RELOCATE_EX') 
    266270 
    267 REDEF(`PROCESSOR_TYPE', `restore') include(__dir__`/processor.m4') 
    268  
     271dnl ==== restore ==== 
     272REDEF(`PROCESSOR_TYPE', `restore') 
     273include(__dir__`/processor.m4') 
     274 
     275dnl ==== relocate ==== 
    269276pushdef(`PTR_FROM_VIRTUAL_EX', `ptradd($1 *, notnullable($2), ptrdiff)') 
    270277pushdef(`RELOCATE_EX', `$2 = ptradd($1 *, notnullable($2), relocatediff);') 
    271278pushdef(`SRC', defn(`DST')) 
    272 REDEF(`PROCESSOR_TYPE', `relocate') include(__dir__`/processor.m4') 
     279REDEF(`PROCESSOR_TYPE', `relocate') 
     280include(__dir__`/processor.m4') 
    273281popdef(`SRC') 
    274282popdef(`RELOCATE_EX') 
    275283popdef(`PTR_FROM_VIRTUAL_EX') 
    276284 
     285dnl ==== dprint ==== 
    277286#ifdef HAVE_XCACHE_DPRINT 
    278287REDEF(`PROCESSOR_TYPE', `dprint') include(__dir__`/processor.m4') 
    279288#endif /* HAVE_XCACHE_DPRINT */ 
     289 
     290dnl ==== dasm ==== 
    280291#ifdef HAVE_XCACHE_DISASSEMBLER 
    281292REDEF(`PROCESSOR_TYPE', `dasm') include(__dir__`/processor.m4') 
  • trunk/processor/struct.m4

    r1474 r1475  
    1515        IFSTORE(  `xc_processor_t *processor, $1 *dst, const $1 * const src') 
    1616        IFRESTORE(`xc_processor_t *processor, $1 *dst, const $1 * const src') 
    17         IFRELOCATEONLY(`$1 *const dst, ptrdiff_t ptrdiff, ptrdiff_t relocatediff') 
     17        PROCRELOCATE(`$1 *const dst, ptrdiff_t ptrdiff, ptrdiff_t relocatediff') 
    1818        IFDASM(`xc_dasm_t *dasm, zval *dst, const $1 * const src') 
    1919        TSRMLS_DC 
     
    148148        IFSTORE(  `processor, $6 $2, $6 $3') 
    149149        IFRESTORE(`processor, $6 $2, $6 $3') 
    150         IFRELOCATEONLY(` 
     150        PROCRELOCATE(` 
    151151            ifelse(`$6', `', `PTR_FROM_VIRTUAL_EX(`$1', `$3')', `$6 $3') 
    152152            , ptrdiff 
Note: See TracChangeset for help on using the changeset viewer.