diff --git a/js/src/gc/Barrier-inl.h b/js/src/gc/Barrier-inl.h index 39ecb83f5c15..c952e4dd7418 100644 --- a/js/src/gc/Barrier-inl.h +++ b/js/src/gc/Barrier-inl.h @@ -166,23 +166,29 @@ HeapValue::set(JSCompartment *comp, const Value &v) } inline void -HeapValue::writeBarrierPost(const Value &value, void *addr) +HeapValue::writeBarrierPost(const Value &value, Value *addr) { +#ifdef JSGC_GENERATIONAL +#endif } inline void -HeapValue::writeBarrierPost(JSCompartment *comp, const Value &value, void *addr) +HeapValue::writeBarrierPost(JSCompartment *comp, const Value &value, Value *addr) { +#ifdef JSGC_GENERATIONAL +#endif } inline void HeapValue::post() { + writeBarrierPost(value, &value); } inline void HeapValue::post(JSCompartment *comp) { + writeBarrierPost(comp, value, &value); } inline @@ -196,6 +202,7 @@ RelocatableValue::RelocatableValue(const Value &v) : EncapsulatedValue(v) { JS_ASSERT(!IsPoisonedValue(v)); + post(); } inline @@ -203,12 +210,14 @@ RelocatableValue::RelocatableValue(const RelocatableValue &v) : EncapsulatedValue(v.value) { JS_ASSERT(!IsPoisonedValue(v.value)); + post(); } inline RelocatableValue::~RelocatableValue() { pre(); + relocate(); } inline RelocatableValue & @@ -217,6 +226,7 @@ RelocatableValue::operator=(const Value &v) pre(); JS_ASSERT(!IsPoisonedValue(v)); value = v; + post(); return *this; } @@ -226,9 +236,31 @@ RelocatableValue::operator=(const RelocatableValue &v) pre(); JS_ASSERT(!IsPoisonedValue(v.value)); value = v.value; + post(); return *this; } +inline void +RelocatableValue::post() +{ +#ifdef JSGC_GENERATIONAL +#endif +} + +inline void +RelocatableValue::post(JSCompartment *comp) +{ +#ifdef JSGC_GENERATIONAL +#endif +} + +inline void +RelocatableValue::relocate() +{ +#ifdef JSGC_GENERATIONAL +#endif +} + inline HeapSlot::HeapSlot(JSObject *obj, uint32_t slot, const Value &v) : EncapsulatedValue(v) diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index 6bb104e95603..61337e18afd1 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -357,8 +357,8 @@ class HeapValue : public EncapsulatedValue */ inline void set(JSCompartment *comp, const Value &v); - static inline void writeBarrierPost(const Value &v, void *addr); - static inline void writeBarrierPost(JSCompartment *comp, const Value &v, void *addr); + static inline void writeBarrierPost(const Value &v, Value *addr); + static inline void writeBarrierPost(JSCompartment *comp, const Value &v, Value *addr); private: inline void post(); @@ -375,6 +375,14 @@ class RelocatableValue : public EncapsulatedValue inline RelocatableValue &operator=(const Value &v); inline RelocatableValue &operator=(const RelocatableValue &v); + + static inline void writeBarrierPost(const Value &v, Value *addr); + static inline void writeBarrierPost(JSCompartment *comp, const Value &v, Value *addr); + + private: + inline void post(); + inline void post(JSCompartment *comp); + inline void relocate(); }; class HeapSlot : public EncapsulatedValue