static void DumpScList( score_list *curr ) /********************************************/ { DumpLiteral( " " ); switch( curr->info.class ) { case SC_N_CONSTANT: DumpChar( '&' ); DumpLong( curr->info.offset ); break; case SC_N_TEMP: DumpChar( 't' ); DumpInt( curr->info.symbol.t->v.id ); DumpLiteral( " offset " ); DumpLong( curr->info.offset ); break; case SC_N_MEMORY: DumpXString( FEName( curr->info.symbol.p ) ); DumpLiteral( " offset " ); DumpLong( curr->info.offset ); break; case SC_N_INDEXED: if( curr->info.base == NULL ) { ; } else if( curr->info.base->n.class == N_TEMP ) { DumpChar( 't' ); DumpInt( curr->info.base->t.v.id ); DumpChar( '+' ); } else { DumpXString( FEName( curr->info.base->v.symbol ) ); DumpChar( '+' ); } DumpLong( curr->info.offset ); DumpChar( '[' ); DumpRegName( ScoreList[curr->info.index_reg]->reg ); DumpChar( ']' ); break; case SC_N_INITIAL: DumpLiteral( "INITIAL(" ); DumpLong( curr->info.offset ); DumpChar( ')' ); break; case SC_N_VOLATILE: DumpLiteral( "VOLATILE - Oh No!" ); break; case SC_N_ADDRESS: DumpLiteral( "ADDRESS(" ); DumpOperand(curr->info.symbol.p); DumpChar( ')' ); break; }
static void DumpCode(TProtoFunc* tf, FILE* D) { int size=CodeSize(tf); if (NotWord(size)) fprintf(stderr,"luac: warning: " "\"%s\":%d code too long for 16-bit machines (%d bytes)\n", fileName(tf),tf->lineDefined,size); DumpLong(size,D); DumpBlock(tf->code,size,D); }
extern void DumpAConf( conflict_node *conf ) { /************************************************/ DumpOperand( conf->name ); DumpLiteral( " id " ); DumpGBit( &conf->id.out_of_block ); DumpChar( ' ' ); DumpLBit( &conf->id.within_block ); DumpPossible( conf->possible ); DumpNL(); DumpLiteral( " " ); DumpInsRange( conf ); DumpLiteral( " Start block " ); DumpPtr( conf->start_block ); DumpNL(); DumpLiteral( " Conflicts with " ); DumpGBit( &conf->with.out_of_block ); DumpChar( ' ' ); DumpLBit( &conf->with.within_block ); DumpChar( ' ' ); DumpRegName( conf->with.regs ); DumpNL(); DumpLiteral( " Constrained " ); DumpInt( conf->num_constrained ); DumpLiteral( " vs " ); DumpInt( conf->available ); DumpNL(); if( _Is( conf, CST_SAVINGS_CALCULATED ) ) { DumpLiteral( " Savings " ); DumpLong( conf->savings ); DumpNL(); } if( _Is( conf, CST_CONFLICT_ON_HOLD ) ) { DumpLiteral( " On hold" ); DumpNL(); } if( _Is( conf, CST_CHANGES_OTHERS ) ) { DumpLiteral( " Changes Others" ); DumpNL(); } if( _Is( conf, CST_NEEDS_SEGMENT ) ) { DumpLiteral( " Needs segment" ); DumpNL(); } if( _Is( conf, CST_NEEDS_SEGMENT_SPLIT ) ) { DumpLiteral( " Needs segment split" ); DumpNL(); } if( _Is( conf, CST_SEGMENT_SPLIT ) ) { DumpLiteral( " Is segment split" ); DumpNL(); } if( _Is( conf, CST_NEEDS_INDEX ) ) { DumpLiteral( " Needs index" ); DumpNL(); } if( _Is( conf, CST_NEEDS_INDEX_SPLIT ) ) { DumpLiteral( " Needs index split" ); DumpNL(); } if( _Is( conf, CST_INDEX_SPLIT ) ) { DumpLiteral( " Is index split" ); DumpNL(); } }
extern void DumpIV( induction *var ) { /****************************************/ induction *alias; invariant *invar; DumpPtr( var ); DumpLiteral( " " ); DumpOperand( var->name ); DumpLiteral( " = ( " ); if( _IsV( var, IV_BASIC ) ) { DumpLiteral( "**basic**" ); } else { if( var->ivtimes != NULL ) { DumpOperand( var->ivtimes ); DumpLiteral( " * " ); } if( var->times != 1 ) { DumpLong( var->times ); DumpLiteral( " * " ); } DumpOperand( var->basic->name ); } DumpLiteral( " )" ); if( var->plus != 0 ) { DumpLiteral( " + ( " ); DumpLong( var->plus ); DumpLiteral( " )" ); } if( var->ivtimes != NULL && var->plus2 != 0 ) { DumpLiteral( " + ( " ); DumpOperand( var->ivtimes ); DumpLiteral( " * " ); DumpLong( var->plus2 ); DumpLiteral( " )" ); } for( invar = var->invar; invar != NULL; invar = invar->next ) { DumpLiteral( " + ( " ); if( var->lasttimes >= invar->id ) { DumpOperand( var->ivtimes ); DumpLiteral( " * " ); } if( invar->times != 1 ) { DumpLong( invar->times ); DumpLiteral( " * " ); } DumpOperand( invar->name ); DumpLiteral( " )" ); } DumpNL(); DumpLiteral( " ins=" ); DumpPtr( var->ins ); DumpLiteral( " prev=" ); DumpPtr( var->prev ); DumpLiteral( " basic=" ); DumpOperand( var->basic->name ); if( _IsV( var, IV_ALIAS ) ) { DumpLiteral( " alias=" ); for( alias = var->alias; _IsV( alias, IV_ALIAS ); ) { alias = alias->alias; } DumpPtr( alias ); } DumpNL(); DumpLiteral( " Uses: " ); DumpInt( var->use_count ); DumpChar( ' ' ); if( _IsV( var, IV_BASIC ) ) { DumpLiteral( " Basic" ); } if( _IsV( var, IV_DEAD ) ) { DumpLiteral( " Dead" ); } if( _IsV( var, IV_SURVIVED ) ) { DumpLiteral( " Survived" ); } if( _IsV( var, IV_TOP ) ) { DumpLiteral( " Top" ); } if( _IsV( var, IV_INTRODUCED ) ) { DumpLiteral( " Introduced" ); } if( _IsV( var, IV_ALIAS ) ) { DumpLiteral( " Alias" ); } if( _IsV( var, IV_INDEXED ) ) { DumpLiteral( " Indexed" ); } if( _IsV( var, IV_USED ) ) { DumpLiteral( " Used" ); } DumpNL(); }
extern void DumpOperand( name *operand ) { /********************************************/ char buffer[20]; hw_reg_set reg; name *base; if( operand->n.class == N_INDEXED ) { if( operand->i.base != NULL ) { if( !( operand->i.index_flags & X_FAKE_BASE ) ) { if( operand->i.index_flags & X_LOW_ADDR_BASE ) { DumpLiteral( "l^" ); } DumpOperand( operand->i.base ); if( operand->i.constant > 0 ) { DumpChar( '+' ); } } } if( operand->i.constant != 0 ) { DumpLong( operand->i.constant ); } DumpChar( '[' ); if( operand->i.index_flags & X_BASE ) { reg = operand->i.index->r.reg; #if _TARGET & ( _TARG_IAPX86 | _TARG_80386 ) if( HW_COvlap( reg, HW_SEGS ) ) { hw_reg_set tmp; tmp = reg; HW_COnlyOn( tmp, HW_SEGS ); DumpRegName( tmp ); DumpChar( ':' ); HW_CTurnOff( reg, HW_SEGS ); } #endif if( operand->i.index_flags & X_HIGH_BASE ) { DumpRegName( HighReg( reg ) ); DumpChar( '+' ); DumpRegName( LowReg( reg ) ); } else { DumpRegName( LowReg( reg ) ); DumpChar( '+' ); DumpRegName( HighReg( reg ) ); } } else { DumpOperand( operand->i.index ); } if( operand->i.scale != 0 ) { DumpChar( '*' ); DumpInt( 1 << operand->i.scale ); } if( operand->i.index_flags & ( X_ALIGNED_1 | X_ALIGNED_2 | X_ALIGNED_4 | X_ALIGNED_8 ) ) { DumpChar( '$' ); DumpInt( FlagsToAlignment( operand->i.index_flags ) ); } DumpChar( ']' ); base = operand->i.base; if( base != NULL ) { if( operand->i.index_flags & X_FAKE_BASE ) { DumpChar( '{' ); if( base->n.class == N_MEMORY ) { DumpXString( AskName(base->v.symbol, base->m.memory_type) ); } else if( base->n.class == N_TEMP ) { if( _FrontEndTmp( base ) ) { DumpXString( FEName( base->v.symbol ) ); } else { DumpOperand( base ); } } DumpChar( '}' ); } }