diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h index 4f04ace8a66..aa866f5fc36 100644 --- a/js/src/gc/Heap.h +++ b/js/src/gc/Heap.h @@ -99,6 +99,7 @@ struct Cell inline JSRuntime *runtime() const; inline Zone *tenuredZone() const; + inline bool tenuredIsInsideZone(Zone *zone) const; #ifdef DEBUG inline bool isAligned() const; @@ -994,6 +995,13 @@ Cell::tenuredZone() const return arenaHeader()->zone; } +bool +Cell::tenuredIsInsideZone(Zone *zone) const +{ + JS_ASSERT(isTenured()); + return zone == arenaHeader()->zone; +} + #ifdef DEBUG bool Cell::isAligned() const diff --git a/js/src/vm/String.h b/js/src/vm/String.h index 0f7e3b7e57f..4247beec6a0 100644 --- a/js/src/vm/String.h +++ b/js/src/vm/String.h @@ -410,7 +410,7 @@ class JSString : public js::gc::Cell } JS::Zone *zone() const { return tenuredZone(); } - bool isInsideZone(JS::Zone *zone_) { return zone_ == zone(); } + bool isInsideZone(JS::Zone *zone_) { return tenuredIsInsideZone(zone_); } js::gc::AllocKind getAllocKind() const { return tenuredGetAllocKind(); } static inline void writeBarrierPre(JSString *str);