Bug 849068 - Fix some build warnings in the StoreBuffer; r=billm

--HG--
extra : rebase_source : 3907302df2bd102314c9112055b1c6ee8f63ffd1
This commit is contained in:
Terrence Cole 2013-03-08 18:14:07 -08:00
parent e24f1978b9
commit e13e4bd331
2 changed files with 46 additions and 23 deletions

View File

@ -13,8 +13,49 @@
#include "gc/StoreBuffer.h"
#include "vm/ObjectImpl-inl.h"
using namespace js;
using namespace js::gc;
/*** SlotEdge ***/
JS_ALWAYS_INLINE HeapSlot *
StoreBuffer::SlotEdge::slotLocation() const
{
if (kind == HeapSlot::Element) {
if (offset >= object->getDenseInitializedLength())
return NULL;
return (HeapSlot *)&object->getDenseElement(offset);
}
if (offset >= object->slotSpan())
return NULL;
return &object->getSlotRef(offset);
}
JS_ALWAYS_INLINE void *
StoreBuffer::SlotEdge::deref() const
{
HeapSlot *loc = slotLocation();
return (loc && loc->isGCThing()) ? loc->toGCThing() : NULL;
}
JS_ALWAYS_INLINE void *
StoreBuffer::SlotEdge::location() const
{
return (void *)slotLocation();
}
JS_ALWAYS_INLINE bool
StoreBuffer::SlotEdge::inRememberedSet(Nursery *n) const
{
return !n->isInside(object) && n->isInside(deref());
}
JS_ALWAYS_INLINE bool
StoreBuffer::SlotEdge::isNullEdge() const
{
return !deref();
}
/*** MonoTypeBuffer ***/
template <typename T>

View File

@ -302,33 +302,15 @@ class StoreBuffer
return object != other.object || offset != other.offset || kind != other.kind;
}
HeapSlot *slotLocation() const {
if (kind == HeapSlot::Element) {
if (offset >= object->getDenseInitializedLength())
return NULL;
return (HeapSlot *)&object->getDenseElement(offset);
}
if (offset >= object->slotSpan())
return NULL;
return &object->getSlotRef(offset);
}
JS_ALWAYS_INLINE HeapSlot *slotLocation() const;
void *deref() const {
HeapSlot *loc = slotLocation();
return (loc && loc->isGCThing()) ? loc->toGCThing() : NULL;
}
JS_ALWAYS_INLINE void *deref() const;
void *location() const {
return (void *)slotLocation();
}
JS_ALWAYS_INLINE void *location() const;
bool inRememberedSet(Nursery *n) {
return !n->isInside(object) && n->isInside(deref());
}
JS_ALWAYS_INLINE bool inRememberedSet(Nursery *n) const;
bool isNullEdge() const {
return !deref();
}
JS_ALWAYS_INLINE bool isNullEdge() const;
};
MonoTypeBuffer<ValueEdge> bufferVal;