From e13e4bd331f866ecc37dc7e75b7a4476b656b00b Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Fri, 8 Mar 2013 18:14:07 -0800 Subject: [PATCH] Bug 849068 - Fix some build warnings in the StoreBuffer; r=billm --HG-- extra : rebase_source : 3907302df2bd102314c9112055b1c6ee8f63ffd1 --- js/src/gc/StoreBuffer.cpp | 41 +++++++++++++++++++++++++++++++++++++++ js/src/gc/StoreBuffer.h | 28 +++++--------------------- 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/js/src/gc/StoreBuffer.cpp b/js/src/gc/StoreBuffer.cpp index 63951066a01..e2f305e4db6 100644 --- a/js/src/gc/StoreBuffer.cpp +++ b/js/src/gc/StoreBuffer.cpp @@ -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 diff --git a/js/src/gc/StoreBuffer.h b/js/src/gc/StoreBuffer.h index 1e6e157acb4..89ec0b64ef2 100644 --- a/js/src/gc/StoreBuffer.h +++ b/js/src/gc/StoreBuffer.h @@ -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 bufferVal;