[gjs/mozjs78: 10/23] Disable unresolvable cache. - Causes tracing to break when the PropertyKey type is traced.



commit c8594c14180eedb950c2daa89002d3775775b75c
Author: Evan Welsh <noreply evanwelsh com>
Date:   Sat Jul 4 22:12:03 2020 -0500

    Disable unresolvable cache.
    - Causes tracing to break when the PropertyKey type is traced.

 gi/object.cpp | 18 +++++++++---------
 gi/object.h   |  3 ++-
 2 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/gi/object.cpp b/gi/object.cpp
index c1173fba..2ee5b0b2 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -779,18 +779,18 @@ bool ObjectBase::id_is_never_lazy(jsid name, const GjsAtoms& atoms) {
 bool ObjectPrototype::resolve_impl(JSContext* context, JS::HandleObject obj,
                                    JS::HandleId id, const char* name,
                                    bool* resolved) {
-    if (m_unresolvable_cache.has(id)) {
-        *resolved = false;
-        return true;
-    }
+    // if (m_unresolvable_cache.has(id)) {
+    //     *resolved = false;
+    //     return true;
+    // }
 
     if (!uncached_resolve(context, obj, id, name, resolved))
         return false;
 
-    if (!*resolved && !m_unresolvable_cache.putNew(id)) {
-        JS_ReportOutOfMemory(context);
-        return false;
-    }
+    // if (!*resolved && !m_unresolvable_cache.putNew(id)) {
+    //     JS_ReportOutOfMemory(context);
+    //     return false;
+    // }
 
     return true;
 }
@@ -1624,7 +1624,7 @@ void ObjectInstance::trace_impl(JSTracer* tracer) {
 void ObjectPrototype::trace_impl(JSTracer* tracer) {
     m_property_cache.trace(tracer);
     m_field_cache.trace(tracer);
-    m_unresolvable_cache.trace(tracer);
+    // m_unresolvable_cache.trace(tracer);
     for (GClosure* closure : m_vfuncs)
         gjs_closure_trace(closure, tracer);
 }
diff --git a/gi/object.h b/gi/object.h
index 55fa30ed..ead00eb3 100644
--- a/gi/object.h
+++ b/gi/object.h
@@ -227,7 +227,8 @@ class ObjectPrototype
 
     PropertyCache m_property_cache;
     FieldCache m_field_cache;
-    NegativeLookupCache m_unresolvable_cache;
+    // FIXME(mozjs78): Crashes on GC
+    // NegativeLookupCache m_unresolvable_cache;
     // a list of vfunc GClosures installed on this prototype, used when tracing
     std::forward_list<GClosure*> m_vfuncs;
 


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