Mercurial > pub > Jint1
annotate 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 |
rev | line source |
---|---|
3
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
1 using System; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
2 using System.Collections.Generic; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
3 using System.Linq; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
4 using System.Text; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
5 |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
6 namespace Jint.Runtime.VM.OpCodes { |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
7 delegate void BinaryInstructionImpl(int arg1, int arg2, int dest, Frame frame); |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
8 |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
9 class BinaryOp: IInstruction { |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
10 |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
11 int m_dest; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
12 int m_arg1; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
13 int m_arg2; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
14 Codes m_code; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
15 IInstruction m_next; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
16 |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
17 public BinaryOp(Codes code, int arg1, int arg2, int dest) { |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
18 m_code = code; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
19 m_arg1 = arg1; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
20 m_arg2 = arg2; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
21 m_dest = dest; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
22 } |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
23 |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
24 public IInstruction Chain(IInstruction next) { |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
25 m_next = next; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
26 return next; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
27 } |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
28 |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
29 public IInstruction Invoke(Frame frame) { |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
30 //frame[m_arg1].GetBinaryImpl(m_code)(m_arg1, m_arg2, m_dest, frame); |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
31 frame[m_arg1].InvokeBinaryOperation(m_code, m_arg2, m_dest, frame); |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
32 |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
33 return m_next; |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
34 } |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
35 } |
aced2ae9957f
temp commit, new virtual machine concept (strongly typed version of VM2).
cin
parents:
0
diff
changeset
|
36 } |