diff options
author | Moonchild <mcwerewolf@wolfbeast.com> | 2019-04-30 14:11:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-30 14:11:17 +0000 |
commit | 871b926f635836d6a187534f6a6ad5b2bb30b27d (patch) | |
tree | 41f206fe01772ea8ed4379070e88ef94381599c8 /js/src/jswatchpoint.cpp | |
parent | cd296c598a587b58a0e2a579c9be5aa255669829 (diff) | |
parent | 2ec2389d7f887d263b76e43af1d40e8b529db40e (diff) | |
download | UXP-871b926f635836d6a187534f6a6ad5b2bb30b27d.tar UXP-871b926f635836d6a187534f6a6ad5b2bb30b27d.tar.gz UXP-871b926f635836d6a187534f6a6ad5b2bb30b27d.tar.lz UXP-871b926f635836d6a187534f6a6ad5b2bb30b27d.tar.xz UXP-871b926f635836d6a187534f6a6ad5b2bb30b27d.zip |
Merge pull request #1065 from win7-7/Improve-dead-compartment-collection
Improve dead compartment collection
Diffstat (limited to 'js/src/jswatchpoint.cpp')
-rw-r--r-- | js/src/jswatchpoint.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/js/src/jswatchpoint.cpp b/js/src/jswatchpoint.cpp index 3cf43e219..e37323555 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)); } } |