Building Slate VM with Microsoft Visual C++ under Windows XP

Brian T. Rice water at tunes.org
Thu Jul 22 08:44:37 PDT 2004


> > ObjectPointer PSObjectHeap_remapOop_(struct ObjectHeap
> > * oh, ObjectPointer oop)
> > {
> >   unsigned long int pivot;
> >   unsigned long int low;
> >   unsigned long int high;
> >   unsigned long int idx; // JJN: new
> > 
> >   low = 0;
> >   high = oh->breakTableSize - 1;
> >   pivot = (low + high) / 2;
> >   while ((high - low) > 1)
> >   {
> >     if (oop < ((oh->breakTable)[pivot]).oldAddress)
> >       high = pivot - 1;
> >     else
> >       low = pivot;
> >     pivot = (low + high) / 2;
> >   }
> >   idx = pivot + 1;
> >   if (idx > (oh->breakTableSize - 1)) // JJN: new
> >    idx = (oh->breakTableSize - 1); // JJN: new
> > //  if (oop >= ((oh->breakTable)[pivot +
> > 1]).oldAddress) // JJN: replaced below
> >   if (oop >= ((oh->breakTable)[idx]).oldAddress) //
> > JJN: modified
> >     pivot = pivot + 1;
> >   if (pivot > (oh->breakTableSize - 1)) // JJN: new
> >    pivot = (oh->breakTableSize - 1); // JJN: new
> >   return (oop - ((oh->breakTable)[pivot]).oldAddress)
> > + ((oh->breakTable)[pivot]).newAddress;
> > }

This is a correct analysis and fix as far as I can see. Note that the source
for this function is in bootstrap/mobius/vm/mark-compact.slate. Lee needs to
have a look before it's committed, though.




More information about the Slate mailing list