Skip to content

Commit

Permalink
feat: update slogulator for GC syscalls and deliveries
Browse files Browse the repository at this point in the history
  • Loading branch information
FUDCo committed Jul 27, 2021
1 parent 0b86d4d commit 207d8d9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/swingset-runner/src/slogulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ export function main() {
}
}

function doDeliverDropRetire(delivery, prefix = '') {
// prettier-ignore
p(`${prefix}recv-${delivery[0]}: [${delivery[1].map(r => pref(r)).join(' ')}]`);
}

function doDeliver(delivery, prefix) {
switch (delivery[0]) {
case 'message':
Expand All @@ -379,6 +384,11 @@ export function main() {
case 'notify':
doDeliverNotify(delivery, prefix);
break;
case 'dropExports':
case 'retireExports':
case 'retireImports':
doDeliverDropRetire(delivery, prefix);
break;
default:
p(`deliver: unknown deliver type "${delivery[0]}"`);
break;
Expand Down Expand Up @@ -456,6 +466,10 @@ export function main() {
p(`${tag}: ${key} := '${value}'`);
}

function doSyscallDropRetire(tag, entry) {
p(`send-${tag}: [${entry[1].map(r => pref(r)).join(' ')}]`);
}

function doSyscallExit(tag, entry) {
const failure = kernelSpace ? entry[2] : entry[1];
const value = kernelSpace ? entry[3] : entry[2];
Expand Down Expand Up @@ -488,6 +502,11 @@ export function main() {
case 'vatstoreSet':
doSyscallVatstoreSet(tag, syscall);
break;
case 'dropImports':
case 'retireExports':
case 'retireImports':
doSyscallDropRetire(tag, syscall);
break;
default:
p(`syscall: unknown syscall ${currentSyscallName}`);
break;
Expand Down Expand Up @@ -617,6 +636,9 @@ export function main() {
case 'subscribe':
case 'vatstoreDelete':
case 'vatstoreSet':
case 'dropImports':
case 'retireExports':
case 'retireImports':
if (value !== null) {
p(`${tag}: unexpected value ${value}`);
}
Expand Down

0 comments on commit 207d8d9

Please sign in to comment.