@agoric/swingset-liveslots 0.10.3-other-dev-8f8782b.0 → 0.10.3-other-dev-fbe72e7.0.fbe72e7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +34 -26
- package/src/boyd-gc.d.ts +12 -0
- package/src/boyd-gc.d.ts.map +1 -0
- package/src/boyd-gc.js +598 -0
- package/src/cache.d.ts +71 -0
- package/src/cache.d.ts.map +1 -0
- package/src/cache.js +3 -2
- package/src/capdata.d.ts +16 -0
- package/src/capdata.d.ts.map +1 -0
- package/src/capdata.js +17 -10
- package/src/collectionManager.d.ts +47 -0
- package/src/collectionManager.d.ts.map +1 -0
- package/src/collectionManager.js +220 -103
- package/src/facetiousness.d.ts +25 -0
- package/src/facetiousness.d.ts.map +1 -0
- package/src/facetiousness.js +1 -1
- package/src/index.d.ts +4 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +4 -2
- package/src/kdebug.d.ts +7 -0
- package/src/kdebug.d.ts.map +1 -0
- package/src/liveslots.d.ts +42 -0
- package/src/liveslots.d.ts.map +1 -0
- package/src/liveslots.js +137 -305
- package/src/message.d.ts +49 -0
- package/src/message.d.ts.map +1 -0
- package/src/message.js +9 -5
- package/src/parseVatSlots.d.ts +125 -0
- package/src/parseVatSlots.d.ts.map +1 -0
- package/src/parseVatSlots.js +1 -1
- package/src/types-index.d.ts +4 -0
- package/src/types-index.js +2 -0
- package/src/types.d.ts +81 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.js +14 -7
- package/src/vatDataTypes.d.ts +170 -0
- package/src/vatDataTypes.d.ts.map +1 -0
- package/src/vatDataTypes.ts +272 -0
- package/src/vatstore-iterators.d.ts +4 -0
- package/src/vatstore-iterators.d.ts.map +1 -0
- package/src/vatstore-iterators.js +2 -0
- package/src/vatstore-usage.md +198 -0
- package/src/virtualObjectManager.d.ts +44 -0
- package/src/virtualObjectManager.d.ts.map +1 -0
- package/src/virtualObjectManager.js +254 -84
- package/src/virtualReferences.d.ts +61 -0
- package/src/virtualReferences.d.ts.map +1 -0
- package/src/virtualReferences.js +135 -26
- package/src/vpid-tracking.md +92 -0
- package/src/watchedPromises.d.ts +31 -0
- package/src/watchedPromises.d.ts.map +1 -0
- package/src/watchedPromises.js +81 -24
- package/test/{test-baggage.js → baggage.test.js} +1 -2
- package/test/{test-cache.js → cache.test.js} +0 -1
- package/test/clear-collection.test.js +586 -0
- package/test/{test-collection-schema-refcount.js → collection-schema-refcount.test.js} +1 -2
- package/test/{test-collection-upgrade.js → collection-upgrade.test.js} +1 -3
- package/test/{test-collections.js → collections.test.js} +183 -18
- package/test/{test-dropped-collection-weakrefs.js → dropped-collection-weakrefs.test.js} +1 -2
- package/test/dropped-weakset-9939.test.js +80 -0
- package/test/dummyMeterControl.d.ts +2 -0
- package/test/dummyMeterControl.d.ts.map +1 -0
- package/test/dummyMeterControl.js +1 -1
- package/test/{test-durabilityChecks.js → durabilityChecks.test.js} +4 -4
- package/test/engine-gc.d.ts +3 -0
- package/test/engine-gc.d.ts.map +1 -0
- package/test/exo-utils.js +70 -0
- package/test/{test-facetiousness.js → facetiousness.test.js} +1 -2
- package/test/gc-and-finalize.d.ts +5 -0
- package/test/gc-and-finalize.d.ts.map +1 -0
- package/test/gc-and-finalize.js +30 -1
- package/test/gc-before-finalizer.test.js +230 -0
- package/test/gc-helpers.js +4 -5
- package/test/{test-gc-sensitivity.js → gc-sensitivity.test.js} +2 -2
- package/test/handled-promises.test.js +872 -0
- package/test/{test-initial-vrefs.js → initial-vrefs.test.js} +13 -20
- package/test/liveslots-helpers.d.ts +64 -0
- package/test/liveslots-helpers.d.ts.map +1 -0
- package/test/liveslots-helpers.js +13 -7
- package/test/{test-liveslots-mock-gc.js → liveslots-mock-gc.test.js} +101 -2
- package/test/{test-liveslots-real-gc.js → liveslots-real-gc.test.js} +73 -46
- package/test/{test-liveslots.js → liveslots.test.js} +17 -18
- package/test/mock-gc.js +1 -0
- package/test/storeGC/{test-lifecycle.js → lifecycle.test.js} +15 -14
- package/test/storeGC/{test-refcount-management.js → refcount-management.test.js} +1 -2
- package/test/storeGC/{test-scalar-store-kind.js → scalar-store-kind.test.js} +0 -1
- package/test/storeGC/{test-weak-key.js → weak-key.test.js} +1 -2
- package/test/strict-test-env-upgrade.test.js +94 -0
- package/test/util.d.ts +25 -0
- package/test/util.d.ts.map +1 -0
- package/test/util.js +4 -4
- package/test/vat-environment.test.js +65 -0
- package/test/vat-util.d.ts +9 -0
- package/test/vat-util.d.ts.map +1 -0
- package/test/vat-util.js +2 -2
- package/test/virtual-objects/{test-cease-recognition.js → cease-recognition.test.js} +2 -2
- package/test/virtual-objects/{test-cross-facet.js → cross-facet.test.js} +5 -4
- package/test/virtual-objects/{test-empty-data.js → empty-data.test.js} +1 -2
- package/test/virtual-objects/{test-facets.js → facets.test.js} +1 -2
- package/test/virtual-objects/{test-kind-changes.js → kind-changes.test.js} +2 -2
- package/test/virtual-objects/{test-reachable-vrefs.js → reachable-vrefs.test.js} +2 -2
- package/test/virtual-objects/{test-rep-tostring.js → rep-tostring.test.js} +3 -5
- package/test/virtual-objects/{test-retain-remotable.js → retain-remotable.test.js} +25 -24
- package/test/virtual-objects/set-debug-label-instances.js +1 -1
- package/test/virtual-objects/state-shape.test.js +389 -0
- package/test/virtual-objects/{test-virtualObjectGC.js → virtualObjectGC.test.js} +39 -38
- package/test/virtual-objects/{test-virtualObjectManager.js → virtualObjectManager.test.js} +104 -8
- package/test/virtual-objects/{test-vo-real-gc.js → vo-real-gc.test.js} +8 -8
- package/test/virtual-objects/{test-weakcollections-vref-handling.js → weakcollections-vref-handling.test.js} +1 -2
- package/test/{test-vo-test-harness.js → vo-test-harness.test.js} +13 -10
- package/test/{test-vpid-liveslots.js → vpid-liveslots.test.js} +105 -5
- package/test/waitUntilQuiescent.d.ts +3 -0
- package/test/waitUntilQuiescent.d.ts.map +1 -0
- package/test/waitUntilQuiescent.js +2 -1
- package/test/weakset-dropped-remotable.test.js +50 -0
- package/tools/fakeCollectionManager.d.ts +14 -0
- package/tools/fakeCollectionManager.d.ts.map +1 -0
- package/tools/fakeCollectionManager.js +44 -0
- package/tools/fakeVirtualObjectManager.d.ts +32 -0
- package/tools/fakeVirtualObjectManager.d.ts.map +1 -0
- package/tools/fakeVirtualObjectManager.js +62 -0
- package/tools/fakeVirtualSupport.d.ts +278 -0
- package/tools/fakeVirtualSupport.d.ts.map +1 -0
- package/tools/fakeVirtualSupport.js +389 -0
- package/tools/prepare-strict-test-env.d.ts +37 -0
- package/tools/prepare-strict-test-env.d.ts.map +1 -0
- package/tools/prepare-strict-test-env.js +124 -0
- package/tools/prepare-test-env.d.ts +2 -0
- package/tools/prepare-test-env.d.ts.map +1 -0
- package/tools/prepare-test-env.js +13 -0
- package/tools/setup-vat-data.d.ts +9 -0
- package/tools/setup-vat-data.d.ts.map +1 -0
- package/tools/setup-vat-data.js +95 -0
- package/tools/vo-test-harness.d.ts +33 -0
- package/tools/vo-test-harness.d.ts.map +1 -0
- package/tools/vo-test-harness.js +164 -0
- package/CHANGELOG.md +0 -61
- package/test/kmarshal.js +0 -79
- package/test/test-handled-promises.js +0 -360
- package/test/virtual-objects/test-state-shape.js +0 -298
package/src/cache.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Fail } from '@
|
|
1
|
+
import { Fail } from '@endo/errors';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @template V
|
|
5
5
|
* @callback CacheGet
|
|
6
6
|
* @param {string} key
|
|
7
|
-
* @returns {V}
|
|
7
|
+
* @returns {V | undefined}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -62,6 +62,7 @@ import { Fail } from '@agoric/assert';
|
|
|
62
62
|
export function makeCache(readBacking, writeBacking, deleteBacking) {
|
|
63
63
|
const stash = new Map();
|
|
64
64
|
const dirtyKeys = new Set();
|
|
65
|
+
/** @type {Cache<V>} */
|
|
65
66
|
const cache = {
|
|
66
67
|
get: key => {
|
|
67
68
|
assert.typeof(key, 'string');
|
package/src/capdata.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {assertCapData} from '@agoric/internal/src/marshal.js';
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Assert function to ensure that something expected to be a capdata object
|
|
6
|
+
* actually is. A capdata object should have a .body property that's a string
|
|
7
|
+
* and a .slots property that's an array of strings.
|
|
8
|
+
*
|
|
9
|
+
* @see {assertCapData} for the general case
|
|
10
|
+
* @param {any} specimen The object to be tested
|
|
11
|
+
* @throws {Error} if, upon inspection, the parameter does not satisfy the above
|
|
12
|
+
* criteria.
|
|
13
|
+
* @returns {asserts specimen is import('./types.js').SwingSetCapData}
|
|
14
|
+
*/
|
|
15
|
+
export function insistCapData(specimen: any): asserts specimen is import("./types.js").SwingSetCapData;
|
|
16
|
+
//# sourceMappingURL=capdata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capdata.d.ts","sourceRoot":"","sources":["capdata.js"],"names":[],"mappings":"AAEA;;GAEG;AAEH;;;;;;;;;;GAUG;AACH,wCALW,GAAG,GAGD,QAAQ,QAAQ,IAAI,OAAO,YAAY,EAAE,eAAe,CAWpE"}
|
package/src/capdata.js
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import { Fail } from '@
|
|
1
|
+
import { Fail } from '@endo/errors';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @import {assertCapData} from '@agoric/internal/src/marshal.js';
|
|
5
|
+
*/
|
|
2
6
|
|
|
3
|
-
/* eslint-disable jsdoc/require-returns-check */
|
|
4
7
|
/**
|
|
5
8
|
* Assert function to ensure that something expected to be a capdata object
|
|
6
9
|
* actually is. A capdata object should have a .body property that's a string
|
|
7
10
|
* and a .slots property that's an array of strings.
|
|
8
11
|
*
|
|
9
|
-
* @
|
|
12
|
+
* @see {assertCapData} for the general case
|
|
13
|
+
* @param {any} specimen The object to be tested
|
|
10
14
|
* @throws {Error} if, upon inspection, the parameter does not satisfy the above
|
|
11
15
|
* criteria.
|
|
12
|
-
* @returns {asserts
|
|
16
|
+
* @returns {asserts specimen is import('./types.js').SwingSetCapData}
|
|
13
17
|
*/
|
|
14
|
-
export function insistCapData(
|
|
15
|
-
typeof
|
|
16
|
-
Fail`capdata has non-string .body ${
|
|
17
|
-
Array.isArray(
|
|
18
|
-
Fail`capdata has non-Array slots ${
|
|
19
|
-
|
|
18
|
+
export function insistCapData(specimen) {
|
|
19
|
+
typeof specimen.body === 'string' ||
|
|
20
|
+
Fail`capdata has non-string .body ${specimen.body}`;
|
|
21
|
+
Array.isArray(specimen.slots) ||
|
|
22
|
+
Fail`capdata has non-Array slots ${specimen.slots}`;
|
|
23
|
+
assert(
|
|
24
|
+
specimen.slots.every(slot => typeof slot === 'string'),
|
|
25
|
+
'All slots must be strings',
|
|
26
|
+
);
|
|
20
27
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {*} syscall
|
|
3
|
+
* @param {import('./virtualReferences.js').VirtualReferenceManager} vrm
|
|
4
|
+
* @param {() => number} allocateExportID
|
|
5
|
+
* @param {() => number} allocateCollectionID
|
|
6
|
+
* @param {(val: any) => string | undefined} convertValToSlot
|
|
7
|
+
* @param {*} convertSlotToVal
|
|
8
|
+
* @param {*} registerValue
|
|
9
|
+
* @param {ToCapData<string>} serialize
|
|
10
|
+
* @param {FromCapData<string>} unserialize
|
|
11
|
+
* @param {(capDatas: any) => void} assertAcceptableSyscallCapdataSize
|
|
12
|
+
*/
|
|
13
|
+
export function makeCollectionManager(syscall: any, vrm: import("./virtualReferences.js").VirtualReferenceManager, allocateExportID: () => number, allocateCollectionID: () => number, convertValToSlot: (val: any) => string | undefined, convertSlotToVal: any, registerValue: any, serialize: ToCapData<string>, unserialize: FromCapData<string>, assertAcceptableSyscallCapdataSize: (capDatas: any) => void): {
|
|
14
|
+
initializeStoreKindInfo: () => void;
|
|
15
|
+
makeScalarBigMapStore: <K, V>(label?: string, options?: StoreOptions) => MapStore<K, V>;
|
|
16
|
+
makeScalarBigWeakMapStore: <K, V>(label?: string, options?: StoreOptions) => WeakMapStore<K, V>;
|
|
17
|
+
makeScalarBigSetStore: <K>(label?: string, options?: StoreOptions) => SetStore<K>;
|
|
18
|
+
makeScalarBigWeakSetStore: <K>(label?: string, options?: StoreOptions) => WeakSetStore<K>;
|
|
19
|
+
provideBaggage: () => any;
|
|
20
|
+
flushSchemaCache: () => void;
|
|
21
|
+
getRetentionStats: () => {};
|
|
22
|
+
testHooks: {
|
|
23
|
+
obtainStoreKindID: (kindName: any) => any;
|
|
24
|
+
storeSizeInternal: (vobjID: any) => number;
|
|
25
|
+
makeCollection: (label: any, kindName: any, isDurable: any, keyShape: any, valueShape: any) => (string | {
|
|
26
|
+
has: (key: any) => boolean;
|
|
27
|
+
get: (key: any) => any;
|
|
28
|
+
init: (key: any, value: any) => void;
|
|
29
|
+
addToSet: (key: any) => void;
|
|
30
|
+
addAllToSet: (elems: any) => void;
|
|
31
|
+
addAllToMap: (mapEntries: any) => void;
|
|
32
|
+
set: (key: any, value: any) => void;
|
|
33
|
+
delete: (key: any) => void;
|
|
34
|
+
})[];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export const collectionMetaKeys: Set<string>;
|
|
38
|
+
export type SchemaCacheValue = {
|
|
39
|
+
keyShape: Pattern;
|
|
40
|
+
valueShape: Pattern;
|
|
41
|
+
label: string;
|
|
42
|
+
schemataCapData: object;
|
|
43
|
+
};
|
|
44
|
+
import type { ToCapData } from '@endo/marshal';
|
|
45
|
+
import type { FromCapData } from '@endo/marshal';
|
|
46
|
+
import type { Pattern } from '@endo/patterns';
|
|
47
|
+
//# sourceMappingURL=collectionManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectionManager.d.ts","sourceRoot":"","sources":["collectionManager.js"],"names":[],"mappings":"AAoHA;;;;;;;;;;;GAWG;AACH,+CAXW,GAAC,OACD,OAAO,wBAAwB,EAAE,uBAAuB,oBACxD,MAAM,MAAM,wBACZ,MAAM,MAAM,oBACZ,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,GAAG,SAAS,oBAChC,GAAC,iBACD,GAAC,aACD,UAAU,MAAM,CAAC,eACjB,YAAY,MAAM,CAAC,sCACnB,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI;;4BAs+BnB,CAAC,EAAC,CAAC,UACL,MAAM,YACN,YAAY,KACV,QAAQ,CAAC,CAAC,EAAC,CAAC,CAAC;gCASb,CAAC,EAAC,CAAC,UACL,MAAM,YACN,YAAY,KACV,YAAY,CAAC,CAAC,EAAC,CAAC,CAAC;4BASjB,CAAC,UACH,MAAM,YACN,YAAY,KACV,QAAQ,CAAC,CAAC,CAAC;gCASX,CAAC,UACH,MAAM,YACN,YAAY,KACV,YAAY,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;EAsB7B;AA7lCD,6CAIG;;cAIW,OAAO;gBACP,OAAO;WACP,MAAM;qBACN,MAAM;;+BAnDqB,eAAe;iCAAf,eAAe;6BAC9B,gBAAgB"}
|