Skip to content

Commit c9faf9c

Browse files
committed
fix: fake VOM bitrot
Closes #4591
1 parent dba86ff commit c9faf9c

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

packages/SwingSet/src/kernel/virtualObjectManager.js

-6
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,6 @@ export function makeCache(size, fetch, store) {
168168
* instances, writing any changed state to the persistent store. This
169169
* provided for testing; it otherwise has little use.
170170
*
171-
* - `makeVirtualObjectRepresentative` will provide a useeable, in-memory
172-
* version of a virtual object, given its vat slot ID. This is used when
173-
* deserializing a reference to an object that has been received in a message
174-
* or is part of the persistent state of another virtual object that is being
175-
* swapped in from storage.
176-
*
177171
* `makeKind` and `makeDurableKind` are made available to user vat code in the
178172
* `VatData` global. The other two methods are for internal use by liveslots.
179173
*/

packages/SwingSet/tools/fakeVirtualObjectManager.js

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export function makeFakeVirtualObjectManager(vrm, fakeStuff, options = {}) {
1919
makeDurableKind,
2020
VirtualObjectAwareWeakMap,
2121
VirtualObjectAwareWeakSet,
22-
makeVirtualObjectRepresentative,
2322
flushCache,
2423
} = makeVirtualObjectManager(
2524
fakeStuff.syscall,
@@ -37,7 +36,6 @@ export function makeFakeVirtualObjectManager(vrm, fakeStuff, options = {}) {
3736
makeDurableKind,
3837
VirtualObjectAwareWeakMap,
3938
VirtualObjectAwareWeakSet,
40-
makeVirtualObjectRepresentative,
4139
};
4240

4341
const debugTools = {

packages/SwingSet/tools/fakeVirtualSupport.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class FakeFinalizationRegistry {
1919
}
2020

2121
export function makeFakeLiveSlotsStuff(options = {}) {
22-
let vom;
23-
function setVom(vomToUse) {
24-
assert(!vom, 'vom already configured');
25-
vom = vomToUse;
22+
let vrm;
23+
function setVrm(vrmToUse) {
24+
assert(!vrm, 'vrm already configured');
25+
vrm = vrmToUse;
2626
}
2727

2828
const {
@@ -174,10 +174,10 @@ export function makeFakeLiveSlotsStuff(options = {}) {
174174
const { type, virtual } = parseVatSlot(slot);
175175
assert.equal(type, 'object');
176176
if (virtual) {
177-
if (vom) {
178-
return vom.makeVirtualObjectRepresentative(slot);
177+
if (vrm) {
178+
return vrm.reanimate(slot, false);
179179
} else {
180-
assert.fail('fake liveSlots stuff configured without vom');
180+
assert.fail('fake liveSlots stuff configured without vrm');
181181
}
182182
} else {
183183
return getValForSlot(slot);
@@ -216,7 +216,7 @@ export function makeFakeLiveSlotsStuff(options = {}) {
216216
addToPossiblyDeadSet,
217217
addToPossiblyRetiredSet,
218218
dumpStore,
219-
setVom,
219+
setVrm,
220220
};
221221
}
222222

@@ -235,7 +235,7 @@ export function makeFakeVirtualStuff(options = {}) {
235235
const fakeStuff = makeFakeLiveSlotsStuff(options);
236236
const vrm = makeFakeVirtualReferenceManager(fakeStuff);
237237
const vom = makeFakeVirtualObjectManager(vrm, fakeStuff, options);
238-
fakeStuff.setVom(vom);
238+
fakeStuff.setVrm(vrm);
239239
const cm = makeFakeCollectionManager(vrm, fakeStuff, options);
240240
return { fakeStuff, vrm, vom, cm };
241241
}
@@ -244,7 +244,7 @@ export function makeStandaloneFakeVirtualObjectManager(options = {}) {
244244
const fakeStuff = makeFakeLiveSlotsStuff(options);
245245
const vrm = makeFakeVirtualReferenceManager(fakeStuff);
246246
const vom = makeFakeVirtualObjectManager(vrm, fakeStuff, options);
247-
fakeStuff.setVom(vom);
247+
fakeStuff.setVrm(vrm);
248248
return vom;
249249
}
250250

0 commit comments

Comments
 (0)