mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-06 00:10:25 +00:00
Bug 995442 - Don't post-barrier non-objects in the browser; r=sfink
This commit is contained in:
parent
0524b56789
commit
ef5f219fda
@ -652,12 +652,25 @@ struct GCMethods<T *>
|
||||
static T *initial() { return nullptr; }
|
||||
static ThingRootKind kind() { return RootKind<T *>::rootKind(); }
|
||||
static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); }
|
||||
static bool needsPostBarrier(T *v) { return v; }
|
||||
static bool needsPostBarrier(T *v) { return false; }
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
static void postBarrier(T **vp) {
|
||||
static void postBarrier(T **vp) {}
|
||||
static void relocate(T **vp) {}
|
||||
#endif
|
||||
};
|
||||
|
||||
template <>
|
||||
struct GCMethods<JSObject *>
|
||||
{
|
||||
static JSObject *initial() { return nullptr; }
|
||||
static ThingRootKind kind() { return RootKind<JSObject *>::rootKind(); }
|
||||
static bool poisoned(JSObject *v) { return JS::IsPoisonedPtr(v); }
|
||||
static bool needsPostBarrier(JSObject *v) { return v; }
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
static void postBarrier(JSObject **vp) {
|
||||
JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));
|
||||
}
|
||||
static void relocate(T **vp) {
|
||||
static void relocate(JSObject **vp) {
|
||||
JS::HeapCellRelocate(reinterpret_cast<js::gc::Cell **>(vp));
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user