public override void Compile(Execution.VM.ByteCode bc) { using (bc.EnterSource(m_Ref)) { if (m_Expression != null) { m_Expression.Compile(bc); bc.Emit_Ret(1); } else { bc.Emit_Ret(0); } } }
public override void Compile(Execution.VM.ByteCode bc) { bc.Emit_BeginFn(m_StackFrame, "<chunk-root>"); bc.Emit_Args(m_VarArgs); bc.Emit_Literal(DynValue.NewTable(m_GlobalEnv)); bc.Emit_Store(m_Env, 0, 0); bc.Emit_Pop(); m_Block.Compile(bc); bc.Emit_Ret(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; }
public override void Compile(Execution.VM.ByteCode bc) { Instruction meta = bc.Emit_FuncMeta("<chunk-root>"); int metaip = bc.GetJumpPointForLastInstruction(); bc.Emit_BeginFn(m_StackFrame); bc.Emit_Args(m_VarArgs); bc.Emit_Literal(DynValue.NewTable(m_GlobalEnv)); bc.Emit_Store(m_Env, 0, 0); bc.Emit_Pop(); m_Block.Compile(bc); bc.Emit_Ret(0); meta.NumVal = bc.GetJumpPointForLastInstruction() - metaip; }