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

Function fxMapperMapIDs

xs/sources/xsAPI.c:2377–2405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2375}
2376
2377void fxMapperMapIDs(txMapper* self)
2378{
2379 register const txS1* bytes = gxCodeSizes;
2380 txU1 code;
2381 txS1 offset;
2382 txU4 index;
2383 while (self->bufferOffset < self->bufferCode) {
2384 //fprintf(stderr, "%s", gxCodeNames[*((txU1*)p)]);
2385 code = fxMapperRead1(self);
2386 offset = (txS1)c_read8(bytes + code);
2387 if (0 < offset) {
2388 if (XS_CODE_PROFILE == code)
2389 fxMapperMapID(self, fxGenerateProfileID(self->machine));
2390 else
2391 fxMapperSkip(self, offset - 1);
2392 }
2393 else if (0 == offset)
2394 fxMapperMapID(self, self->ids[*(self->map++)]);
2395 else if (-1 == offset) {
2396 index = fxMapperRead1(self);
2397 fxMapperSkip(self, index);
2398 }
2399 else if (-2 == offset) {
2400 index = fxMapperRead2(self);
2401 fxMapperSkip(self, index);
2402 }
2403 //fprintf(stderr, "\n");
2404 }
2405}
2406
2407txU1 fxMapperRead1(txMapper* self)
2408{

Callers 1

fxMapArchiveFunction · 0.85

Calls 5

fxMapperRead1Function · 0.85
fxMapperMapIDFunction · 0.85
fxMapperSkipFunction · 0.85
fxMapperRead2Function · 0.85
fxGenerateProfileIDFunction · 0.70

Tested by

no test coverage detected