6
|
1 using System;
|
|
2 using System.Collections.Generic;
|
|
3 using System.Linq;
|
|
4 using System.Text;
|
|
5
|
|
6 namespace Jint.Runtime.VM.OpCodes {
|
|
7 delegate void BinaryInstructionImpl(int arg1, int arg2, int dest, Frame frame);
|
|
8
|
|
9 class BinaryOp: IInstruction {
|
|
10
|
|
11 int m_dest;
|
|
12 int m_arg1;
|
|
13 int m_arg2;
|
|
14 Codes m_code;
|
|
15 IInstruction m_next;
|
|
16
|
|
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 }
|
|
23
|
|
24 public IInstruction Chain(IInstruction next) {
|
|
25 m_next = next;
|
|
26 return next;
|
|
27 }
|
|
28
|
|
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 }
|
|
36 }
|