From 06bb27de7fc2d767ecb38b9fdc4667ef9ded9a17 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Mon, 23 Jun 2014 12:36:36 -0700 Subject: [PATCH] Bug 1028358; r=jonco --HG-- extra : rebase_source : 41cf1eaa104bf386c77777be906236d1d15a2622 --- js/public/RootingAPI.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h index 835d6115dd03..da622604bce6 100644 --- a/js/public/RootingAPI.h +++ b/js/public/RootingAPI.h @@ -681,6 +681,24 @@ struct GCMethods #endif }; +template <> +struct GCMethods +{ + static JSFunction *initial() { return nullptr; } + static bool poisoned(JSFunction *v) { return JS::IsPoisonedPtr(v); } + static bool needsPostBarrier(JSFunction *v) { + return v != nullptr && gc::IsInsideNursery(reinterpret_cast(v)); + } +#ifdef JSGC_GENERATIONAL + static void postBarrier(JSFunction **vp) { + JS::HeapCellPostBarrier(reinterpret_cast(vp)); + } + static void relocate(JSFunction **vp) { + JS::HeapCellRelocate(reinterpret_cast(vp)); + } +#endif +}; + #ifdef JS_DEBUG /* This helper allows us to assert that Rooted is scoped within a request. */ extern JS_PUBLIC_API(bool)