Created
October 25, 2017 09:21
-
-
Save allstarschh/b363fb26704e26f3494f479d8486146e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/js/src/gc/StoreBuffer-inl.h b/js/src/gc/StoreBuffer-inl.h | |
index 61e93065c5a5..c43a47cde5fe 100644 | |
--- a/js/src/gc/StoreBuffer-inl.h | |
+++ b/js/src/gc/StoreBuffer-inl.h | |
@@ -69,16 +69,25 @@ StoreBuffer::putWholeCell(Cell* cell) | |
if (!cells) | |
return; | |
} | |
cells->putCell(&cell->asTenured()); | |
cells->check(); | |
} | |
+inline bool | |
+StoreBuffer::GenericBuffer::init() | |
+{ | |
+ if (!storage_) | |
+ storage_ = js_new<LifoAlloc>(LifoAllocBlockSize); | |
+ clear(); | |
+ return bool(storage_); | |
+} | |
+ | |
template <typename T> | |
void | |
StoreBuffer::GenericBuffer::put(StoreBuffer* owner, const T& t) | |
{ | |
MOZ_ASSERT(storage_); | |
/* Ensure T is derived from BufferableRef. */ | |
(void)static_cast<const BufferableRef*>(&t); | |
@@ -93,12 +102,19 @@ StoreBuffer::GenericBuffer::put(StoreBuffer* owner, const T& t) | |
T* tp = storage_->new_<T>(t); | |
if (!tp) | |
oomUnsafe.crash("Failed to allocate for GenericBuffer::put."); | |
if (isAboutToOverflow()) | |
owner->setAboutToOverflow(JS::gcreason::FULL_GENERIC_BUFFER); | |
} | |
+bool | |
+StoreBuffer::ValueEdge::maybeInRememberedSet(const Nursery& nursery) const | |
+{ | |
+ MOZ_ASSERT(IsInsideNursery(deref())); | |
+ return !nursery.isInside(edge); | |
+} | |
+ | |
} // namespace gc | |
} // namespace js | |
#endif // gc_StoreBuffer_inl_h | |
diff --git a/js/src/gc/StoreBuffer.cpp b/js/src/gc/StoreBuffer.cpp | |
index c3e93e85e535..23e8407d5dec 100644 | |
--- a/js/src/gc/StoreBuffer.cpp | |
+++ b/js/src/gc/StoreBuffer.cpp | |
@@ -17,25 +17,16 @@ | |
using namespace js; | |
using namespace js::gc; | |
StoreBuffer::GenericBuffer::~GenericBuffer() | |
{ | |
js_delete(storage_); | |
} | |
-bool | |
-StoreBuffer::GenericBuffer::init() | |
-{ | |
- if (!storage_) | |
- storage_ = js_new<LifoAlloc>(LifoAllocBlockSize); | |
- clear(); | |
- return bool(storage_); | |
-} | |
- | |
void | |
StoreBuffer::GenericBuffer::clear() | |
{ | |
if (!storage_) | |
return; | |
storage_->used() ? storage_->releaseAll() : storage_->freeAll(); | |
} | |
@@ -79,23 +70,16 @@ StoreBuffer::CellPtrEdge::maybeInRememberedSet(const Nursery& nursery) const | |
return !nursery.isInside(edge); | |
} | |
Cell* StoreBuffer::ValueEdge::deref() const | |
{ | |
return edge->isGCThing() ? static_cast<Cell*>(edge->toGCThing()) : nullptr; | |
} | |
-bool | |
-StoreBuffer::ValueEdge::maybeInRememberedSet(const Nursery& nursery) const | |
-{ | |
- MOZ_ASSERT(IsInsideNursery(deref())); | |
- return !nursery.isInside(edge); | |
-} | |
- | |
bool | |
StoreBuffer::enable() | |
{ | |
if (enabled_) | |
return true; | |
if (!bufferVal.init() || | |
!bufferCell.init() || | |
diff --git a/js/src/gc/StoreBuffer.h b/js/src/gc/StoreBuffer.h | |
index 9aff6ae49f50..3b5c78fea19a 100644 | |
--- a/js/src/gc/StoreBuffer.h | |
+++ b/js/src/gc/StoreBuffer.h | |
@@ -154,17 +154,17 @@ class StoreBuffer | |
struct GenericBuffer | |
{ | |
LifoAlloc* storage_; | |
explicit GenericBuffer() : storage_(nullptr) {} | |
~GenericBuffer(); | |
- MOZ_MUST_USE bool init(); | |
+ inline MOZ_MUST_USE bool init(); | |
void clear(); | |
bool isAboutToOverflow() const; | |
/* Trace all generic edges. */ | |
void trace(StoreBuffer* owner, JSTracer* trc); | |
@@ -191,17 +191,17 @@ class StoreBuffer | |
{ | |
Cell** edge; | |
CellPtrEdge() : edge(nullptr) {} | |
explicit CellPtrEdge(Cell** v) : edge(v) {} | |
bool operator==(const CellPtrEdge& other) const { return edge == other.edge; } | |
bool operator!=(const CellPtrEdge& other) const { return edge != other.edge; } | |
- bool maybeInRememberedSet(const Nursery& nursery) const; | |
+ inline bool maybeInRememberedSet(const Nursery& nursery) const; | |
void trace(TenuringTracer& mover) const; | |
CellPtrEdge tagged() const { return CellPtrEdge((Cell**)(uintptr_t(edge) | 1)); } | |
CellPtrEdge untagged() const { return CellPtrEdge((Cell**)(uintptr_t(edge) & ~1)); } | |
bool isTagged() const { return bool(uintptr_t(edge) & 1); } | |
explicit operator bool() const { return edge != nullptr; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In file included from /home/allstars/src/gecko-dev/js/src/gc/Barrier.h:13:0,
0:02.45 from /home/allstars/src/gecko-dev/js/src/vm/String.h:18,
0:02.45 from /home/allstars/src/gecko-dev/js/src/ctypes/CTypes.h:21,
0:02.45 from /home/allstars/src/gecko-dev/js/src/ctypes/Library.cpp:12:
0:02.45 /home/allstars/src/gecko-dev/js/src/gc/StoreBuffer.h:199:21: warning: inline function ‘bool js::gc::StoreBuffer::CellPtrEdge::maybeInRememberedSet(const js::Nursery&) const’ used but never defined
0:02.45 inline bool maybeInRememberedSet(const Nursery& nursery) const;