private void LoadFrameVars(GearsCallFrame frame) { Chunk = frame.Function.Chunk; _Code = Chunk._Code; _IP = frame.IP; _BP = frame.BP; }
// === Call frames ========================================================================================== // === This should be part of the stack! See todo.md ======================================================== // === Dear lord this is so inefficient! ==================================================================== // ========================================================================================================== internal void PushFrame(GearsCallFrame frame) { if (_FrameCount == FRAMES_MAX) { throw new GearsRuntimeException(Chunk.LineAt(_IP), "Stack frame overflow."); } if (_FrameCount > 0) { SaveFrameVars(_Frames[_FrameCount - 1]); } _Frames[_FrameCount++] = frame; LoadFrameVars(frame); }
private void SaveFrameVars(GearsCallFrame frame) { frame.BP = _BP; frame.IP = _IP; }