diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h index 2ecb7e9122a8..43a4dfd619fa 100644 --- a/js/src/gc/Heap.h +++ b/js/src/gc/Heap.h @@ -261,6 +261,8 @@ struct Cell // May be overridden by GC thing kinds that have a compartment pointer. inline JSCompartment* maybeCompartment() const { return nullptr; } + // The StoreBuffer used to record incoming pointers from the tenured heap. + // This will return nullptr for a tenured cell. inline StoreBuffer* storeBuffer() const; inline JS::TraceKind getTraceKind() const; @@ -769,25 +771,26 @@ FreeSpan::checkRange(uintptr_t first, uintptr_t last, const Arena* arena) const */ struct ChunkTrailer { - /* Construct a Nursery ChunkTrailer. */ + // Construct a Nursery ChunkTrailer. ChunkTrailer(JSRuntime* rt, StoreBuffer* sb) : location(ChunkLocation::Nursery), storeBuffer(sb), runtime(rt) {} - /* Construct a Tenured heap ChunkTrailer. */ + // Construct a Tenured heap ChunkTrailer. explicit ChunkTrailer(JSRuntime* rt) : location(ChunkLocation::TenuredHeap), storeBuffer(nullptr), runtime(rt) {} public: - /* The index the chunk in the nursery, or LocationTenuredHeap. */ + // The index of the chunk in the nursery, or LocationTenuredHeap. ChunkLocation location; uint32_t padding; - /* The store buffer for writes to things in this chunk or nullptr. */ + // The store buffer for pointers from tenured things to things in this + // chunk. Will be non-null only for nursery chunks. StoreBuffer* storeBuffer; - /* This provides quick access to the runtime from absolutely anywhere. */ + // Provide quick access to the runtime from absolutely anywhere. JSRuntime* runtime; }; diff --git a/js/src/gc/Statistics.h b/js/src/gc/Statistics.h index 7f7423d158f9..6325ffd55c75 100644 --- a/js/src/gc/Statistics.h +++ b/js/src/gc/Statistics.h @@ -333,13 +333,13 @@ struct Statistics SliceRange sliceRange() const { return slices.all(); } size_t slicesLength() const { return slices.length(); } - /* Occasionally print header lines for profiling information. */ + // Occasionally print header lines for profiling information. void maybePrintProfileHeaders(); - /* Print header line for profile times. */ + // Print header line for profile times. void printProfileHeader(); - /* Print total profile times on shutdown. */ + // Print total profile times on shutdown. void printTotalProfileTimes(); private: diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 4855b5655cc2..edee272f81bf 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -670,7 +670,8 @@ JSObject::writeBarrierPost(void* cellp, JSObject* prev, JSObject* next) return; } - // Remove the prev entry if the new value does not need it. + // Remove the prev entry if the new value does not need it. There will only + // be a prev entry if the prev value was in the nursery. if (prev && (buffer = prev->storeBuffer())) buffer->unputCell(static_cast(cellp)); }