Pop() приватный Метод

private Pop ( ) : object
Результат object
Пример #1
0
        private static void DoSetGlobalVariable(ExecutionContext context)
        {
            context.InstructionPointer++;
            byte arg = context.Block.ByteCodes[context.InstructionPointer];
            string name = context.Block.GetGlobalName(arg);
            object value = context.Pop();

            if (context.Self != null)
                context.Self.Behavior.Scope.SetValue(name, value);
            else
                context.Machine.CurrentEnvironment.SetValue(name, value);

            context.LastReceiver = value;
            context.Push(value);
        }
Пример #2
0
        private static void DoGetClass(ExecutionContext context)
        {
            object value = context.Pop();
            context.LastReceiver = value;

            if (value == null)
            {
                context.Push(context.Machine.UndefinedObjectClass);
                return;
            }

            IObject iobj = value as IObject;

            if (iobj != null)
            {
                context.Push(iobj.Behavior);
                return;
            }

            var behavior = context.Machine.GetNativeBehavior(value.GetType());

            if (behavior != null)
            {
                context.Push(behavior);
                return;
            }

            context.Push(value.GetType());
        }
Пример #3
0
 private static void DoSetArgument(ExecutionContext context)
 {
     context.InstructionPointer++;
     byte arg = context.Block.ByteCodes[context.InstructionPointer];
     var value = context.Pop();
     context.SetArgument(arg, value);
     context.LastReceiver = null;
 }
Пример #4
0
 private static void DoBasicSize(ExecutionContext context)
 {
     IIndexedObject indexedObj = (IIndexedObject)context.Pop();
     context.LastReceiver = indexedObj;
     context.Push(indexedObj.BasicSize);
 }