Exemplo n.º 1
0
        private int SetMethod(Execution.VM.ByteCode bc)
        {
            int cnt = 0;

            cnt += bc.Emit_Load(m_FuncSymbol);

            foreach (string str in m_TableAccessors)
            {
                bc.Emit_Index(DynValue.NewString(str), true);
                cnt += 1;
            }

            bc.Emit_IndexSet(0, 0, DynValue.NewString(m_MethodName), true);

            return(1 + cnt);
        }
Exemplo n.º 2
0
        public override void Compile(Execution.VM.ByteCode bc)
        {
            Instruction meta   = bc.Emit_Meta("<chunk-root>", OpCodeMetadataType.ChunkEntrypoint);
            int         metaip = bc.GetJumpPointForLastInstruction();

            bc.Emit_BeginFn(m_StackFrame);
            bc.Emit_Args(m_VarArgs);

            bc.Emit_Load(SymbolRef.Upvalue(WellKnownSymbols.ENV, 0));
            bc.Emit_Store(m_Env, 0, 0);
            bc.Emit_Pop();

            m_Block.Compile(bc);
            bc.Emit_Ret(0);

            meta.NumVal = bc.GetJumpPointForLastInstruction() - metaip;
        }
		private int SetMethod(Execution.VM.ByteCode bc)
		{
			int cnt = 0;

			cnt += bc.Emit_Load(m_FuncSymbol);

			foreach (string str in m_TableAccessors)
			{
				bc.Emit_Literal(DynValue.NewString(str));
				bc.Emit_Index();
				cnt += 2;
			}

			bc.Emit_Literal(DynValue.NewString(m_MethodName));

			bc.Emit_IndexSet(0, 0);

			return 2 + cnt;
		}
Exemplo n.º 4
0
 public override void Compile(Execution.VM.ByteCode bc)
 {
     bc.Emit_Load(m_Ref);
 }