public override void Compile(Execution.VM.ByteCode bc) { int argslen = m_Arguments.Length; if (!string.IsNullOrEmpty(m_Name)) { bc.Emit_Copy(0); bc.Emit_Literal(DynValue.NewString(m_Name)); bc.Emit_Index(); bc.Emit_Swap(0, 1); ++argslen; } for (int i = 0; i < m_Arguments.Length; i++) { m_Arguments[i].Compile(bc); } if (!string.IsNullOrEmpty(m_Name)) { bc.Emit_ThisCall(argslen, m_DebugErr); } else { bc.Emit_Call(argslen, m_DebugErr); } }
public override void Compile(Execution.VM.ByteCode bc) { m_Function.Compile(bc); int argslen = m_Arguments.Count; if (!string.IsNullOrEmpty(m_Name)) { bc.Emit_Copy(0); bc.Emit_Index(m_Name, true); bc.Emit_Swap(0, 1); ++argslen; } for (int i = 0; i < m_Arguments.Count; i++) { m_Arguments[i].CompilePossibleLiteral(bc); } if (!string.IsNullOrEmpty(m_Name)) { bc.Emit_ThisCall(argslen, m_DebugErr); } else { bc.Emit_Call(argslen, m_DebugErr); } }
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); }
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; }