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

Function fxCoderJumpTargets

xs/sources/xsCode.c:1275–1294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1273}
1274
1275void fxCoderJumpTargets(txCoder* self, txTargetCode* target, txInteger selector, txInteger* address)
1276{
1277 txInteger selection = *address;
1278 while (target) {
1279 if (target->used) {
1280 txTargetCode* elseTarget = fxCoderCreateTarget(self);
1281 fxCoderAddInteger(self, 1, XS_CODE_INTEGER_1, selection);
1282 fxCoderAddIndex(self, 1, XS_CODE_GET_LOCAL_1, selector);
1283 fxCoderAddByte(self, -1, XS_CODE_STRICT_EQUAL);
1284 fxCoderAddBranch(self, -1, XS_CODE_BRANCH_ELSE_1, elseTarget);
1285 fxCoderAdjustEnvironment(self, target);
1286 fxCoderAdjustScope(self, target);
1287 fxCoderAddBranch(self, 0, XS_CODE_BRANCH_1, target);
1288 fxCoderAdd(self, 0, elseTarget);
1289 }
1290 target = target->nextTarget;
1291 selection++;
1292 }
1293 *address = selection;
1294}
1295
1296void fxCoderOptimize(txCoder* self)
1297{

Callers 4

fxScopeCodeUsedFunction · 0.85
fxForInForOfNodeCodeFunction · 0.85
fxTryNodeCodeFunction · 0.85

Calls 8

fxCoderCreateTargetFunction · 0.85
fxCoderAddIntegerFunction · 0.85
fxCoderAddIndexFunction · 0.85
fxCoderAddByteFunction · 0.85
fxCoderAddBranchFunction · 0.85
fxCoderAdjustEnvironmentFunction · 0.85
fxCoderAdjustScopeFunction · 0.85
fxCoderAddFunction · 0.85

Tested by

no test coverage detected