MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxWriteChunk

Function fxWriteChunk

xs/sources/xsSnapshot.c:1946–1995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1944}
1945
1946void fxWriteChunk(txMachine* the, txSnapshot* snapshot, txSlot* slot)
1947{
1948 switch (slot->kind) {
1949 case XS_STRING_KIND:
1950 fxWriteChunkData(the, snapshot, slot->value.string);
1951 break;
1952 case XS_BIGINT_KIND:
1953 fxWriteChunkBigInt(the, snapshot, slot->value.bigint.data, slot->value.bigint.size);
1954 break;
1955 case XS_ARGUMENTS_SLOPPY_KIND:
1956 case XS_ARGUMENTS_STRICT_KIND:
1957 case XS_ARRAY_KIND:
1958 if (slot->value.array.address)
1959 fxWriteChunkArray(the, snapshot, slot->value.array.address, slot->value.array.length, 2);
1960 break;
1961 case XS_STACK_KIND:
1962 if (slot->value.array.address)
1963 fxWriteChunkArray(the, snapshot, slot->value.array.address, slot->value.array.length, 0);
1964 break;
1965 case XS_ARRAY_BUFFER_KIND:
1966 if (slot->value.arrayBuffer.address)
1967 fxWriteChunkData(the, snapshot, slot->value.arrayBuffer.address);
1968 break;
1969
1970 case XS_CODE_KIND:
1971 fxWriteChunkData(the, snapshot, slot->value.code.address);
1972 break;
1973
1974 case XS_REGEXP_KIND:
1975 if (slot->value.regexp.code)
1976 fxWriteChunkData(the, snapshot, slot->value.regexp.code);
1977 if (slot->value.regexp.data)
1978 fxWriteChunkData(the, snapshot, slot->value.regexp.data);
1979 break;
1980 case XS_KEY_KIND:
1981 if (slot->value.key.string)
1982 fxWriteChunkData(the, snapshot, slot->value.key.string);
1983 break;
1984 case XS_GLOBAL_KIND:
1985 case XS_MAP_KIND:
1986 case XS_SET_KIND:
1987 fxWriteChunkTable(the, snapshot, slot->value.table.address, slot->value.table.length);
1988 break;
1989
1990 case XS_HOST_KIND:
1991 if (slot->value.host.data)
1992 fxWriteChunkData(the, snapshot, slot->value.host.data);
1993 break;
1994 }
1995}
1996
1997void fxWriteChunkArray(txMachine* the, txSnapshot* snapshot, txSlot* address, txSize length, txFlag flag)
1998{

Callers 2

fxWriteChunkArrayFunction · 0.85
fxWriteChunksFunction · 0.85

Calls 4

fxWriteChunkDataFunction · 0.85
fxWriteChunkBigIntFunction · 0.85
fxWriteChunkArrayFunction · 0.85
fxWriteChunkTableFunction · 0.85

Tested by

no test coverage detected