mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 849536 - Make GetGCThingTraceKind work for Nursery things; r=billm
--HG-- extra : rebase_source : f13dffb79a041292b3a2b283927d4ca8bdda2dcf
This commit is contained in:
parent
95af7822f7
commit
6a424f90bd
@ -27,7 +27,7 @@ namespace gc {
|
||||
*/
|
||||
class VerifierNursery
|
||||
{
|
||||
HashSet<void*, PointerHasher<void*, 3>, SystemAllocPolicy> nursery;
|
||||
HashSet<const void *, PointerHasher<const void *, 3>, SystemAllocPolicy> nursery;
|
||||
|
||||
public:
|
||||
VerifierNursery() : nursery() {}
|
||||
@ -53,7 +53,7 @@ class VerifierNursery
|
||||
return enable();
|
||||
}
|
||||
|
||||
bool isInside(void *cell) const {
|
||||
bool isInside(const void *cell) const {
|
||||
JS_ASSERT((uintptr_t(cell) & 0x3) == 0);
|
||||
return nursery.initialized() && nursery.has(cell);
|
||||
}
|
||||
|
@ -48,14 +48,6 @@ struct AutoMarkInDeadZone
|
||||
|
||||
namespace gc {
|
||||
|
||||
inline JSGCTraceKind
|
||||
GetGCThingTraceKind(const void *thing)
|
||||
{
|
||||
JS_ASSERT(thing);
|
||||
const Cell *cell = reinterpret_cast<const Cell *>(thing);
|
||||
return MapAllocToTraceKind(cell->getAllocKind());
|
||||
}
|
||||
|
||||
/* Capacity for slotsToThingKind */
|
||||
const size_t SLOTS_TO_THING_KIND_LIMIT = 17;
|
||||
|
||||
@ -191,7 +183,7 @@ ShouldNurseryAllocate(const NurseryType &nursery, AllocKind kind, InitialHeap he
|
||||
#endif
|
||||
|
||||
inline bool
|
||||
IsInsideNursery(JSRuntime *rt, void *thing)
|
||||
IsInsideNursery(JSRuntime *rt, const void *thing)
|
||||
{
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
#if JS_GC_ZEAL
|
||||
@ -202,6 +194,18 @@ IsInsideNursery(JSRuntime *rt, void *thing)
|
||||
return false;
|
||||
}
|
||||
|
||||
inline JSGCTraceKind
|
||||
GetGCThingTraceKind(const void *thing)
|
||||
{
|
||||
JS_ASSERT(thing);
|
||||
const Cell *cell = static_cast<const Cell *>(thing);
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
if (IsInsideNursery(cell->runtime(), cell))
|
||||
return JSTRACE_OBJECT;
|
||||
#endif
|
||||
return MapAllocToTraceKind(cell->getAllocKind());
|
||||
}
|
||||
|
||||
static inline void
|
||||
GCPoke(JSRuntime *rt)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user