Bug 753931 - Add specialized post barriers to RelocatableValue; r=billm

This inserts stubs for GenerationalGC relocation barriers into the specialized
"Relocatable" HeapValue.
This commit is contained in:
Terrence Cole 2012-05-10 11:38:39 -07:00
Родитель e073e78092
Коммит 0ff66b2175
2 изменённых файлов: 44 добавлений и 4 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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