Bug 1515993 - Extend linear time weak map marking to LazyScripts r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 03 Jan 2019 09:41:57 +0000
changeset 509498 93bc74cb72cfcf00b16eea08baa9187c3375e74d
parent 509449 ddcafa982f12249adf76768ddd0d591f378bcf3d
child 509499 2f619be4479861b2cf0781e8376fda79044920ef
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1515993
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1515993 - Extend linear time weak map marking to LazyScripts r=sfink
js/src/gc/Marking.cpp
js/src/jit-test/tests/gc/bug-1515993.js
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -620,16 +620,21 @@ struct ImplicitEdgeHolderType<JSObject*>
   typedef JSObject* Type;
 };
 
 template <>
 struct ImplicitEdgeHolderType<JSScript*> {
   typedef JSScript* Type;
 };
 
+template <>
+struct ImplicitEdgeHolderType<LazyScript*> {
+  typedef LazyScript* Type;
+};
+
 void GCMarker::markEphemeronValues(gc::Cell* markedCell,
                                    WeakEntryVector& values) {
   DebugOnly<size_t> initialLen = values.length();
 
   for (const auto& markable : values) {
     if (color == gc::MarkColor::Black &&
         markable.weakmap->markColor == gc::MarkColor::Gray) {
       continue;
@@ -833,16 +838,17 @@ void js::GCMarker::markAndScan(T* thing)
 namespace js {
 template <>
 void GCMarker::traverse(JSString* thing) {
   markAndScan(thing);
 }
 template <>
 void GCMarker::traverse(LazyScript* thing) {
   markAndScan(thing);
+  markImplicitEdges(thing);
 }
 template <>
 void GCMarker::traverse(Shape* thing) {
   markAndScan(thing);
 }
 template <>
 void GCMarker::traverse(js::Scope* thing) {
   markAndScan(thing);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/gc/bug-1515993.js
@@ -0,0 +1,13 @@
+function checkGetOffsetsCoverage() {
+    var g = newGlobal();
+    var dbg = Debugger(g);
+    var topLevel;
+    dbg.onNewScript = function(s) {
+        topLevel = s;
+    };
+    g.eval(`import(() => 1)`);
+    topLevel.getChildScripts();
+}
+checkGetOffsetsCoverage();
+gczeal(14, 10);
+Object.defineProperty(this, "fuzzutils", {});