diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2017-05-01 22:30:16 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2017-07-09 11:41:33 -0700 |
commit | a3d22db2918ba1a849afb5f567d2952505c5f851 (patch) | |
tree | bbe42b723ac9086f97e92066e62cebbc4008d540 /gjs/jsapi-util-root.h | |
parent | 4a477b1f53ac980867f18cd9776691b2891c90b0 (diff) | |
download | gjs-a3d22db2918ba1a849afb5f567d2952505c5f851.tar.gz |
js: Adapt to new JS::TraceEdge<T> API
Replacing the old JS_CallFooTracer() API is a new C++ JS::TraceEdge<T>()
function. It works the same, but is templated. The old API will be going
away in SpiderMonkey 52.
https://bugzilla.gnome.org/show_bug.cgi?id=784196
Diffstat (limited to 'gjs/jsapi-util-root.h')
-rw-r--r-- | gjs/jsapi-util-root.h | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/gjs/jsapi-util-root.h b/gjs/jsapi-util-root.h index 543f5373..ab316520 100644 --- a/gjs/jsapi-util-root.h +++ b/gjs/jsapi-util-root.h @@ -66,23 +66,11 @@ */ template<typename T> struct GjsHeapOperation { - static void trace(JSTracer *tracer, - JS::Heap<T> *thing, - const char *name); - static bool update_after_gc(JS::Heap<T> *location); }; template<> struct GjsHeapOperation<JSObject *> { - static void - trace(JSTracer *tracer, - JS::Heap<JSObject *> *thing, - const char *name) - { - JS_CallObjectTracer(tracer, thing, name); - } - static bool update_after_gc(JS::Heap<JSObject *> *location) { @@ -92,15 +80,7 @@ struct GjsHeapOperation<JSObject *> { }; template<> -struct GjsHeapOperation<JS::Value> { - static void - trace(JSTracer *tracer, - JS::Heap<JS::Value> *thing, - const char *name) - { - JS_CallValueTracer(tracer, thing, name); - } -}; +struct GjsHeapOperation<JS::Value> {}; /* GjsMaybeOwned is intended only for use in heap allocation. Do not allocate it * on the stack, and do not allocate any instances of structures that have it as @@ -316,7 +296,7 @@ public: { debug("trace()"); g_assert(!m_rooted); - GjsHeapOperation<T>::trace(tracer, &m_heap, name); + JS::TraceEdge<T>(tracer, &m_heap, name); } /* If not tracing, then you must call this method during GC in order to |