| 679 | } |
| 680 | |
| 681 | void ExprEvalState::pushFrame(StringTableEntry frameName, Namespace *ns, S32 registerCount) |
| 682 | { |
| 683 | #ifdef DEBUG_SPEW |
| 684 | validate(); |
| 685 | |
| 686 | Platform::outputDebugString("[ConsoleInternal] Pushing new frame for '%s' at %i", |
| 687 | frameName, mStackDepth); |
| 688 | #endif |
| 689 | |
| 690 | if (mStackDepth + 1 > stack.size()) |
| 691 | { |
| 692 | #ifdef DEBUG_SPEW |
| 693 | Platform::outputDebugString("[ConsoleInternal] Growing stack by one frame"); |
| 694 | #endif |
| 695 | |
| 696 | stack.push_back(new Dictionary); |
| 697 | } |
| 698 | |
| 699 | Dictionary& newFrame = *(stack[mStackDepth]); |
| 700 | newFrame.setState(this); |
| 701 | |
| 702 | newFrame.scopeName = frameName; |
| 703 | newFrame.scopeNamespace = ns; |
| 704 | |
| 705 | mStackDepth++; |
| 706 | currentVariable = NULL; |
| 707 | |
| 708 | AssertFatal(!newFrame.getCount(), "ExprEvalState::pushFrame - Dictionary not empty!"); |
| 709 | |
| 710 | ConsoleValue* consoleValArray = new ConsoleValue[registerCount](); |
| 711 | localStack.push_back(ConsoleValueFrame(consoleValArray, false)); |
| 712 | currentRegisterArray = &localStack.last(); |
| 713 | |
| 714 | AssertFatal(mStackDepth == localStack.size(), avar("Stack sizes do not match. mStackDepth = %d, localStack = %d", mStackDepth, localStack.size())); |
| 715 | |
| 716 | #ifdef DEBUG_SPEW |
| 717 | validate(); |
| 718 | #endif |
| 719 | } |
| 720 | |
| 721 | void ExprEvalState::popFrame() |
| 722 | { |