summaryrefslogtreecommitdiffstats
path: root/src/org/jetbrains/java/decompiler/code/optinstructions
diff options
context:
space:
mode:
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-08-28 20:52:43 +0400
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-08-28 20:52:43 +0400
commit663631f0456fcc245dd835889f86541d75161c53 (patch)
treee183fa9777242e2900ff3648a726f05b190bc51b /src/org/jetbrains/java/decompiler/code/optinstructions
parentf864084061806fda5510e50bfd2e69bf1dea406b (diff)
downloadfernflower-663631f0456fcc245dd835889f86541d75161c53.tar
fernflower-663631f0456fcc245dd835889f86541d75161c53.tar.gz
fernflower-663631f0456fcc245dd835889f86541d75161c53.tar.lz
fernflower-663631f0456fcc245dd835889f86541d75161c53.tar.xz
fernflower-663631f0456fcc245dd835889f86541d75161c53.zip
java-decompiler: post-import cleanup (classes moved)
Diffstat (limited to 'src/org/jetbrains/java/decompiler/code/optinstructions')
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.java56
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/ANEWARRAY.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.java56
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.java44
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/CHECKCAST.java34
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.java56
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.java55
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.java56
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.java55
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/GETFIELD.java32
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/GETSTATIC.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/GOTO.java44
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/GOTO_W.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/IINC.java42
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.java52
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/INSTANCEOF.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEDYNAMIC.java20
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEINTERFACE.java35
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESPECIAL.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESTATIC.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEVIRTUAL.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.java52
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/JSR.java44
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/JSR_W.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/LDC.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/LDC2_W.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/LDC_W.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.java52
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/LOOKUPSWITCH.java42
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.java52
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/MULTIANEWARRAY.java34
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/NEW.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/NEWARRAY.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/PUTFIELD.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/PUTSTATIC.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/RET.java40
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/SIPUSH.java33
-rw-r--r--src/org/jetbrains/java/decompiler/code/optinstructions/TABLESWITCH.java43
38 files changed, 1524 insertions, 0 deletions
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.java
new file mode 100644
index 0000000..b2727cf
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.java
@@ -0,0 +1,56 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class ALOAD extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_aload_0,opc_aload_1,opc_aload_2,opc_aload_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_aload);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ return 4;
+ } else {
+ return 2;
+ }
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/ANEWARRAY.java b/src/org/jetbrains/java/decompiler/code/optinstructions/ANEWARRAY.java
new file mode 100644
index 0000000..1e0d4ff
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/ANEWARRAY.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class ANEWARRAY extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_anewarray);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.java
new file mode 100644
index 0000000..475df11
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.java
@@ -0,0 +1,56 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class ASTORE extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_astore_0,opc_astore_1,opc_astore_2,opc_astore_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_astore);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ return 4;
+ } else {
+ return 2;
+ }
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.java b/src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.java
new file mode 100644
index 0000000..2fb2db5
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.java
@@ -0,0 +1,44 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class BIPUSH extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_iconst_m1,opc_iconst_0,opc_iconst_1,opc_iconst_2,opc_iconst_3,opc_iconst_4,opc_iconst_5};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int value = getOperand(0);
+ if(value<-1 || value > 5) {
+ out.writeByte(opc_bipush);
+ out.writeByte(value);
+ } else {
+ out.writeByte(opcodes[value+1]);
+ }
+ }
+
+ public int length() {
+ int value = getOperand(0);
+ if(value<-1 || value > 5) {
+ return 2;
+ } else {
+ return 1;
+ }
+ }
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/CHECKCAST.java b/src/org/jetbrains/java/decompiler/code/optinstructions/CHECKCAST.java
new file mode 100644
index 0000000..73417de
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/CHECKCAST.java
@@ -0,0 +1,34 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class CHECKCAST extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_checkcast);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
+
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.java
new file mode 100644
index 0000000..96d5449
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.java
@@ -0,0 +1,56 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class DLOAD extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_dload_0,opc_dload_1,opc_dload_2,opc_dload_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_dload);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ return 4;
+ } else {
+ return 2;
+ }
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.java
new file mode 100644
index 0000000..61a8776
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.java
@@ -0,0 +1,55 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class DSTORE extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_dstore_0,opc_dstore_1,opc_dstore_2,opc_dstore_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_dstore);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ return 4;
+ } else {
+ return 2;
+ }
+ } else {
+ return 1;
+ }
+ }
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.java
new file mode 100644
index 0000000..5c8fe26
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.java
@@ -0,0 +1,56 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class FLOAD extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_fload_0,opc_fload_1,opc_fload_2,opc_fload_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_fload);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ return 4;
+ } else {
+ return 2;
+ }
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.java
new file mode 100644
index 0000000..3685254
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.java
@@ -0,0 +1,55 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class FSTORE extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_fstore_0,opc_fstore_1,opc_fstore_2,opc_fstore_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_fstore);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ return 4;
+ } else {
+ return 2;
+ }
+ } else {
+ return 1;
+ }
+ }
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/GETFIELD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/GETFIELD.java
new file mode 100644
index 0000000..b9a8ab5
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/GETFIELD.java
@@ -0,0 +1,32 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class GETFIELD extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_getfield);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/GETSTATIC.java b/src/org/jetbrains/java/decompiler/code/optinstructions/GETSTATIC.java
new file mode 100644
index 0000000..1890bc0
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/GETSTATIC.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class GETSTATIC extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_getstatic);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/GOTO.java b/src/org/jetbrains/java/decompiler/code/optinstructions/GOTO.java
new file mode 100644
index 0000000..3a81194
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/GOTO.java
@@ -0,0 +1,44 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.JumpInstruction;
+
+public class GOTO extends JumpInstruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int operand = getOperand(0);
+ if(operand < -32768 || operand > 32767) {
+ out.writeByte(opc_goto_w);
+ out.writeInt(operand);
+ } else {
+ out.writeByte(opc_goto);
+ out.writeShort(operand);
+ }
+ }
+
+ public int length() {
+ int operand = getOperand(0);
+ if(operand < -32768 || operand > 32767) {
+ return 5;
+ } else {
+ return 3;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/GOTO_W.java b/src/org/jetbrains/java/decompiler/code/optinstructions/GOTO_W.java
new file mode 100644
index 0000000..6e1f6e7
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/GOTO_W.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.JumpInstruction;
+
+public class GOTO_W extends JumpInstruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_goto_w);
+ out.writeInt(getOperand(0));
+ }
+
+ public int length() {
+ return 5;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/IINC.java b/src/org/jetbrains/java/decompiler/code/optinstructions/IINC.java
new file mode 100644
index 0000000..e945969
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/IINC.java
@@ -0,0 +1,42 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class IINC extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_iinc);
+ if(wide) {
+ out.writeShort(getOperand(0));
+ out.writeShort(getOperand(1));
+ } else {
+ out.writeByte(getOperand(0));
+ out.writeByte(getOperand(1));
+ }
+ }
+
+ public int length() {
+ return wide?6:3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.java
new file mode 100644
index 0000000..40bfa4d
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.java
@@ -0,0 +1,52 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class ILOAD extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_iload_0,opc_iload_1,opc_iload_2,opc_iload_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_iload);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ return wide?4:2;
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/INSTANCEOF.java b/src/org/jetbrains/java/decompiler/code/optinstructions/INSTANCEOF.java
new file mode 100644
index 0000000..f02dfc6
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/INSTANCEOF.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class INSTANCEOF extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_instanceof);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEDYNAMIC.java b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEDYNAMIC.java
new file mode 100644
index 0000000..ee8c785
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEDYNAMIC.java
@@ -0,0 +1,20 @@
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class INVOKEDYNAMIC extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_invokedynamic);
+ out.writeShort(getOperand(0));
+ out.writeByte(0);
+ out.writeByte(0);
+ }
+
+ public int length() {
+ return 5;
+ }
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEINTERFACE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEINTERFACE.java
new file mode 100644
index 0000000..e4f06f2
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEINTERFACE.java
@@ -0,0 +1,35 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class INVOKEINTERFACE extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_invokeinterface);
+ out.writeShort(getOperand(0));
+ out.writeByte(getOperand(1));
+ out.writeByte(0);
+ }
+
+ public int length() {
+ return 5;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESPECIAL.java b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESPECIAL.java
new file mode 100644
index 0000000..6b9b559
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESPECIAL.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class INVOKESPECIAL extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_invokespecial);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESTATIC.java b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESTATIC.java
new file mode 100644
index 0000000..0f1ad16
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESTATIC.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class INVOKESTATIC extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_invokestatic);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEVIRTUAL.java b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEVIRTUAL.java
new file mode 100644
index 0000000..f4537f3
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEVIRTUAL.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class INVOKEVIRTUAL extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_invokevirtual);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.java
new file mode 100644
index 0000000..0ced128
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.java
@@ -0,0 +1,52 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class ISTORE extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_istore_0,opc_istore_1,opc_istore_2,opc_istore_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_istore);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ return wide?4:2;
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/JSR.java b/src/org/jetbrains/java/decompiler/code/optinstructions/JSR.java
new file mode 100644
index 0000000..ef6c2ad
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/JSR.java
@@ -0,0 +1,44 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.JumpInstruction;
+
+public class JSR extends JumpInstruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int operand = getOperand(0);
+ if(operand < -32768 || operand > 32767) {
+ out.writeByte(opc_jsr_w);
+ out.writeInt(operand);
+ } else {
+ out.writeByte(opc_jsr);
+ out.writeShort(operand);
+ }
+ }
+
+ public int length() {
+ int operand = getOperand(0);
+ if(operand < -32768 || operand > 32767) {
+ return 5;
+ } else {
+ return 3;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/JSR_W.java b/src/org/jetbrains/java/decompiler/code/optinstructions/JSR_W.java
new file mode 100644
index 0000000..bc7ae59
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/JSR_W.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.JumpInstruction;
+
+public class JSR_W extends JumpInstruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_jsr_w);
+ out.writeInt(getOperand(0));
+ }
+
+ public int length() {
+ return 5;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/LDC.java b/src/org/jetbrains/java/decompiler/code/optinstructions/LDC.java
new file mode 100644
index 0000000..4b1a715
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/LDC.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class LDC extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_ldc);
+ out.writeByte(getOperand(0));
+ }
+
+ public int length() {
+ return 2;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/LDC2_W.java b/src/org/jetbrains/java/decompiler/code/optinstructions/LDC2_W.java
new file mode 100644
index 0000000..4b7ea0b
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/LDC2_W.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class LDC2_W extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_ldc2_w);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/LDC_W.java b/src/org/jetbrains/java/decompiler/code/optinstructions/LDC_W.java
new file mode 100644
index 0000000..6a4e3a6
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/LDC_W.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class LDC_W extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_ldc_w);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.java
new file mode 100644
index 0000000..52f2b5c
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.java
@@ -0,0 +1,52 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class LLOAD extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_lload_0,opc_lload_1,opc_lload_2,opc_lload_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_lload);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ return wide?4:2;
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/LOOKUPSWITCH.java b/src/org/jetbrains/java/decompiler/code/optinstructions/LOOKUPSWITCH.java
new file mode 100644
index 0000000..1654622
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/LOOKUPSWITCH.java
@@ -0,0 +1,42 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.SwitchInstruction;
+
+public class LOOKUPSWITCH extends SwitchInstruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+
+ out.writeByte(opc_lookupswitch);
+
+ int padding = 3 - (offset%4);
+ for(int i=0;i<padding;i++){
+ out.writeByte(0);
+ }
+
+ for(int i=0;i<operandsCount();i++) {
+ out.writeInt(getOperand(i));
+ }
+ }
+
+ public int length() {
+ return 1+operandsCount()*4;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.java b/src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.java
new file mode 100644
index 0000000..410d19a
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.java
@@ -0,0 +1,52 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class LSTORE extends Instruction {
+
+ private static int[] opcodes = new int[] {opc_lstore_0,opc_lstore_1,opc_lstore_2,opc_lstore_3};
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ int index = getOperand(0);
+ if(index>3) {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_lstore);
+ if(wide) {
+ out.writeShort(index);
+ } else {
+ out.writeByte(index);
+ }
+ } else {
+ out.writeByte(opcodes[index]);
+ }
+ }
+
+ public int length() {
+ int index = getOperand(0);
+ if(index>3) {
+ return wide?4:2;
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/MULTIANEWARRAY.java b/src/org/jetbrains/java/decompiler/code/optinstructions/MULTIANEWARRAY.java
new file mode 100644
index 0000000..c7eb0b9
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/MULTIANEWARRAY.java
@@ -0,0 +1,34 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class MULTIANEWARRAY extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_multianewarray);
+ out.writeShort(getOperand(0));
+ out.writeByte(getOperand(1));
+ }
+
+ public int length() {
+ return 4;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/NEW.java b/src/org/jetbrains/java/decompiler/code/optinstructions/NEW.java
new file mode 100644
index 0000000..eafe17c
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/NEW.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class NEW extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_new);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/NEWARRAY.java b/src/org/jetbrains/java/decompiler/code/optinstructions/NEWARRAY.java
new file mode 100644
index 0000000..8764a6f
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/NEWARRAY.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class NEWARRAY extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_newarray);
+ out.writeByte(getOperand(0));
+ }
+
+ public int length() {
+ return 2;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/PUTFIELD.java b/src/org/jetbrains/java/decompiler/code/optinstructions/PUTFIELD.java
new file mode 100644
index 0000000..096da07
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/PUTFIELD.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class PUTFIELD extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_putfield);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/PUTSTATIC.java b/src/org/jetbrains/java/decompiler/code/optinstructions/PUTSTATIC.java
new file mode 100644
index 0000000..e543c88
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/PUTSTATIC.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class PUTSTATIC extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_putstatic);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/RET.java b/src/org/jetbrains/java/decompiler/code/optinstructions/RET.java
new file mode 100644
index 0000000..d52d2a2
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/RET.java
@@ -0,0 +1,40 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class RET extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ if(wide) {
+ out.writeByte(opc_wide);
+ }
+ out.writeByte(opc_ret);
+ if(wide) {
+ out.writeShort(getOperand(0));
+ } else {
+ out.writeByte(getOperand(0));
+ }
+ }
+
+ public int length() {
+ return wide?4:2;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/SIPUSH.java b/src/org/jetbrains/java/decompiler/code/optinstructions/SIPUSH.java
new file mode 100644
index 0000000..5bac32f
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/SIPUSH.java
@@ -0,0 +1,33 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.Instruction;
+
+public class SIPUSH extends Instruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+ out.writeByte(opc_sipush);
+ out.writeShort(getOperand(0));
+ }
+
+ public int length() {
+ return 3;
+ }
+
+}
diff --git a/src/org/jetbrains/java/decompiler/code/optinstructions/TABLESWITCH.java b/src/org/jetbrains/java/decompiler/code/optinstructions/TABLESWITCH.java
new file mode 100644
index 0000000..ca2eae5
--- /dev/null
+++ b/src/org/jetbrains/java/decompiler/code/optinstructions/TABLESWITCH.java
@@ -0,0 +1,43 @@
+/*
+ * Fernflower - The Analytical Java Decompiler
+ * http://www.reversed-java.com
+ *
+ * (C) 2008 - 2010, Stiver
+ *
+ * This software is NEITHER public domain NOR free software
+ * as per GNU License. See license.txt for more details.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.
+ */
+
+package org.jetbrains.java.decompiler.code.optinstructions;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.jetbrains.java.decompiler.code.SwitchInstruction;
+
+public class TABLESWITCH extends SwitchInstruction {
+
+ public void writeToStream(DataOutputStream out, int offset) throws IOException {
+
+ out.writeByte(opc_tableswitch);
+
+ int padding = 3 - (offset%4);
+ for(int i=0;i<padding;i++){
+ out.writeByte(0);
+ }
+
+ for(int i=0;i<operandsCount();i++) {
+ out.writeInt(getOperand(i));
+ }
+
+ }
+
+ public int length() {
+ return 1+operandsCount()*4;
+ }
+
+}