[gjs/wip/ptomato/mozjs38: 9/14] js: Set IMPLEMENTS_BARRIERS flag on traced classes



commit 0e0e9f98cf370e603ea125886c43710c8ae6dc96
Author: Philip Chimento <philip chimento gmail com>
Date:   Tue Jan 10 20:27:19 2017 -0800

    js: Set IMPLEMENTS_BARRIERS flag on traced classes
    
    I'm not sure what this flag does exactly, the documentation says it
    indicates that a class "correctly implements GC read and write barriers,"
    but in SpiderMonkey 38 it's required on all classes that have a trace
    hook.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776966

 gi/boxed.cpp       |    1 +
 gi/fundamental.cpp |    1 +
 gi/keep-alive.cpp  |    1 +
 gi/object.cpp      |    1 +
 4 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index da6eea1..f858531 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -892,6 +892,7 @@ struct JSClass gjs_boxed_class = {
     "GObject_Boxed",
     JSCLASS_HAS_PRIVATE |
     JSCLASS_NEW_RESOLVE |
+    JSCLASS_IMPLEMENTS_BARRIERS |
     JSCLASS_HAS_RESERVED_SLOTS(1),
     JS_PropertyStub,
     JS_DeletePropertyStub,
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index 56c7121..d7b3f1f 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -538,6 +538,7 @@ fundamental_trace(JSTracer *tracer,
 struct JSClass gjs_fundamental_instance_class = {
     "GFundamental_Object",
     JSCLASS_HAS_PRIVATE |
+    JSCLASS_IMPLEMENTS_BARRIERS |
     JSCLASS_NEW_RESOLVE,
     JS_PropertyStub,
     JS_DeletePropertyStub,
diff --git a/gi/keep-alive.cpp b/gi/keep-alive.cpp
index 4060935..64c3095 100644
--- a/gi/keep-alive.cpp
+++ b/gi/keep-alive.cpp
@@ -147,6 +147,7 @@ keep_alive_trace(JSTracer *tracer,
  */
 struct JSClass gjs_keep_alive_class = {
     "__private_GjsKeepAlive", /* means "new __private_GjsKeepAlive()" works */
+    JSCLASS_IMPLEMENTS_BARRIERS |
     JSCLASS_HAS_PRIVATE,
     JS_PropertyStub,
     JS_DeletePropertyStub,
diff --git a/gi/object.cpp b/gi/object.cpp
index 28e74d6..9983ee3 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1904,6 +1904,7 @@ to_string_func(JSContext *context,
 struct JSClass gjs_object_instance_class = {
     "GObject_Object",
     JSCLASS_HAS_PRIVATE |
+    JSCLASS_IMPLEMENTS_BARRIERS |
     JSCLASS_NEW_RESOLVE,
     JS_PropertyStub,
     JS_DeletePropertyStub,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]