Skip to content

Commit

Permalink
WIP: possible fix
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Aug 22, 2024
1 parent af1314c commit aa468af
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions packages/swingset-liveslots/src/liveslots.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,19 +284,31 @@ function build(

for (const vref of possiblyRetiredSet) {
// eslint-disable-next-line no-use-before-define
if (!getValForSlot(vref) && !deadSet.has(vref)) {
// Don't retire things that haven't yet made the transition to dead,
// i.e., always drop before retiring
// eslint-disable-next-line no-use-before-define
if (!vrm.isVrefRecognizable(vref)) {
importsToRetire.add(vref);
if (getValForSlot(vref)) {
continue; // reachable by RAM pillar inhibits retirement
}
const { virtual, durable, allocatedByVat, type } = parseVatSlot(vref);
if (type !== 'object') {
continue; // we only retire objects
}
if (!virtual && !durable && !allocatedByVat) {
if (vrm.isPresenceReachable(vref)) {

Check failure on line 295 in packages/swingset-liveslots/src/liveslots.js

View workflow job for this annotation

GitHub Actions / lint-rest

'vrm' was used before it was defined
continue; // reachable by vdata pillar inhibits retirement
}
}
// TODO: what was the deadSet check for? it wasn't sufficient.
// if (deadSet.has(vref)) {
// continue;
// }
if (!vrm.isVrefRecognizable(vref)) {

Check failure on line 303 in packages/swingset-liveslots/src/liveslots.js

View workflow job for this annotation

GitHub Actions / lint-rest

'vrm' was used before it was defined
importsToRetire.add(vref);
}
}
possiblyRetiredSet.clear();

const deadBaseRefs = Array.from(deadSet);
deadBaseRefs.sort();
console.log(`== sFDO scanning deadBaseRefs`, deadBaseRefs);
for (const baseRef of deadBaseRefs) {
const { virtual, durable, allocatedByVat, type } =
parseVatSlot(baseRef);
Expand Down

0 comments on commit aa468af

Please sign in to comment.