diff Jint.Runtime/VM/OpCodes/LteCmp.cs @ 5:cb13da6e3349

simple loop test
author cin
date Mon, 28 Oct 2013 00:49:15 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Jint.Runtime/VM/OpCodes/LteCmp.cs	Mon Oct 28 00:49:15 2013 +0400
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Jint.Runtime.VM.OpCodes {
+    class LteCmp: IInstruction {
+        int m_arg1;
+        int m_arg2;
+        int m_dest;
+        IInstruction m_next;
+
+        public LteCmp(int arg1, int arg2, int dest) {
+            m_arg1 = arg1;
+            m_arg2 = arg2;
+            m_dest = dest;
+        }
+
+        public IInstruction Chain(IInstruction next) {
+            return m_next = next;
+        }
+
+        public IInstruction Invoke(Frame frame) {
+            frame.SetValue(m_dest, frame[m_arg1].InvokeCompareOperation(m_arg2, frame) <= 0);
+            return m_next;
+        }
+    }
+}