summaryrefslogtreecommitdiffstats
path: root/js/src/jswatchpoint.cpp
diff options
context:
space:
mode:
authorwin7-7 <win7-7@users.noreply.github.com>2019-04-29 11:59:46 +0300
committerGitHub <noreply@github.com>2019-04-29 11:59:46 +0300
commit5a65d8739d0ad6ef446b278a25fd955f0c734fb1 (patch)
tree6a947b3ad89ee96f62c9a814e93070356162819f /js/src/jswatchpoint.cpp
parentcd296c598a587b58a0e2a579c9be5aa255669829 (diff)
downloadUXP-5a65d8739d0ad6ef446b278a25fd955f0c734fb1.tar
UXP-5a65d8739d0ad6ef446b278a25fd955f0c734fb1.tar.gz
UXP-5a65d8739d0ad6ef446b278a25fd955f0c734fb1.tar.lz
UXP-5a65d8739d0ad6ef446b278a25fd955f0c734fb1.tar.xz
UXP-5a65d8739d0ad6ef446b278a25fd955f0c734fb1.zip
Improve dead compartment collection js/src
Diffstat (limited to 'js/src/jswatchpoint.cpp')
-rw-r--r--js/src/jswatchpoint.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/js/src/jswatchpoint.cpp b/js/src/jswatchpoint.cpp
index 3cf43e219..68afa4a59 100644
--- a/js/src/jswatchpoint.cpp
+++ b/js/src/jswatchpoint.cpp
@@ -185,17 +185,18 @@ WatchpointMap::markAll(JSTracer* trc)
{
for (Map::Enum e(map); !e.empty(); e.popFront()) {
Map::Entry& entry = e.front();
- WatchKey key = entry.key();
- WatchKey prior = key;
- MOZ_ASSERT(JSID_IS_STRING(prior.id) || JSID_IS_INT(prior.id) || JSID_IS_SYMBOL(prior.id));
-
- TraceEdge(trc, const_cast<PreBarrieredObject*>(&key.object),
- "held Watchpoint object");
- TraceEdge(trc, const_cast<PreBarrieredId*>(&key.id), "WatchKey::id");
+ JSObject* object = entry.key().object;
+ jsid id = entry.key().id;
+ JSObject* priorObject = object;
+ jsid priorId = id;
+ MOZ_ASSERT(JSID_IS_STRING(priorId) || JSID_IS_INT(priorId) || JSID_IS_SYMBOL(priorId));
+
+ TraceManuallyBarrieredEdge(trc, &object, "held Watchpoint object");
+ TraceManuallyBarrieredEdge(trc, &id, "WatchKey::id");
TraceEdge(trc, &entry.value().closure, "Watchpoint::closure");
- if (prior.object != key.object || prior.id != key.id)
- e.rekeyFront(key);
+ if (priorObject != object || priorId != id)
+ e.rekeyFront(WatchKey(object, id));
}
}
@@ -242,4 +243,4 @@ WatchpointMap::trace(WeakMapTracer* trc)
JS::GCCellPtr(entry.key().object.get()),
JS::GCCellPtr(entry.value().closure.get()));
}
-}
+} \ No newline at end of file