comparison Jint.Runtime/VM/OpCodes/BinaryOp.cs @ 3:aced2ae9957f

temp commit, new virtual machine concept (strongly typed version of VM2).
author cin
date Sun, 27 Oct 2013 17:23:25 +0400
parents e113095f1de0
children a6329b092499
comparison
equal deleted inserted replaced
2:4aed85a1f558 3:aced2ae9957f
1 using System; 1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
2 5
3 namespace Jint.Runtime.VM.OpCodes 6 namespace Jint.Runtime.VM.OpCodes {
4 { 7 delegate void BinaryInstructionImpl(int arg1, int arg2, int dest, Frame frame);
5 public abstract class BinaryOp: IOpCode
6 {
7 #region IOpCode implementation
8 8
9 public void Invoke (Frame frame) 9 class BinaryOp: IInstruction {
10 {
11 10
12 } 11 int m_dest;
12 int m_arg1;
13 int m_arg2;
14 Codes m_code;
15 IInstruction m_next;
13 16
14 #endregion 17 public BinaryOp(Codes code, int arg1, int arg2, int dest) {
18 m_code = code;
19 m_arg1 = arg1;
20 m_arg2 = arg2;
21 m_dest = dest;
22 }
15 23
24 public IInstruction Chain(IInstruction next) {
25 m_next = next;
26 return next;
27 }
16 28
17 } 29 public IInstruction Invoke(Frame frame) {
30 //frame[m_arg1].GetBinaryImpl(m_code)(m_arg1, m_arg2, m_dest, frame);
31 frame[m_arg1].InvokeBinaryOperation(m_code, m_arg2, m_dest, frame);
32
33 return m_next;
34 }
35 }
18 } 36 }
19