Microsoft.Scripting.Debugging.DebugFrame.ReplaceLiftedLocals C# (CSharp) Method

ReplaceLiftedLocals() private method

// This method is called from the generator to update the frame with generator's locals
private ReplaceLiftedLocals ( IRuntimeVariables liftedLocals ) : void
liftedLocals IRuntimeVariables
return void
        internal void ReplaceLiftedLocals(IRuntimeVariables liftedLocals) {
            Debug.Assert(_liftedLocals == null || liftedLocals.Count >= _liftedLocals.Count);

            IRuntimeVariables oldLiftecLocals = _liftedLocals;

            // Replace the list of IStrongBoxes with the new list
            _liftedLocals = liftedLocals;

            if (oldLiftecLocals != null) {
                for (int i = 0; i < oldLiftecLocals.Count; i++) {
                    if (!_funcInfo.Variables[i].IsParameter && i < _liftedLocals.Count)
                        _liftedLocals[i] = oldLiftecLocals[i];
                }
            }

            // Null out scope/variable states to force creation of new ones
            _variables.Clear();
        }

Usage Example

Example #1
0
 public static void ReplaceLiftedLocals(DebugFrame frame, IRuntimeVariables liftedLocals)
 {
     frame.ReplaceLiftedLocals(liftedLocals);
 }