From 4717e94fa36327986b952d2c02b36f27e733291e Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 13 Dec 2008 12:59:02 -0700 Subject: [PATCH] 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. --- src/compiler.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/compiler.cpp b/src/compiler.cpp index b6bcb8a61a..15dbd78df1 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -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",