MCPcopy Create free account
hub / github.com/ReadyTalk/avian / resolveSourceSites

Function resolveSourceSites

src/codegen/compiler.cpp:1626–1667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624}
1625
1626bool resolveSourceSites(Context* c,
1627 Event* e,
1628 SiteRecordList* frozen,
1629 Site** sites)
1630{
1631 bool complete = true;
1632 for (FrameIterator it(c, e->stackAfter, e->localsAfter); it.hasMore();) {
1633 FrameIterator::Element el = it.next(c);
1634 Value* v = el.value;
1635 Read* r = live(c, v);
1636
1637 if (r and sites[el.localIndex] == 0) {
1638 SiteMask mask(lir::Operand::RegisterPairMask | lir::Operand::MemoryMask,
1639 c->regFile->generalRegisters,
1640 AnyFrameIndex);
1641
1642 Site* s = pickSourceSite(
1643 c, r, 0, 0, &mask, true, false, true, acceptForResolve);
1644
1645 if (s) {
1646 if (DebugControl) {
1647 char buffer[256];
1648 s->toString(c, buffer, 256);
1649 fprintf(stderr,
1650 "resolve source %s from %p local %d frame %d\n",
1651 buffer,
1652 v,
1653 el.localIndex,
1654 el.frameIndex(c));
1655 }
1656
1657 freeze(c, frozen, s, v);
1658
1659 sites[el.localIndex] = s->copy(c);
1660 } else {
1661 complete = false;
1662 }
1663 }
1664 }
1665
1666 return complete;
1667}
1668
1669void resolveTargetSites(Context* c,
1670 Event* e,

Callers 2

resolveJunctionSitesFunction · 0.85
resolveBranchSitesFunction · 0.85

Calls 7

pickSourceSiteFunction · 0.85
freezeFunction · 0.85
frameIndexMethod · 0.80
nextMethod · 0.65
toStringMethod · 0.65
hasMoreMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected