From 0adfbe6015f158713cd266e4a3bd76ffff7f74b0 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Mon, 19 May 2014 14:58:05 -0700 Subject: [PATCH] Bug 1105069 - Part 4: Convert IsIncrementalReferenceBarrierNeededTenuredGCThing to GCCellPtr; r=jonco --HG-- extra : rebase_source : b8b403745c98ec09e29340aa74a801bd633f0483 --- js/public/GCAPI.h | 4 ++-- js/public/HeapAPI.h | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/js/public/GCAPI.h b/js/public/GCAPI.h index c7c9c5a72032..f9a6945acc04 100644 --- a/js/public/GCAPI.h +++ b/js/public/GCAPI.h @@ -493,7 +493,7 @@ ExposeGCThingToActiveJS(JS::GCCellPtr thing) if (IsInsideNursery(thing)) return; #endif - if (JS::IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing, thing.kind())) + if (IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing)) JS::IncrementalReferenceBarrier(thing, thing.kind()); else if (JS::GCThingIsMarkedGray(thing)) JS::UnmarkGrayGCThingRecursively(thing, thing.kind()); @@ -536,7 +536,7 @@ MarkGCThingAsLive(JSRuntime *rt_, void *thing, JSGCTraceKind kind) if (js::gc::IsInsideNursery((js::gc::Cell *)thing)) return; #endif - if (IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing, kind)) + if (js::gc::IsIncrementalBarrierNeededOnTenuredGCThing(rt, GCCellPtr(thing, kind))) IncrementalReferenceBarrier(thing, kind); } diff --git a/js/public/HeapAPI.h b/js/public/HeapAPI.h index 9a754653812a..2c2bf6a0f909 100644 --- a/js/public/HeapAPI.h +++ b/js/public/HeapAPI.h @@ -342,7 +342,6 @@ IsInsideNursery(const js::gc::Cell *cell) } } /* namespace gc */ - } /* namespace js */ namespace JS { @@ -378,19 +377,25 @@ GCThingIsMarkedGray(void *thing) return *word & mask; } +} /* namespace JS */ + +namespace js { +namespace gc { + static MOZ_ALWAYS_INLINE bool -IsIncrementalBarrierNeededOnTenuredGCThing(shadow::Runtime *rt, void *thing, JSGCTraceKind kind) +IsIncrementalBarrierNeededOnTenuredGCThing(JS::shadow::Runtime *rt, const JS::GCCellPtr thing) { MOZ_ASSERT(thing); #ifdef JSGC_GENERATIONAL - MOZ_ASSERT(!js::gc::IsInsideNursery((js::gc::Cell *)thing)); + MOZ_ASSERT(!js::gc::IsInsideNursery(thing)); #endif if (!rt->needsIncrementalBarrier()) return false; - JS::Zone *zone = GetTenuredGCThingZone(thing); - return reinterpret_cast(zone)->needsIncrementalBarrier(); + JS::Zone *zone = JS::GetTenuredGCThingZone(thing); + return JS::shadow::Zone::asShadowZone(zone)->needsIncrementalBarrier(); } -} /* namespace JS */ +} /* namespace gc */ +} /* namespace js */ #endif /* js_HeapAPI_h */