1.1 --- a/src/Stack.cpp Sat Dec 22 16:42:20 2012 -0800
1.2 +++ b/src/Stack.cpp Sat Dec 22 18:22:14 2012 -0800
1.3 @@ -67,7 +67,9 @@
1.4 static inline size_t
1.5 SizeForCodeFrame(Code *code)
1.6 {
1.7 - return sizeof(Frame) + sizeof(LocalSlot) * (code->nlocals() + code->maxStackDepth());
1.8 + return sizeof(Frame) +
1.9 + sizeof(void *) * (code->maxLoopDepth()) +
1.10 + sizeof(LocalSlot) * (code->nlocals() + code->maxStackDepth());
1.11 }
1.12
1.13 bool
1.14 @@ -199,6 +201,22 @@
1.15 top_.fp = top_.fp->prev();
1.16 }
1.17
1.18 +void
1.19 +Frame::enterLoop(Zone *zone)
1.20 +{
1.21 + assert(loopDepth_ < code_->maxLoopDepth());
1.22 + loopStack()[loopDepth_] = zone->heap().lifoPosition();
1.23 + loopDepth_++;
1.24 +}
1.25 +
1.26 +void
1.27 +Frame::leaveLoop(Zone *zone)
1.28 +{
1.29 + assert(loopDepth_ > 0);
1.30 + loopDepth_--;
1.31 + zone->heap().unwindLifo(loopStack()[loopDepth_]);
1.32 +}
1.33 +
1.34 void
1.35 Frame::accept(VirtualObjectVisitor *visitor)
1.36 {