Ejemplo n.º 1
0
Archivo: cascade.c Proyecto: taysom/tau
void cascade (cascade_s w, tick_t delta)
{
	tick_t	avg;
	slot_s	*s;
	slot_s	*next;

	s = &w->wh_slot[w->wh_next];
	s->s_delta = delta;
	s->s_avg   = delta;

	for (;;) {
		if (++w->wh_next != NUM_SLOTS) {
			break;
		}
		w->wh_next = 0;
		s = max_slot(w->wh_slot, &avg);

		++w;
		next = &w->wh_slot[w->wh_next];
		next->s_delta = s->s_delta;
		next->s_avg   = avg;
	}
}
Ejemplo n.º 2
0
IInteger biggest_local_vtbl_slot( ClassType* ctype ) {
  list<InstanceMethodSymbol* > method_list =
    collect_stos<InstanceMethodSymbol,InstanceMethodSymbol>( ctype->get_instance_method_symbol_table() );    
  
  IInteger max_slot(-1);
  for ( unsigned i = 0 ; i < method_list.size() ; i++ ) {
    InstanceMethodSymbol* msym = method_list[i];

    VtblSlotNumberAnnote* slot_number_annote =
      to<VtblSlotNumberAnnote>( msym->peek_annote(k_vtbl_slot_number_annote) );

    if( slot_number_annote == NULL ) {
      // Ignore --- method is not dispatched
      continue;
    }

    IInteger slot = slot_number_annote->get_slot_number();
    if( slot > max_slot )
      max_slot = slot;
  }

  return max_slot;
}