Esempio n. 1
0
void irc_pstore_gen_set_tracking( struct IRC_Gen *gen, int track_level )
{
  struct IRC_Gen *i;
  int found = 0;
  int num_tracking = 0;
  int max_tracking = 0;

  assert( gen->genNum == 7 );

  RS_LVerbose( 108, 6200, "Set tracking for gen %p to %d", gen, track_level );

  gen->tracking_level = track_level;

  for (i=first_pstore_gen; i; i=i->link) {
    if (i == gen) {
      found = 1;        /* want to assert() that we found it... */
    }
    if (i->tracking_level) {
      if (i->tracking_level > max_tracking) {
        max_tracking = i->tracking_level;
      }
      num_tracking++;
    }
  }
  assert( found );
 
  RS_LVerbose( 108, 6201, "%d generations have tracking enabled; max level=%d", 
               num_tracking, max_tracking );
  irc_config_pstore_tracking( max_tracking );
}
Esempio n. 2
0
static void notice_obj( struct Scanning *ctx, obj *pitem )
{
  struct VMPageRecord *vmp;
  obj item;
  
  item = *pitem;

again:
  if (!OBJ_ISA_PTR(item))
    return;
  
  /* check for an within-the-store ptr */

  /*  might want to quickly check a small cache to
   *  speed up resolution, instead of probing the Big Cache
   */

  vmp = addr_to_vm_page_record( ctx->store, PTR_TO_PHH(item) );

  if (vmp)
    {
      an_xlated_ptr( ctx, vmp );
      return;
    }
  else
    {
      obj reloc = objecttable_lookup( ctx->store->reloc_table,
				      obj_hash(item),
				      item );
      if (EQ(reloc,FALSE_OBJ))
	{
	  /* it had better be a pivot! */
	  
	  table_lookup_or_fail( ctx,
				ctx->store->pivot_table,
				item, 
				item );
	  return;
	}
      else
	{
	  /*  it was found in the relocation table
	   *  -- store the new pointer into the object
	   *  making the reference, and try again
	   */
	  item = *pitem = reloc;
	  /*  note that we loop back to BEFORE the PTR check;
	   *  -- this allows a relocation to a non-ptr
	   */
	  goto again;
	}
    }
  /* failed! */
  RS_LVerbose( 463, 3681, "from {%lx} found escaping {%lx}", 
               VAL(ctx->source) ,
               VAL(item) );
  ctx->failures = cons( item, ctx->failures );
  return;
}
Esempio n. 3
0
static void table_lookup_or_fail( struct Scanning *ctx,
				  obj lookup_table,
				  obj failing_unit,
				  obj key_value )
{
  obj refnum;

  refnum = objecttable_lookup( lookup_table,
			       obj_hash(key_value),
			       key_value );

  if (EQ(refnum,FALSE_OBJ))
    {
      RS_LVerbose( 463, 3682, "from {%lx} found escaping {%lx}", 
                   VAL(ctx->source) ,
                   VAL(failing_unit) );
      ctx->failures = cons( failing_unit, ctx->failures );
    }
  else
    {
      an_xlated_indir( ctx, refnum );
    }
}
Esempio n. 4
0
int IRC_tripWriteBarrier( IRC_Heap *heap,
                          void *lvalue, UINT_32 offset,
                          void *rvalue )
{
    if (IRCH_WRITEPROT(lvalue)) {
        IRC_clientWriteViolation( heap, lvalue, offset );
        return 1;
    } else {
        char wbcode;

        wbcode = IRC_writeBarrierCode( heap, lvalue, rvalue );
        if (atracef) {
            fprintf( atracef,
                     "write barrier trip (%d): lvalue = %p (offset +%lu), "
                     "rvalue = %p\n",
                     wbcode,
                     lvalue, (unsigned long)offset, rvalue );
            fflush( atracef );
        }
        switch (wbcode) {
        case WB_NONE:
            /* why were we tripped? */
            break;
        case WB_COLOR:
        {
            struct IRC_Header *l = IRCH(lvalue);

            /* (note that we can't set the color
               bit in the lvalue back to WHITE, because
               then during traversal, we would crawl
               over it again (snapping it out of the
               black list an into the gray list)
               (is that the only reason?)
            */
            /* write of a pointer to a white object
               into a black (or gray) object
            */
            /* regray the lvalue */
            /* but only if it's not already being regrayed */
            if (!(l->flagBits & IRC_MASK_REGRAYQ)) {
                if (atracef) {
                    fprintf(atracef,
                            "  -- %p added to regray list\n", l);
                    fflush(atracef);
                }
                IRC_ptrListAdd( &l->sizeClass->gen->regrayObjects, l );
                l->flagBits |= IRC_MASK_REGRAYQ;
            } else {
                if (atracef) {
                    fprintf(atracef,
                            "  -- %p already in regrayed list\n",
                            IRCH(lvalue));
                    fflush(atracef);
                }
            }
        }
        return 1;
        case WB_GENERATION:
        {
            struct IRC_Header *r = IRCH(rvalue);

            /* write of a pointer to a younger object
               into an older object
            */
            /* put rvalue into the IGP list */
            RS_LVerbose( 108, 7320, "WB_GENERATION L=%p[%u] R=%p", lvalue, offset, rvalue );
            if (r->sizeClass->gen->igp_hook) {
                r->sizeClass->gen->igp_hook( r->sizeClass->gen->igp_hook_info,
                                             lvalue, offset, rvalue );
            }
        }
        return 1;
        case WB_GLOBAL:
            /* write into a global shared object */
            return 1;
        case WB_PERSISTENT:
            /* a store into a persistent object --
               record lptr as an "external possptr",
               but only if we're not overwriting a
               pointer into the same generation */
            RS_LVerbose( 108, 7340, "WB_PERSISTENT L=%p[%u] R=%p", lvalue, offset, rvalue );
            store_into_pstore( heap, lvalue, offset, rvalue );
            return 1;
        }
    }
    return 0;
}