mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
remove value buddies after setting sites to junction sites, not after populating junction sites
This mirrors how snapshots are captured and restored for branch events. Also, switch back to resolving junction sites before capturing fork snapshots so we capture the true state of each value immediately before the branch.
This commit is contained in:
parent
d50febe088
commit
4717e94fa3
@ -3728,11 +3728,6 @@ resolveJunctionSites(Context* c, Event* e)
|
||||
e->junctionSites, e->logicalInstruction->index);
|
||||
}
|
||||
|
||||
for (FrameIterator it(c, e->stackAfter, e->localsAfter); it.hasMore();) {
|
||||
FrameIterator::Element el = it.next(c);
|
||||
removeBuddy(c, el.value);
|
||||
}
|
||||
|
||||
while (frozenSiteIndex) {
|
||||
frozenSites[--frozenSiteIndex]->thaw(c);
|
||||
}
|
||||
@ -3762,9 +3757,9 @@ captureBranchSnapshots(Context* c, Event* e)
|
||||
void
|
||||
populateSiteTables(Context* c, Event* e)
|
||||
{
|
||||
captureBranchSnapshots(c, e);
|
||||
|
||||
resolveJunctionSites(c, e);
|
||||
|
||||
captureBranchSnapshots(c, e);
|
||||
}
|
||||
|
||||
void
|
||||
@ -3805,6 +3800,15 @@ setSites(Context* c, Event* e, Site** sites)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
removeBuddies(Context* c)
|
||||
{
|
||||
for (FrameIterator it(c, c->stack, c->locals); it.hasMore();) {
|
||||
FrameIterator::Element el = it.next(c);
|
||||
removeBuddy(c, el.value);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
restore(Context* c, Event* e, Snapshot* snapshots)
|
||||
{
|
||||
@ -3987,6 +3991,7 @@ compile(Context* c)
|
||||
}
|
||||
|
||||
setSites(c, e, first->junctionSites);
|
||||
removeBuddies(c);
|
||||
} else if (first->successors->nextSuccessor) {
|
||||
if (DebugControl) {
|
||||
fprintf(stderr, "restore snapshots %p at %d\n",
|
||||
|
Loading…
Reference in New Issue
Block a user