java-decompiler: post-import cleanup (formatting and copyright)

master
Roman Shevchenko 10 years ago
parent 663631f045
commit 076e4393f2
  1. 703
      src/org/jetbrains/java/decompiler/code/CodeConstants.java
  2. 969
      src/org/jetbrains/java/decompiler/code/ConstantsUtil.java
  3. 99
      src/org/jetbrains/java/decompiler/code/ExceptionHandler.java
  4. 89
      src/org/jetbrains/java/decompiler/code/ExceptionTable.java
  5. 48
      src/org/jetbrains/java/decompiler/code/FullInstructionSequence.java
  6. 36
      src/org/jetbrains/java/decompiler/code/IfInstruction.java
  7. 224
      src/org/jetbrains/java/decompiler/code/Instruction.java
  8. 412
      src/org/jetbrains/java/decompiler/code/InstructionSequence.java
  9. 49
      src/org/jetbrains/java/decompiler/code/JumpInstruction.java
  10. 50
      src/org/jetbrains/java/decompiler/code/SimpleInstructionSequence.java
  11. 162
      src/org/jetbrains/java/decompiler/code/SwitchInstruction.java
  12. 499
      src/org/jetbrains/java/decompiler/code/cfg/BasicBlock.java
  13. 1722
      src/org/jetbrains/java/decompiler/code/cfg/ControlFlowGraph.java
  14. 229
      src/org/jetbrains/java/decompiler/code/cfg/ExceptionRangeCFG.java
  15. 15
      src/org/jetbrains/java/decompiler/code/instructions/AALOAD.java
  16. 15
      src/org/jetbrains/java/decompiler/code/instructions/AASTORE.java
  17. 15
      src/org/jetbrains/java/decompiler/code/instructions/ACONST_NULL.java
  18. 85
      src/org/jetbrains/java/decompiler/code/instructions/ALOAD.java
  19. 36
      src/org/jetbrains/java/decompiler/code/instructions/ANEWARRAY.java
  20. 15
      src/org/jetbrains/java/decompiler/code/instructions/ARETURN.java
  21. 15
      src/org/jetbrains/java/decompiler/code/instructions/ARRAYLENGTH.java
  22. 86
      src/org/jetbrains/java/decompiler/code/instructions/ASTORE.java
  23. 15
      src/org/jetbrains/java/decompiler/code/instructions/ATHROW.java
  24. 17
      src/org/jetbrains/java/decompiler/code/instructions/BALOAD.java
  25. 15
      src/org/jetbrains/java/decompiler/code/instructions/BASTORE.java
  26. 62
      src/org/jetbrains/java/decompiler/code/instructions/BIPUSH.java
  27. 15
      src/org/jetbrains/java/decompiler/code/instructions/CALOAD.java
  28. 15
      src/org/jetbrains/java/decompiler/code/instructions/CASTORE.java
  29. 36
      src/org/jetbrains/java/decompiler/code/instructions/CHECKCAST.java
  30. 15
      src/org/jetbrains/java/decompiler/code/instructions/D2F.java
  31. 15
      src/org/jetbrains/java/decompiler/code/instructions/D2I.java
  32. 15
      src/org/jetbrains/java/decompiler/code/instructions/D2L.java
  33. 15
      src/org/jetbrains/java/decompiler/code/instructions/DADD.java
  34. 15
      src/org/jetbrains/java/decompiler/code/instructions/DALOAD.java
  35. 15
      src/org/jetbrains/java/decompiler/code/instructions/DASTORE.java
  36. 15
      src/org/jetbrains/java/decompiler/code/instructions/DCMPG.java
  37. 15
      src/org/jetbrains/java/decompiler/code/instructions/DCMPL.java
  38. 15
      src/org/jetbrains/java/decompiler/code/instructions/DCONST_0.java
  39. 15
      src/org/jetbrains/java/decompiler/code/instructions/DCONST_1.java
  40. 15
      src/org/jetbrains/java/decompiler/code/instructions/DDIV.java
  41. 86
      src/org/jetbrains/java/decompiler/code/instructions/DLOAD.java
  42. 15
      src/org/jetbrains/java/decompiler/code/instructions/DMUL.java
  43. 15
      src/org/jetbrains/java/decompiler/code/instructions/DNEG.java
  44. 15
      src/org/jetbrains/java/decompiler/code/instructions/DREM.java
  45. 15
      src/org/jetbrains/java/decompiler/code/instructions/DRETURN.java
  46. 85
      src/org/jetbrains/java/decompiler/code/instructions/DSTORE.java
  47. 15
      src/org/jetbrains/java/decompiler/code/instructions/DSUB.java
  48. 15
      src/org/jetbrains/java/decompiler/code/instructions/DUP.java
  49. 15
      src/org/jetbrains/java/decompiler/code/instructions/DUP2.java
  50. 15
      src/org/jetbrains/java/decompiler/code/instructions/DUP2_X1.java
  51. 15
      src/org/jetbrains/java/decompiler/code/instructions/DUP2_X2.java
  52. 15
      src/org/jetbrains/java/decompiler/code/instructions/DUP_X1.java
  53. 17
      src/org/jetbrains/java/decompiler/code/instructions/DUP_X2.java
  54. 15
      src/org/jetbrains/java/decompiler/code/instructions/F2D.java
  55. 15
      src/org/jetbrains/java/decompiler/code/instructions/F2I.java
  56. 15
      src/org/jetbrains/java/decompiler/code/instructions/F2L.java
  57. 15
      src/org/jetbrains/java/decompiler/code/instructions/FADD.java
  58. 15
      src/org/jetbrains/java/decompiler/code/instructions/FALOAD.java
  59. 15
      src/org/jetbrains/java/decompiler/code/instructions/FASTORE.java
  60. 15
      src/org/jetbrains/java/decompiler/code/instructions/FCMPG.java
  61. 15
      src/org/jetbrains/java/decompiler/code/instructions/FCMPL.java
  62. 15
      src/org/jetbrains/java/decompiler/code/instructions/FCONST_0.java
  63. 15
      src/org/jetbrains/java/decompiler/code/instructions/FCONST_1.java
  64. 15
      src/org/jetbrains/java/decompiler/code/instructions/FCONST_2.java
  65. 15
      src/org/jetbrains/java/decompiler/code/instructions/FDIV.java
  66. 86
      src/org/jetbrains/java/decompiler/code/instructions/FLOAD.java
  67. 15
      src/org/jetbrains/java/decompiler/code/instructions/FMUL.java
  68. 15
      src/org/jetbrains/java/decompiler/code/instructions/FNEG.java
  69. 15
      src/org/jetbrains/java/decompiler/code/instructions/FREM.java
  70. 15
      src/org/jetbrains/java/decompiler/code/instructions/FRETURN.java
  71. 85
      src/org/jetbrains/java/decompiler/code/instructions/FSTORE.java
  72. 15
      src/org/jetbrains/java/decompiler/code/instructions/FSUB.java
  73. 37
      src/org/jetbrains/java/decompiler/code/instructions/GETFIELD.java
  74. 36
      src/org/jetbrains/java/decompiler/code/instructions/GETSTATIC.java
  75. 60
      src/org/jetbrains/java/decompiler/code/instructions/GOTO.java
  76. 36
      src/org/jetbrains/java/decompiler/code/instructions/GOTO_W.java
  77. 15
      src/org/jetbrains/java/decompiler/code/instructions/I2B.java
  78. 15
      src/org/jetbrains/java/decompiler/code/instructions/I2C.java
  79. 15
      src/org/jetbrains/java/decompiler/code/instructions/I2D.java
  80. 15
      src/org/jetbrains/java/decompiler/code/instructions/I2F.java
  81. 15
      src/org/jetbrains/java/decompiler/code/instructions/I2L.java
  82. 15
      src/org/jetbrains/java/decompiler/code/instructions/I2S.java
  83. 15
      src/org/jetbrains/java/decompiler/code/instructions/IADD.java
  84. 15
      src/org/jetbrains/java/decompiler/code/instructions/IALOAD.java
  85. 15
      src/org/jetbrains/java/decompiler/code/instructions/IAND.java
  86. 15
      src/org/jetbrains/java/decompiler/code/instructions/IASTORE.java
  87. 15
      src/org/jetbrains/java/decompiler/code/instructions/IDIV.java
  88. 36
      src/org/jetbrains/java/decompiler/code/instructions/IFEQ.java
  89. 34
      src/org/jetbrains/java/decompiler/code/instructions/IFGE.java
  90. 34
      src/org/jetbrains/java/decompiler/code/instructions/IFGT.java
  91. 36
      src/org/jetbrains/java/decompiler/code/instructions/IFLE.java
  92. 34
      src/org/jetbrains/java/decompiler/code/instructions/IFLT.java
  93. 34
      src/org/jetbrains/java/decompiler/code/instructions/IFNE.java
  94. 36
      src/org/jetbrains/java/decompiler/code/instructions/IFNONNULL.java
  95. 34
      src/org/jetbrains/java/decompiler/code/instructions/IFNULL.java
  96. 34
      src/org/jetbrains/java/decompiler/code/instructions/IF_ACMPEQ.java
  97. 36
      src/org/jetbrains/java/decompiler/code/instructions/IF_ACMPNE.java
  98. 36
      src/org/jetbrains/java/decompiler/code/instructions/IF_ICMPEQ.java
  99. 36
      src/org/jetbrains/java/decompiler/code/instructions/IF_ICMPGE.java
  100. 36
      src/org/jetbrains/java/decompiler/code/instructions/IF_ICMPGT.java
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,371 +1,370 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
public interface CodeConstants { public interface CodeConstants {
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// BYTECODE VERSIONS // BYTECODE VERSIONS
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
public final static int BYTECODE_JAVA_LE_4 = 1; public final static int BYTECODE_JAVA_LE_4 = 1;
public final static int BYTECODE_JAVA_5 = 2; public final static int BYTECODE_JAVA_5 = 2;
public final static int BYTECODE_JAVA_6 = 3; public final static int BYTECODE_JAVA_6 = 3;
public final static int BYTECODE_JAVA_7 = 4; public final static int BYTECODE_JAVA_7 = 4;
public final static int BYTECODE_JAVA_8 = 5; public final static int BYTECODE_JAVA_8 = 5;
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// VARIABLE TYPES // VARIABLE TYPES
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
public final static int TYPE_BYTE = 0;
public final static int TYPE_CHAR = 1;
public final static int TYPE_DOUBLE = 2;
public final static int TYPE_FLOAT = 3;
public final static int TYPE_INT = 4;
public final static int TYPE_LONG = 5;
public final static int TYPE_SHORT = 6;
public final static int TYPE_BOOLEAN = 7;
public final static int TYPE_OBJECT = 8;
public final static int TYPE_ADDRESS = 9;
public final static int TYPE_VOID = 10;
public final static int TYPE_ANY = 11;
public final static int TYPE_GROUP2EMPTY = 12;
public final static int TYPE_NULL = 13;
public final static int TYPE_NOTINITIALIZED = 14;
public final static int TYPE_BYTECHAR = 15;
public final static int TYPE_SHORTCHAR = 16;
public final static int TYPE_UNKNOWN = 17;
public final static int TYPE_GENVAR = 18;
// ----------------------------------------------------------------------
// VARIABLE TYPE FAMILIES
// ----------------------------------------------------------------------
public final static int TYPE_FAMILY_UNKNOWN = 0;
public final static int TYPE_FAMILY_BOOLEAN = 1;
public final static int TYPE_FAMILY_INTEGER = 2;
public final static int TYPE_FAMILY_FLOAT = 3;
public final static int TYPE_FAMILY_LONG = 4;
public final static int TYPE_FAMILY_DOUBLE = 5;
public final static int TYPE_FAMILY_OBJECT = 6;
// ----------------------------------------------------------------------
// MODULE CONSTANTS
// ----------------------------------------------------------------------
public final static int STACKSIZE_SIMPLE = 1;
public final static int STACKSIZE_DOUBLE = 2;
public final static int VAR_LOCAL = 0;
public final static int VAR_STACK = 1;
public final static int VAR_WRITE = 0;
public final static int VAR_READ = 1;
// ----------------------------------------------------------------------
// ACCESS FLAGS
// ----------------------------------------------------------------------
public final static int ACC_PUBLIC = 0x0001;
public final static int ACC_PRIVATE = 0x0002;
public final static int ACC_PROTECTED = 0x0004;
public final static int ACC_STATIC = 0x0008;
public final static int ACC_FINAL = 0x0010;
public final static int ACC_SYNCHRONIZED = 0x0020;
public final static int ACC_NATIVE = 0x0100;
public final static int ACC_ABSTRACT = 0x0400;
public final static int ACC_STRICT = 0x0800;
public final static int ACC_VOLATILE = 0x0040;
public final static int ACC_BRIDGE = 0x0040;
public final static int ACC_TRANSIENT = 0x0080;
public final static int ACC_VARARGS = 0x0080;
public final static int ACC_SYNTHETIC = 0x1000;
public final static int ACC_ANNOTATION = 0x2000;
public final static int ACC_ENUM = 0x4000;
// ----------------------------------------------------------------------
// CLASS FLAGS
// ----------------------------------------------------------------------
public final static int ACC_SUPER = 0x0020;
public final static int ACC_INTERFACE = 0x0200;
// ----------------------------------------------------------------------
// DEPENDENCY CONSTANTS
// ----------------------------------------------------------------------
public final static int TYPE_BYTE = 0; public final static int DEP_CONSTANT = 0;
public final static int TYPE_CHAR = 1; public final static int DEP_UNKNOWN = 1;
public final static int TYPE_DOUBLE = 2; public final static int DEP_GENERAL = 2;
public final static int TYPE_FLOAT = 3; public final static int DEP_PARAMS = 4;
public final static int TYPE_INT = 4; public final static int DEP_STATIC = 8;
public final static int TYPE_LONG = 5;
public final static int TYPE_SHORT = 6;
public final static int TYPE_BOOLEAN = 7;
public final static int TYPE_OBJECT = 8;
public final static int TYPE_ADDRESS = 9;
public final static int TYPE_VOID = 10;
public final static int TYPE_ANY = 11;
public final static int TYPE_GROUP2EMPTY = 12;
public final static int TYPE_NULL = 13;
public final static int TYPE_NOTINITIALIZED = 14;
public final static int TYPE_BYTECHAR = 15;
public final static int TYPE_SHORTCHAR = 16;
public final static int TYPE_UNKNOWN = 17;
public final static int TYPE_GENVAR = 18;
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// VARIABLE TYPE FAMILIES // INSTRUCTION GROUPS
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
public final static int TYPE_FAMILY_UNKNOWN = 0; public final static int GROUP_GENERAL = 1;
public final static int TYPE_FAMILY_BOOLEAN = 1; public final static int GROUP_JUMP = 2;
public final static int TYPE_FAMILY_INTEGER = 2; public final static int GROUP_SWITCH = 3;
public final static int TYPE_FAMILY_FLOAT = 3; public final static int GROUP_INVOCATION = 4;
public final static int TYPE_FAMILY_LONG = 4; public final static int GROUP_FIELDACCESS = 5;
public final static int TYPE_FAMILY_DOUBLE = 5; public final static int GROUP_RETURN = 6;
public final static int TYPE_FAMILY_OBJECT = 6;
// ----------------------------------------------------------------------
// MODULE CONSTANTS
// ----------------------------------------------------------------------
public final static int STACKSIZE_SIMPLE = 1; // ----------------------------------------------------------------------
public final static int STACKSIZE_DOUBLE = 2; // POOL CONSTANTS
// ----------------------------------------------------------------------
public final static int VAR_LOCAL = 0;
public final static int VAR_STACK = 1;
public final static int VAR_WRITE = 0;
public final static int VAR_READ = 1;
// ----------------------------------------------------------------------
// ACCESS FLAGS
// ----------------------------------------------------------------------
public final static int ACC_PUBLIC = 0x0001;
public final static int ACC_PRIVATE = 0x0002;
public final static int ACC_PROTECTED = 0x0004;
public final static int ACC_STATIC = 0x0008;
public final static int ACC_FINAL = 0x0010;
public final static int ACC_SYNCHRONIZED = 0x0020;
public final static int ACC_NATIVE = 0x0100;
public final static int ACC_ABSTRACT = 0x0400;
public final static int ACC_STRICT = 0x0800;
public final static int ACC_VOLATILE = 0x0040;
public final static int ACC_BRIDGE = 0x0040;
public final static int ACC_TRANSIENT = 0x0080;
public final static int ACC_VARARGS = 0x0080;
public final static int ACC_SYNTHETIC = 0x1000;
public final static int ACC_ANNOTATION = 0x2000;
public final static int ACC_ENUM = 0x4000;
// ---------------------------------------------------------------------- public final static int CONSTANT_Utf8 = 1;
// CLASS FLAGS public final static int CONSTANT_Integer = 3;
// ---------------------------------------------------------------------- public final static int CONSTANT_Float = 4;
public final static int CONSTANT_Long = 5;
public final static int ACC_SUPER = 0x0020; public final static int CONSTANT_Double = 6;
public final static int ACC_INTERFACE = 0x0200; public final static int CONSTANT_Class = 7;
public final static int CONSTANT_String = 8;
public final static int CONSTANT_Fieldref = 9;
public final static int CONSTANT_Methodref = 10;
public final static int CONSTANT_InterfaceMethodref = 11;
public final static int CONSTANT_NameAndType = 12;
public final static int CONSTANT_MethodHandle = 15;
public final static int CONSTANT_MethodType = 16;
public final static int CONSTANT_InvokeDynamic = 18;
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// DEPENDENCY CONSTANTS // MethodHandle reference_kind values
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
public final static int DEP_CONSTANT = 0;
public final static int DEP_UNKNOWN = 1;
public final static int DEP_GENERAL = 2;
public final static int DEP_PARAMS = 4;
public final static int DEP_STATIC = 8;
// ---------------------------------------------------------------------- public final static int CONSTANT_MethodHandle_REF_getField = 1;
// INSTRUCTION GROUPS public final static int CONSTANT_MethodHandle_REF_getStatic = 2;
// ---------------------------------------------------------------------- public final static int CONSTANT_MethodHandle_REF_putField = 3;
public final static int CONSTANT_MethodHandle_REF_putStatic = 4;
public final static int GROUP_GENERAL = 1; public final static int CONSTANT_MethodHandle_REF_invokeVirtual = 5;
public final static int GROUP_JUMP = 2; public final static int CONSTANT_MethodHandle_REF_invokeStatic = 6;
public final static int GROUP_SWITCH = 3; public final static int CONSTANT_MethodHandle_REF_invokeSpecial = 7;
public final static int GROUP_INVOCATION = 4; public final static int CONSTANT_MethodHandle_REF_newInvokeSpecial = 8;
public final static int GROUP_FIELDACCESS = 5; public final static int CONSTANT_MethodHandle_REF_invokeInterface = 9;
public final static int GROUP_RETURN = 6;
// ----------------------------------------------------------------------
// POOL CONSTANTS
// ----------------------------------------------------------------------
public final static int CONSTANT_Utf8 = 1;
public final static int CONSTANT_Integer = 3;
public final static int CONSTANT_Float = 4;
public final static int CONSTANT_Long = 5;
public final static int CONSTANT_Double = 6;
public final static int CONSTANT_Class = 7;
public final static int CONSTANT_String = 8;
public final static int CONSTANT_Fieldref = 9;
public final static int CONSTANT_Methodref = 10;
public final static int CONSTANT_InterfaceMethodref = 11;
public final static int CONSTANT_NameAndType = 12;
public final static int CONSTANT_MethodHandle = 15;
public final static int CONSTANT_MethodType = 16;
public final static int CONSTANT_InvokeDynamic = 18;
// ----------------------------------------------------------------------
// MethodHandle reference_kind values
// ----------------------------------------------------------------------
public final static int CONSTANT_MethodHandle_REF_getField = 1; // ----------------------------------------------------------------------
public final static int CONSTANT_MethodHandle_REF_getStatic = 2; // VM OPCODES
public final static int CONSTANT_MethodHandle_REF_putField = 3; // ----------------------------------------------------------------------
public final static int CONSTANT_MethodHandle_REF_putStatic = 4;
public final static int CONSTANT_MethodHandle_REF_invokeVirtual = 5;
public final static int CONSTANT_MethodHandle_REF_invokeStatic = 6;
public final static int CONSTANT_MethodHandle_REF_invokeSpecial = 7;
public final static int CONSTANT_MethodHandle_REF_newInvokeSpecial = 8;
public final static int CONSTANT_MethodHandle_REF_invokeInterface = 9;
// ----------------------------------------------------------------------
// VM OPCODES
// ----------------------------------------------------------------------
public final static int opc_nop = 0; public final static int opc_nop = 0;
public final static int opc_aconst_null = 1; public final static int opc_aconst_null = 1;
public final static int opc_iconst_m1 = 2; public final static int opc_iconst_m1 = 2;
public final static int opc_iconst_0 = 3; public final static int opc_iconst_0 = 3;
public final static int opc_iconst_1 = 4; public final static int opc_iconst_1 = 4;
public final static int opc_iconst_2 = 5; public final static int opc_iconst_2 = 5;
public final static int opc_iconst_3 = 6; public final static int opc_iconst_3 = 6;
public final static int opc_iconst_4 = 7; public final static int opc_iconst_4 = 7;
public final static int opc_iconst_5 = 8; public final static int opc_iconst_5 = 8;
public final static int opc_lconst_0 = 9; public final static int opc_lconst_0 = 9;
public final static int opc_lconst_1 = 10; public final static int opc_lconst_1 = 10;
public final static int opc_fconst_0 = 11; public final static int opc_fconst_0 = 11;
public final static int opc_fconst_1 = 12; public final static int opc_fconst_1 = 12;
public final static int opc_fconst_2 = 13; public final static int opc_fconst_2 = 13;
public final static int opc_dconst_0 = 14; public final static int opc_dconst_0 = 14;
public final static int opc_dconst_1 = 15; public final static int opc_dconst_1 = 15;
public final static int opc_bipush = 16; public final static int opc_bipush = 16;
public final static int opc_sipush = 17; public final static int opc_sipush = 17;
public final static int opc_ldc = 18; public final static int opc_ldc = 18;
public final static int opc_ldc_w = 19; public final static int opc_ldc_w = 19;
public final static int opc_ldc2_w = 20; public final static int opc_ldc2_w = 20;
public final static int opc_iload = 21; public final static int opc_iload = 21;
public final static int opc_lload = 22; public final static int opc_lload = 22;
public final static int opc_fload = 23; public final static int opc_fload = 23;
public final static int opc_dload = 24; public final static int opc_dload = 24;
public final static int opc_aload = 25; public final static int opc_aload = 25;
public final static int opc_iload_0 = 26; public final static int opc_iload_0 = 26;
public final static int opc_iload_1 = 27; public final static int opc_iload_1 = 27;
public final static int opc_iload_2 = 28; public final static int opc_iload_2 = 28;
public final static int opc_iload_3 = 29; public final static int opc_iload_3 = 29;
public final static int opc_lload_0 = 30; public final static int opc_lload_0 = 30;
public final static int opc_lload_1 = 31; public final static int opc_lload_1 = 31;
public final static int opc_lload_2 = 32; public final static int opc_lload_2 = 32;
public final static int opc_lload_3 = 33; public final static int opc_lload_3 = 33;
public final static int opc_fload_0 = 34; public final static int opc_fload_0 = 34;
public final static int opc_fload_1 = 35; public final static int opc_fload_1 = 35;
public final static int opc_fload_2 = 36; public final static int opc_fload_2 = 36;
public final static int opc_fload_3 = 37; public final static int opc_fload_3 = 37;
public final static int opc_dload_0 = 38; public final static int opc_dload_0 = 38;
public final static int opc_dload_1 = 39; public final static int opc_dload_1 = 39;
public final static int opc_dload_2 = 40; public final static int opc_dload_2 = 40;
public final static int opc_dload_3 = 41; public final static int opc_dload_3 = 41;
public final static int opc_aload_0 = 42; public final static int opc_aload_0 = 42;
public final static int opc_aload_1 = 43; public final static int opc_aload_1 = 43;
public final static int opc_aload_2 = 44; public final static int opc_aload_2 = 44;
public final static int opc_aload_3 = 45; public final static int opc_aload_3 = 45;
public final static int opc_iaload = 46; public final static int opc_iaload = 46;
public final static int opc_laload = 47; public final static int opc_laload = 47;
public final static int opc_faload = 48; public final static int opc_faload = 48;
public final static int opc_daload = 49; public final static int opc_daload = 49;
public final static int opc_aaload = 50; public final static int opc_aaload = 50;
public final static int opc_baload = 51; public final static int opc_baload = 51;
public final static int opc_caload = 52; public final static int opc_caload = 52;
public final static int opc_saload = 53; public final static int opc_saload = 53;
public final static int opc_istore = 54; public final static int opc_istore = 54;
public final static int opc_lstore = 55; public final static int opc_lstore = 55;
public final static int opc_fstore = 56; public final static int opc_fstore = 56;
public final static int opc_dstore = 57; public final static int opc_dstore = 57;
public final static int opc_astore = 58; public final static int opc_astore = 58;
public final static int opc_istore_0 = 59; public final static int opc_istore_0 = 59;
public final static int opc_istore_1 = 60; public final static int opc_istore_1 = 60;
public final static int opc_istore_2 = 61; public final static int opc_istore_2 = 61;
public final static int opc_istore_3 = 62; public final static int opc_istore_3 = 62;
public final static int opc_lstore_0 = 63; public final static int opc_lstore_0 = 63;
public final static int opc_lstore_1 = 64; public final static int opc_lstore_1 = 64;
public final static int opc_lstore_2 = 65; public final static int opc_lstore_2 = 65;
public final static int opc_lstore_3 = 66; public final static int opc_lstore_3 = 66;
public final static int opc_fstore_0 = 67; public final static int opc_fstore_0 = 67;
public final static int opc_fstore_1 = 68; public final static int opc_fstore_1 = 68;
public final static int opc_fstore_2 = 69; public final static int opc_fstore_2 = 69;
public final static int opc_fstore_3 = 70; public final static int opc_fstore_3 = 70;
public final static int opc_dstore_0 = 71; public final static int opc_dstore_0 = 71;
public final static int opc_dstore_1 = 72; public final static int opc_dstore_1 = 72;
public final static int opc_dstore_2 = 73; public final static int opc_dstore_2 = 73;
public final static int opc_dstore_3 = 74; public final static int opc_dstore_3 = 74;
public final static int opc_astore_0 = 75; public final static int opc_astore_0 = 75;
public final static int opc_astore_1 = 76; public final static int opc_astore_1 = 76;
public final static int opc_astore_2 = 77; public final static int opc_astore_2 = 77;
public final static int opc_astore_3 = 78; public final static int opc_astore_3 = 78;
public final static int opc_iastore = 79; public final static int opc_iastore = 79;
public final static int opc_lastore = 80; public final static int opc_lastore = 80;
public final static int opc_fastore = 81; public final static int opc_fastore = 81;
public final static int opc_dastore = 82; public final static int opc_dastore = 82;
public final static int opc_aastore = 83; public final static int opc_aastore = 83;
public final static int opc_bastore = 84; public final static int opc_bastore = 84;
public final static int opc_castore = 85; public final static int opc_castore = 85;
public final static int opc_sastore = 86; public final static int opc_sastore = 86;
public final static int opc_pop = 87; public final static int opc_pop = 87;
public final static int opc_pop2 = 88; public final static int opc_pop2 = 88;
public final static int opc_dup = 89; public final static int opc_dup = 89;
public final static int opc_dup_x1 = 90; public final static int opc_dup_x1 = 90;
public final static int opc_dup_x2 = 91; public final static int opc_dup_x2 = 91;
public final static int opc_dup2 = 92; public final static int opc_dup2 = 92;
public final static int opc_dup2_x1 = 93; public final static int opc_dup2_x1 = 93;
public final static int opc_dup2_x2 = 94; public final static int opc_dup2_x2 = 94;
public final static int opc_swap = 95; public final static int opc_swap = 95;
public final static int opc_iadd = 96; public final static int opc_iadd = 96;
public final static int opc_ladd = 97; public final static int opc_ladd = 97;
public final static int opc_fadd = 98; public final static int opc_fadd = 98;
public final static int opc_dadd = 99; public final static int opc_dadd = 99;
public final static int opc_isub = 100; public final static int opc_isub = 100;
public final static int opc_lsub = 101; public final static int opc_lsub = 101;
public final static int opc_fsub = 102; public final static int opc_fsub = 102;
public final static int opc_dsub = 103; public final static int opc_dsub = 103;
public final static int opc_imul = 104; public final static int opc_imul = 104;
public final static int opc_lmul = 105; public final static int opc_lmul = 105;
public final static int opc_fmul = 106; public final static int opc_fmul = 106;
public final static int opc_dmul = 107; public final static int opc_dmul = 107;
public final static int opc_idiv = 108; public final static int opc_idiv = 108;
public final static int opc_ldiv = 109; public final static int opc_ldiv = 109;
public final static int opc_fdiv = 110; public final static int opc_fdiv = 110;
public final static int opc_ddiv = 111; public final static int opc_ddiv = 111;
public final static int opc_irem = 112; public final static int opc_irem = 112;
public final static int opc_lrem = 113; public final static int opc_lrem = 113;
public final static int opc_frem = 114; public final static int opc_frem = 114;
public final static int opc_drem = 115; public final static int opc_drem = 115;
public final static int opc_ineg = 116; public final static int opc_ineg = 116;
public final static int opc_lneg = 117; public final static int opc_lneg = 117;
public final static int opc_fneg = 118; public final static int opc_fneg = 118;
public final static int opc_dneg = 119; public final static int opc_dneg = 119;
public final static int opc_ishl = 120; public final static int opc_ishl = 120;
public final static int opc_lshl = 121; public final static int opc_lshl = 121;
public final static int opc_ishr = 122; public final static int opc_ishr = 122;
public final static int opc_lshr = 123; public final static int opc_lshr = 123;
public final static int opc_iushr = 124; public final static int opc_iushr = 124;
public final static int opc_lushr = 125; public final static int opc_lushr = 125;
public final static int opc_iand = 126; public final static int opc_iand = 126;
public final static int opc_land = 127; public final static int opc_land = 127;
public final static int opc_ior = 128; public final static int opc_ior = 128;
public final static int opc_lor = 129; public final static int opc_lor = 129;
public final static int opc_ixor = 130; public final static int opc_ixor = 130;
public final static int opc_lxor = 131; public final static int opc_lxor = 131;
public final static int opc_iinc = 132; public final static int opc_iinc = 132;
public final static int opc_i2l = 133; public final static int opc_i2l = 133;
public final static int opc_i2f = 134; public final static int opc_i2f = 134;
public final static int opc_i2d = 135; public final static int opc_i2d = 135;
public final static int opc_l2i = 136; public final static int opc_l2i = 136;
public final static int opc_l2f = 137; public final static int opc_l2f = 137;
public final static int opc_l2d = 138; public final static int opc_l2d = 138;
public final static int opc_f2i = 139; public final static int opc_f2i = 139;
public final static int opc_f2l = 140; public final static int opc_f2l = 140;
public final static int opc_f2d = 141; public final static int opc_f2d = 141;
public final static int opc_d2i = 142; public final static int opc_d2i = 142;
public final static int opc_d2l = 143; public final static int opc_d2l = 143;
public final static int opc_d2f = 144; public final static int opc_d2f = 144;
public final static int opc_i2b = 145; public final static int opc_i2b = 145;
public final static int opc_i2c = 146; public final static int opc_i2c = 146;
public final static int opc_i2s = 147; public final static int opc_i2s = 147;
public final static int opc_lcmp = 148; public final static int opc_lcmp = 148;
public final static int opc_fcmpl = 149; public final static int opc_fcmpl = 149;
public final static int opc_fcmpg = 150; public final static int opc_fcmpg = 150;
public final static int opc_dcmpl = 151; public final static int opc_dcmpl = 151;
public final static int opc_dcmpg = 152; public final static int opc_dcmpg = 152;
public final static int opc_ifeq = 153; public final static int opc_ifeq = 153;
public final static int opc_ifne = 154; public final static int opc_ifne = 154;
public final static int opc_iflt = 155; public final static int opc_iflt = 155;
public final static int opc_ifge = 156; public final static int opc_ifge = 156;
public final static int opc_ifgt = 157; public final static int opc_ifgt = 157;
public final static int opc_ifle = 158; public final static int opc_ifle = 158;
public final static int opc_if_icmpeq = 159; public final static int opc_if_icmpeq = 159;
public final static int opc_if_icmpne = 160; public final static int opc_if_icmpne = 160;
public final static int opc_if_icmplt = 161; public final static int opc_if_icmplt = 161;
public final static int opc_if_icmpge = 162; public final static int opc_if_icmpge = 162;
public final static int opc_if_icmpgt = 163; public final static int opc_if_icmpgt = 163;
public final static int opc_if_icmple = 164; public final static int opc_if_icmple = 164;
public final static int opc_if_acmpeq = 165; public final static int opc_if_acmpeq = 165;
public final static int opc_if_acmpne = 166; public final static int opc_if_acmpne = 166;
public final static int opc_goto = 167; public final static int opc_goto = 167;
public final static int opc_jsr = 168; public final static int opc_jsr = 168;
public final static int opc_ret = 169; public final static int opc_ret = 169;
public final static int opc_tableswitch = 170; public final static int opc_tableswitch = 170;
public final static int opc_lookupswitch = 171; public final static int opc_lookupswitch = 171;
public final static int opc_ireturn = 172; public final static int opc_ireturn = 172;
public final static int opc_lreturn = 173; public final static int opc_lreturn = 173;
public final static int opc_freturn = 174; public final static int opc_freturn = 174;
public final static int opc_dreturn = 175; public final static int opc_dreturn = 175;
public final static int opc_areturn = 176; public final static int opc_areturn = 176;
public final static int opc_return = 177; public final static int opc_return = 177;
public final static int opc_getstatic = 178; public final static int opc_getstatic = 178;
public final static int opc_putstatic = 179; public final static int opc_putstatic = 179;
public final static int opc_getfield = 180; public final static int opc_getfield = 180;
public final static int opc_putfield = 181; public final static int opc_putfield = 181;
public final static int opc_invokevirtual = 182; public final static int opc_invokevirtual = 182;
public final static int opc_invokespecial = 183; public final static int opc_invokespecial = 183;
public final static int opc_invokestatic = 184; public final static int opc_invokestatic = 184;
public final static int opc_invokeinterface = 185; public final static int opc_invokeinterface = 185;
public final static int opc_invokedynamic = 186; public final static int opc_invokedynamic = 186;
public final static int opc_xxxunusedxxx = 186; public final static int opc_xxxunusedxxx = 186;
public final static int opc_new = 187; public final static int opc_new = 187;
public final static int opc_newarray = 188; public final static int opc_newarray = 188;
public final static int opc_anewarray = 189; public final static int opc_anewarray = 189;
public final static int opc_arraylength = 190; public final static int opc_arraylength = 190;
public final static int opc_athrow = 191; public final static int opc_athrow = 191;
public final static int opc_checkcast = 192; public final static int opc_checkcast = 192;
public final static int opc_instanceof = 193; public final static int opc_instanceof = 193;
public final static int opc_monitorenter = 194; public final static int opc_monitorenter = 194;
public final static int opc_monitorexit = 195; public final static int opc_monitorexit = 195;
public final static int opc_wide = 196; public final static int opc_wide = 196;
public final static int opc_multianewarray = 197; public final static int opc_multianewarray = 197;
public final static int opc_ifnull = 198; public final static int opc_ifnull = 198;
public final static int opc_ifnonnull = 199; public final static int opc_ifnonnull = 199;
public final static int opc_goto_w = 200; public final static int opc_goto_w = 200;
public final static int opc_jsr_w = 201; public final static int opc_jsr_w = 201;
} }

@ -1,519 +1,482 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
import org.jetbrains.java.decompiler.code.optinstructions.ALOAD; import org.jetbrains.java.decompiler.code.optinstructions.*;
import org.jetbrains.java.decompiler.code.optinstructions.ANEWARRAY;
import org.jetbrains.java.decompiler.code.optinstructions.ASTORE;
import org.jetbrains.java.decompiler.code.optinstructions.BIPUSH;
import org.jetbrains.java.decompiler.code.optinstructions.CHECKCAST;
import org.jetbrains.java.decompiler.code.optinstructions.DLOAD;
import org.jetbrains.java.decompiler.code.optinstructions.DSTORE;
import org.jetbrains.java.decompiler.code.optinstructions.FLOAD;
import org.jetbrains.java.decompiler.code.optinstructions.FSTORE;
import org.jetbrains.java.decompiler.code.optinstructions.GETFIELD;
import org.jetbrains.java.decompiler.code.optinstructions.GETSTATIC;
import org.jetbrains.java.decompiler.code.optinstructions.GOTO;
import org.jetbrains.java.decompiler.code.optinstructions.GOTO_W;
import org.jetbrains.java.decompiler.code.optinstructions.IINC;
import org.jetbrains.java.decompiler.code.optinstructions.ILOAD;
import org.jetbrains.java.decompiler.code.optinstructions.INSTANCEOF;
import org.jetbrains.java.decompiler.code.optinstructions.INVOKEDYNAMIC;
import org.jetbrains.java.decompiler.code.optinstructions.INVOKEINTERFACE;
import org.jetbrains.java.decompiler.code.optinstructions.INVOKESPECIAL;
import org.jetbrains.java.decompiler.code.optinstructions.INVOKESTATIC;
import org.jetbrains.java.decompiler.code.optinstructions.INVOKEVIRTUAL;
import org.jetbrains.java.decompiler.code.optinstructions.ISTORE;
import org.jetbrains.java.decompiler.code.optinstructions.JSR;
import org.jetbrains.java.decompiler.code.optinstructions.JSR_W;
import org.jetbrains.java.decompiler.code.optinstructions.LDC;
import org.jetbrains.java.decompiler.code.optinstructions.LDC2_W;
import org.jetbrains.java.decompiler.code.optinstructions.LDC_W;
import org.jetbrains.java.decompiler.code.optinstructions.LLOAD;
import org.jetbrains.java.decompiler.code.optinstructions.LOOKUPSWITCH;
import org.jetbrains.java.decompiler.code.optinstructions.LSTORE;
import org.jetbrains.java.decompiler.code.optinstructions.MULTIANEWARRAY;
import org.jetbrains.java.decompiler.code.optinstructions.NEW;
import org.jetbrains.java.decompiler.code.optinstructions.NEWARRAY;
import org.jetbrains.java.decompiler.code.optinstructions.PUTFIELD;
import org.jetbrains.java.decompiler.code.optinstructions.PUTSTATIC;
import org.jetbrains.java.decompiler.code.optinstructions.RET;
import org.jetbrains.java.decompiler.code.optinstructions.SIPUSH;
import org.jetbrains.java.decompiler.code.optinstructions.TABLESWITCH;
public class ConstantsUtil { public class ConstantsUtil {
public static String getName(int opcode) {
return opcodeNames[opcode];
}
public static Instruction getInstructionInstance(int opcode, boolean wide, int group, int bytecode_version, int[] operands) { public static String getName(int opcode) {
return opcodeNames[opcode];
}
public static Instruction getInstructionInstance(int opcode, boolean wide, int group, int bytecode_version, int[] operands) {
Instruction instr = getInstructionInstance(opcode, bytecode_version);
instr.wide = wide;
instr.group = group;
instr.bytecode_version = bytecode_version;
instr.setOperands(operands);
return instr;
}
private static Instruction getInstructionInstance(int opcode, int bytecode_version) {
try {
Instruction instr;
if ((opcode >= CodeConstants.opc_ifeq &&
opcode <= CodeConstants.opc_if_acmpne) ||
opcode == CodeConstants.opc_ifnull ||
opcode == CodeConstants.opc_ifnonnull) {
instr = new IfInstruction();
}
else {
Class cl = opcodeClasses[opcode];
if (opcode == CodeConstants.opc_invokedynamic && bytecode_version < CodeConstants.BYTECODE_JAVA_7) {
cl = null; // instruction unused in Java 6 and before
}
Instruction instr = getInstructionInstance(opcode, bytecode_version); if (cl == null) {
instr.wide = wide; instr = new Instruction();
instr.group = group; }
instr.bytecode_version = bytecode_version; else {
instr.setOperands(operands); instr = (Instruction)cl.newInstance();
}
}
return instr; instr.opcode = opcode;
} return instr;
}
private static Instruction getInstructionInstance(int opcode, int bytecode_version) { catch (Exception ex) {
try { return null;
Instruction instr; }
}
if((opcode >= CodeConstants.opc_ifeq &&
opcode <= CodeConstants.opc_if_acmpne) ||
opcode == CodeConstants.opc_ifnull ||
opcode == CodeConstants.opc_ifnonnull) {
instr = new IfInstruction();
} else {
Class cl = opcodeClasses[opcode];
if(opcode == CodeConstants.opc_invokedynamic && bytecode_version < CodeConstants.BYTECODE_JAVA_7) {
cl = null; // instruction unused in Java 6 and before
}
if(cl == null) {
instr = new Instruction();
} else {
instr = (Instruction)cl.newInstance();
}
}
instr.opcode = opcode;
return instr;
} catch (Exception ex) {
return null;
}
}
private static String[] opcodeNames = {
private static String[] opcodeNames = { "nop", // "nop",
"nop", // "nop", "aconst_null", // "aconst_null",
"aconst_null", // "aconst_null", "iconst_m1", // "iconst_m1",
"iconst_m1", // "iconst_m1", "iconst_0", // "iconst_0",
"iconst_0", // "iconst_0", "iconst_1", // "iconst_1",
"iconst_1", // "iconst_1", "iconst_2", // "iconst_2",
"iconst_2", // "iconst_2", "iconst_3", // "iconst_3",
"iconst_3", // "iconst_3", "iconst_4", // "iconst_4",
"iconst_4", // "iconst_4", "iconst_5", // "iconst_5",
"iconst_5", // "iconst_5", "lconst_0", // "lconst_0",
"lconst_0", // "lconst_0", "lconst_1", // "lconst_1",
"lconst_1", // "lconst_1", "fconst_0", // "fconst_0",
"fconst_0", // "fconst_0", "fconst_1", // "fconst_1",
"fconst_1", // "fconst_1", "fconst_2", // "fconst_2",
"fconst_2", // "fconst_2", "dconst_0", // "dconst_0",
"dconst_0", // "dconst_0", "dconst_1", // "dconst_1",
"dconst_1", // "dconst_1", "bipush", // "bipush",
"bipush", // "bipush", "sipush", // "sipush",
"sipush", // "sipush", "ldc", // "ldc",
"ldc", // "ldc", "ldc_w", // "ldc_w",
"ldc_w", // "ldc_w", "ldc2_w", // "ldc2_w",
"ldc2_w", // "ldc2_w", "iload", // "iload",
"iload", // "iload", "lload", // "lload",
"lload", // "lload", "fload", // "fload",
"fload", // "fload", "dload", // "dload",
"dload", // "dload", "aload", // "aload",
"aload", // "aload", "iload_0", // "iload_0",
"iload_0", // "iload_0", "iload_1", // "iload_1",
"iload_1", // "iload_1", "iload_2", // "iload_2",
"iload_2", // "iload_2", "iload_3", // "iload_3",
"iload_3", // "iload_3", "lload_0", // "lload_0",
"lload_0", // "lload_0", "lload_1", // "lload_1",
"lload_1", // "lload_1", "lload_2", // "lload_2",
"lload_2", // "lload_2", "lload_3", // "lload_3",
"lload_3", // "lload_3", "fload_0", // "fload_0",
"fload_0", // "fload_0", "fload_1", // "fload_1",
"fload_1", // "fload_1", "fload_2", // "fload_2",
"fload_2", // "fload_2", "fload_3", // "fload_3",
"fload_3", // "fload_3", "dload_0", // "dload_0",
"dload_0", // "dload_0", "dload_1", // "dload_1",
"dload_1", // "dload_1", "dload_2", // "dload_2",
"dload_2", // "dload_2", "dload_3", // "dload_3",
"dload_3", // "dload_3", "aload_0", // "aload_0",
"aload_0", // "aload_0", "aload_1", // "aload_1",
"aload_1", // "aload_1", "aload_2", // "aload_2",
"aload_2", // "aload_2", "aload_3", // "aload_3",
"aload_3", // "aload_3", "iaload", // "iaload",
"iaload", // "iaload", "laload", // "laload",
"laload", // "laload", "faload", // "faload",
"faload", // "faload", "daload", // "daload",
"daload", // "daload", "aaload", // "aaload",
"aaload", // "aaload", "baload", // "baload",
"baload", // "baload", "caload", // "caload",
"caload", // "caload", "saload", // "saload",
"saload", // "saload", "istore", // "istore",
"istore", // "istore", "lstore", // "lstore",
"lstore", // "lstore", "fstore", // "fstore",
"fstore", // "fstore", "dstore", // "dstore",
"dstore", // "dstore", "astore", // "astore",
"astore", // "astore", "istore_0", // "istore_0",
"istore_0", // "istore_0", "istore_1", // "istore_1",
"istore_1", // "istore_1", "istore_2", // "istore_2",
"istore_2", // "istore_2", "istore_3", // "istore_3",
"istore_3", // "istore_3", "lstore_0", // "lstore_0",
"lstore_0", // "lstore_0", "lstore_1", // "lstore_1",
"lstore_1", // "lstore_1", "lstore_2", // "lstore_2",
"lstore_2", // "lstore_2", "lstore_3", // "lstore_3",
"lstore_3", // "lstore_3", "fstore_0", // "fstore_0",
"fstore_0", // "fstore_0", "fstore_1", // "fstore_1",
"fstore_1", // "fstore_1", "fstore_2", // "fstore_2",
"fstore_2", // "fstore_2", "fstore_3", // "fstore_3",
"fstore_3", // "fstore_3", "dstore_0", // "dstore_0",
"dstore_0", // "dstore_0", "dstore_1", // "dstore_1",
"dstore_1", // "dstore_1", "dstore_2", // "dstore_2",
"dstore_2", // "dstore_2", "dstore_3", // "dstore_3",
"dstore_3", // "dstore_3", "astore_0", // "astore_0",
"astore_0", // "astore_0", "astore_1", // "astore_1",
"astore_1", // "astore_1", "astore_2", // "astore_2",
"astore_2", // "astore_2", "astore_3", // "astore_3",
"astore_3", // "astore_3", "iastore", // "iastore",
"iastore", // "iastore", "lastore", // "lastore",
"lastore", // "lastore", "fastore", // "fastore",
"fastore", // "fastore", "dastore", // "dastore",
"dastore", // "dastore", "aastore", // "aastore",
"aastore", // "aastore", "bastore", // "bastore",
"bastore", // "bastore", "castore", // "castore",
"castore", // "castore", "sastore", // "sastore",
"sastore", // "sastore", "pop", // "pop",
"pop", // "pop", "pop2", // "pop2",
"pop2", // "pop2", "dup", // "dup",
"dup", // "dup", "dup_x1", // "dup_x1",
"dup_x1", // "dup_x1", "dup_x2", // "dup_x2",
"dup_x2", // "dup_x2", "dup2", // "dup2",
"dup2", // "dup2", "dup2_x1", // "dup2_x1",
"dup2_x1", // "dup2_x1", "dup2_x2", // "dup2_x2",
"dup2_x2", // "dup2_x2", "swap", // "swap",
"swap", // "swap", "iadd", // "iadd",
"iadd", // "iadd", "ladd", // "ladd",
"ladd", // "ladd", "fadd", // "fadd",
"fadd", // "fadd", "dadd", // "dadd",
"dadd", // "dadd", "isub", // "isub",
"isub", // "isub", "lsub", // "lsub",
"lsub", // "lsub", "fsub", // "fsub",
"fsub", // "fsub", "dsub", // "dsub",
"dsub", // "dsub", "imul", // "imul",
"imul", // "imul", "lmul", // "lmul",
"lmul", // "lmul", "fmul", // "fmul",
"fmul", // "fmul", "dmul", // "dmul",
"dmul", // "dmul", "idiv", // "idiv",
"idiv", // "idiv", "ldiv", // "ldiv",
"ldiv", // "ldiv", "fdiv", // "fdiv",
"fdiv", // "fdiv", "ddiv", // "ddiv",
"ddiv", // "ddiv", "irem", // "irem",
"irem", // "irem", "lrem", // "lrem",
"lrem", // "lrem", "frem", // "frem",
"frem", // "frem", "drem", // "drem",
"drem", // "drem", "ineg", // "ineg",
"ineg", // "ineg", "lneg", // "lneg",
"lneg", // "lneg", "fneg", // "fneg",
"fneg", // "fneg", "dneg", // "dneg",
"dneg", // "dneg", "ishl", // "ishl",
"ishl", // "ishl", "lshl", // "lshl",
"lshl", // "lshl", "ishr", // "ishr",
"ishr", // "ishr", "lshr", // "lshr",
"lshr", // "lshr", "iushr", // "iushr",
"iushr", // "iushr", "lushr", // "lushr",
"lushr", // "lushr", "iand", // "iand",
"iand", // "iand", "land", // "land",
"land", // "land", "ior", // "ior",
"ior", // "ior", "lor", // "lor",
"lor", // "lor", "ixor", // "ixor",
"ixor", // "ixor", "lxor", // "lxor",
"lxor", // "lxor", "iinc", // "iinc",
"iinc", // "iinc", "i2l", // "i2l",
"i2l", // "i2l", "i2f", // "i2f",
"i2f", // "i2f", "i2d", // "i2d",
"i2d", // "i2d", "l2i", // "l2i",
"l2i", // "l2i", "l2f", // "l2f",
"l2f", // "l2f", "l2d", // "l2d",
"l2d", // "l2d", "f2i", // "f2i",
"f2i", // "f2i", "f2l", // "f2l",
"f2l", // "f2l", "f2d", // "f2d",
"f2d", // "f2d", "d2i", // "d2i",
"d2i", // "d2i", "d2l", // "d2l",
"d2l", // "d2l", "d2f", // "d2f",
"d2f", // "d2f", "i2b", // "i2b",
"i2b", // "i2b", "i2c", // "i2c",
"i2c", // "i2c", "i2s", // "i2s",
"i2s", // "i2s", "lcmp", // "lcmp",
"lcmp", // "lcmp", "fcmpl", // "fcmpl",
"fcmpl", // "fcmpl", "fcmpg", // "fcmpg",
"fcmpg", // "fcmpg", "dcmpl", // "dcmpl",
"dcmpl", // "dcmpl", "dcmpg", // "dcmpg",
"dcmpg", // "dcmpg", "ifeq", // "ifeq",
"ifeq", // "ifeq", "ifne", // "ifne",
"ifne", // "ifne", "iflt", // "iflt",
"iflt", // "iflt", "ifge", // "ifge",
"ifge", // "ifge", "ifgt", // "ifgt",
"ifgt", // "ifgt", "ifle", // "ifle",
"ifle", // "ifle", "if_icmpeq", // "if_icmpeq",
"if_icmpeq", // "if_icmpeq", "if_icmpne", // "if_icmpne",
"if_icmpne", // "if_icmpne", "if_icmplt", // "if_icmplt",
"if_icmplt", // "if_icmplt", "if_icmpge", // "if_icmpge",
"if_icmpge", // "if_icmpge", "if_icmpgt", // "if_icmpgt",
"if_icmpgt", // "if_icmpgt", "if_icmple", // "if_icmple",
"if_icmple", // "if_icmple", "if_acmpeq", // "if_acmpeq",
"if_acmpeq", // "if_acmpeq", "if_acmpne", // "if_acmpne",
"if_acmpne", // "if_acmpne", "goto", // "goto",
"goto", // "goto", "jsr", // "jsr",
"jsr", // "jsr", "ret", // "ret",
"ret", // "ret", "tableswitch", // "tableswitch",
"tableswitch", // "tableswitch", "lookupswitch", // "lookupswitch",
"lookupswitch", // "lookupswitch", "ireturn", // "ireturn",
"ireturn", // "ireturn", "lreturn", // "lreturn",
"lreturn", // "lreturn", "freturn", // "freturn",
"freturn", // "freturn", "dreturn", // "dreturn",
"dreturn", // "dreturn", "areturn", // "areturn",
"areturn", // "areturn", "return", // "return",
"return", // "return", "getstatic", // "getstatic",
"getstatic", // "getstatic", "putstatic", // "putstatic",
"putstatic", // "putstatic", "getfield", // "getfield",
"getfield", // "getfield", "putfield", // "putfield",
"putfield", // "putfield", "invokevirtual", // "invokevirtual",
"invokevirtual", // "invokevirtual", "invokespecial", // "invokespecial",
"invokespecial", // "invokespecial", "invokestatic", // "invokestatic",
"invokestatic", // "invokestatic", "invokeinterface", // "invokeinterface",
"invokeinterface", // "invokeinterface", //"xxxunusedxxx", // "xxxunusedxxx", Java 6 and before
//"xxxunusedxxx", // "xxxunusedxxx", Java 6 and before "invokedynamic", // "invokedynamic", Java 7 and later
"invokedynamic", // "invokedynamic", Java 7 and later "new", // "new",
"new", // "new", "newarray", // "newarray",
"newarray", // "newarray", "anewarray", // "anewarray",
"anewarray", // "anewarray", "arraylength", // "arraylength",
"arraylength", // "arraylength", "athrow", // "athrow",
"athrow", // "athrow", "checkcast", // "checkcast",
"checkcast", // "checkcast", "instanceof", // "instanceof",
"instanceof", // "instanceof", "monitorenter", // "monitorenter",
"monitorenter", // "monitorenter", "monitorexit", // "monitorexit",
"monitorexit", // "monitorexit", "wide", // "wide",
"wide", // "wide", "multianewarray", // "multianewarray",
"multianewarray", // "multianewarray", "ifnull", // "ifnull",
"ifnull", // "ifnull", "ifnonnull", // "ifnonnull",
"ifnonnull", // "ifnonnull", "goto_w", // "goto_w",
"goto_w", // "goto_w", "jsr_w" // "jsr_w"
"jsr_w" // "jsr_w" };
};
private static Class[] opcodeClasses = { private static Class[] opcodeClasses = {
null, // "nop", null, // "nop",
null, // "aconst_null", null, // "aconst_null",
null, // "iconst_m1", null, // "iconst_m1",
null, // "iconst_0", null, // "iconst_0",
null, // "iconst_1", null, // "iconst_1",
null, // "iconst_2", null, // "iconst_2",
null, // "iconst_3", null, // "iconst_3",
null, // "iconst_4", null, // "iconst_4",
null, // "iconst_5", null, // "iconst_5",
null, // "lconst_0", null, // "lconst_0",
null, // "lconst_1", null, // "lconst_1",
null, // "fconst_0", null, // "fconst_0",
null, // "fconst_1", null, // "fconst_1",
null, // "fconst_2", null, // "fconst_2",
null, // "dconst_0", null, // "dconst_0",
null, // "dconst_1", null, // "dconst_1",
BIPUSH.class, // "bipush", BIPUSH.class, // "bipush",
SIPUSH.class, // "sipush", SIPUSH.class, // "sipush",
LDC.class, // "ldc", LDC.class, // "ldc",
LDC_W.class, // "ldc_w", LDC_W.class, // "ldc_w",
LDC2_W.class, // "ldc2_w", LDC2_W.class, // "ldc2_w",
ILOAD.class, // "iload", ILOAD.class, // "iload",
LLOAD.class, // "lload", LLOAD.class, // "lload",
FLOAD.class, // "fload", FLOAD.class, // "fload",
DLOAD.class, // "dload", DLOAD.class, // "dload",
ALOAD.class, // "aload", ALOAD.class, // "aload",
null, // "iload_0", null, // "iload_0",
null, // "iload_1", null, // "iload_1",
null, // "iload_2", null, // "iload_2",
null, // "iload_3", null, // "iload_3",
null, // "lload_0", null, // "lload_0",
null, // "lload_1", null, // "lload_1",
null, // "lload_2", null, // "lload_2",
null, // "lload_3", null, // "lload_3",
null, // "fload_0", null, // "fload_0",
null, // "fload_1", null, // "fload_1",
null, // "fload_2", null, // "fload_2",
null, // "fload_3", null, // "fload_3",
null, // "dload_0", null, // "dload_0",
null, // "dload_1", null, // "dload_1",
null, // "dload_2", null, // "dload_2",
null, // "dload_3", null, // "dload_3",
null, // "aload_0", null, // "aload_0",
null, // "aload_1", null, // "aload_1",
null, // "aload_2", null, // "aload_2",
null, // "aload_3", null, // "aload_3",
null, // "iaload", null, // "iaload",
null, // "laload", null, // "laload",
null, // "faload", null, // "faload",
null, // "daload", null, // "daload",
null, // "aaload", null, // "aaload",
null, // "baload", null, // "baload",
null, // "caload", null, // "caload",
null, // "saload", null, // "saload",
ISTORE.class, // "istore", ISTORE.class, // "istore",
LSTORE.class, // "lstore", LSTORE.class, // "lstore",
FSTORE.class, // "fstore", FSTORE.class, // "fstore",
DSTORE.class, // "dstore", DSTORE.class, // "dstore",
ASTORE.class, // "astore", ASTORE.class, // "astore",
null, // "istore_0", null, // "istore_0",
null, // "istore_1", null, // "istore_1",
null, // "istore_2", null, // "istore_2",
null, // "istore_3", null, // "istore_3",
null, // "lstore_0", null, // "lstore_0",
null, // "lstore_1", null, // "lstore_1",
null, // "lstore_2", null, // "lstore_2",
null, // "lstore_3", null, // "lstore_3",
null, // "fstore_0", null, // "fstore_0",
null, // "fstore_1", null, // "fstore_1",
null, // "fstore_2", null, // "fstore_2",
null, // "fstore_3", null, // "fstore_3",
null, // "dstore_0", null, // "dstore_0",
null, // "dstore_1", null, // "dstore_1",
null, // "dstore_2", null, // "dstore_2",
null, // "dstore_3", null, // "dstore_3",
null, // "astore_0", null, // "astore_0",
null, // "astore_1", null, // "astore_1",
null, // "astore_2", null, // "astore_2",
null, // "astore_3", null, // "astore_3",
null, // "iastore", null, // "iastore",
null, // "lastore", null, // "lastore",
null, // "fastore", null, // "fastore",
null, // "dastore", null, // "dastore",
null, // "aastore", null, // "aastore",
null, // "bastore", null, // "bastore",
null, // "castore", null, // "castore",
null, // "sastore", null, // "sastore",
null, // "pop", null, // "pop",
null, // "pop2", null, // "pop2",
null, // "dup", null, // "dup",
null, // "dup_x1", null, // "dup_x1",
null, // "dup_x2", null, // "dup_x2",
null, // "dup2", null, // "dup2",
null, // "dup2_x1", null, // "dup2_x1",
null, // "dup2_x2", null, // "dup2_x2",
null, // "swap", null, // "swap",
null, // "iadd", null, // "iadd",
null, // "ladd", null, // "ladd",
null, // "fadd", null, // "fadd",
null, // "dadd", null, // "dadd",
null, // "isub", null, // "isub",
null, // "lsub", null, // "lsub",
null, // "fsub", null, // "fsub",
null, // "dsub", null, // "dsub",
null, // "imul", null, // "imul",
null, // "lmul", null, // "lmul",
null, // "fmul", null, // "fmul",
null, // "dmul", null, // "dmul",
null, // "idiv", null, // "idiv",
null, // "ldiv", null, // "ldiv",
null, // "fdiv", null, // "fdiv",
null, // "ddiv", null, // "ddiv",
null, // "irem", null, // "irem",
null, // "lrem", null, // "lrem",
null, // "frem", null, // "frem",
null, // "drem", null, // "drem",
null, // "ineg", null, // "ineg",
null, // "lneg", null, // "lneg",
null, // "fneg", null, // "fneg",
null, // "dneg", null, // "dneg",
null, // "ishl", null, // "ishl",
null, // "lshl", null, // "lshl",
null, // "ishr", null, // "ishr",
null, // "lshr", null, // "lshr",
null, // "iushr", null, // "iushr",
null, // "lushr", null, // "lushr",
null, // "iand", null, // "iand",
null, // "land", null, // "land",
null, // "ior", null, // "ior",
null, // "lor", null, // "lor",
null, // "ixor", null, // "ixor",
null, // "lxor", null, // "lxor",
IINC.class, // "iinc", IINC.class, // "iinc",
null, // "i2l", null, // "i2l",
null, // "i2f", null, // "i2f",
null, // "i2d", null, // "i2d",
null, // "l2i", null, // "l2i",
null, // "l2f", null, // "l2f",
null, // "l2d", null, // "l2d",
null, // "f2i", null, // "f2i",
null, // "f2l", null, // "f2l",
null, // "f2d", null, // "f2d",
null, // "d2i", null, // "d2i",
null, // "d2l", null, // "d2l",
null, // "d2f", null, // "d2f",
null, // "i2b", null, // "i2b",
null, // "i2c", null, // "i2c",
null, // "i2s", null, // "i2s",
null, // "lcmp", null, // "lcmp",
null, // "fcmpl", null, // "fcmpl",
null, // "fcmpg", null, // "fcmpg",
null, // "dcmpl", null, // "dcmpl",
null, // "dcmpg", null, // "dcmpg",
null, // "ifeq", null, // "ifeq",
null, // "ifne", null, // "ifne",
null, // "iflt", null, // "iflt",
null, // "ifge", null, // "ifge",
null, // "ifgt", null, // "ifgt",
null, // "ifle", null, // "ifle",
null, // "if_icmpeq", null, // "if_icmpeq",
null, // "if_icmpne", null, // "if_icmpne",
null, // "if_icmplt", null, // "if_icmplt",
null, // "if_icmpge", null, // "if_icmpge",
null, // "if_icmpgt", null, // "if_icmpgt",
null, // "if_icmple", null, // "if_icmple",
null, // "if_acmpeq", null, // "if_acmpeq",
null, // "if_acmpne", null, // "if_acmpne",
GOTO.class, // "goto", GOTO.class, // "goto",
JSR.class, // "jsr", JSR.class, // "jsr",
RET.class, // "ret", RET.class, // "ret",
TABLESWITCH.class, // "tableswitch", TABLESWITCH.class, // "tableswitch",
LOOKUPSWITCH.class, // "lookupswitch", LOOKUPSWITCH.class, // "lookupswitch",
null, // "ireturn", null, // "ireturn",
null, // "lreturn", null, // "lreturn",
null, // "freturn", null, // "freturn",
null, // "dreturn", null, // "dreturn",
null, // "areturn", null, // "areturn",
null, // "return", null, // "return",
GETSTATIC.class, // "getstatic", GETSTATIC.class, // "getstatic",
PUTSTATIC.class, // "putstatic", PUTSTATIC.class, // "putstatic",
GETFIELD.class, // "getfield", GETFIELD.class, // "getfield",
PUTFIELD.class, // "putfield", PUTFIELD.class, // "putfield",
INVOKEVIRTUAL.class, // "invokevirtual", INVOKEVIRTUAL.class, // "invokevirtual",
INVOKESPECIAL.class, // "invokespecial", INVOKESPECIAL.class, // "invokespecial",
INVOKESTATIC.class, // "invokestatic", INVOKESTATIC.class, // "invokestatic",
INVOKEINTERFACE.class, // "invokeinterface", INVOKEINTERFACE.class, // "invokeinterface",
INVOKEDYNAMIC.class, // "xxxunusedxxx" Java 6 and before, "invokedynamic" Java 7 and later INVOKEDYNAMIC.class, // "xxxunusedxxx" Java 6 and before, "invokedynamic" Java 7 and later
NEW.class, // "new", NEW.class, // "new",
NEWARRAY.class, // "newarray", NEWARRAY.class, // "newarray",
ANEWARRAY.class, // "anewarray", ANEWARRAY.class, // "anewarray",
null, // "arraylength", null, // "arraylength",
null, // "athrow", null, // "athrow",
CHECKCAST.class, // "checkcast", CHECKCAST.class, // "checkcast",
INSTANCEOF.class, // "instanceof", INSTANCEOF.class, // "instanceof",
null, // "monitorenter", null, // "monitorenter",
null, // "monitorexit", null, // "monitorexit",
null, // "wide", null, // "wide",
MULTIANEWARRAY.class, // "multianewarray", MULTIANEWARRAY.class, // "multianewarray",
null, // "ifnull", null, // "ifnull",
null, // "ifnonnull", null, // "ifnonnull",
GOTO_W.class, // "goto_w", GOTO_W.class, // "goto_w",
JSR_W.class // "jsr_w" JSR_W.class // "jsr_w"
}; };
} }

@ -1,62 +1,63 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
import org.jetbrains.java.decompiler.main.DecompilerContext;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.main.DecompilerContext;
public class ExceptionHandler { public class ExceptionHandler {
public int from = 0; public int from = 0;
public int to = 0; public int to = 0;
public int handler = 0; public int handler = 0;
public int from_instr = 0; public int from_instr = 0;
public int to_instr = 0; public int to_instr = 0;
public int handler_instr = 0; public int handler_instr = 0;
public int class_index = 0; public int class_index = 0;
public String exceptionClass = null; public String exceptionClass = null;
public ExceptionHandler(){} public ExceptionHandler() {
}
public ExceptionHandler(int from_raw, int to_raw, int handler_raw, String exceptionClass) {
this.from = from_raw; public ExceptionHandler(int from_raw, int to_raw, int handler_raw, String exceptionClass) {
this.to = to_raw; this.from = from_raw;
this.handler = handler_raw; this.to = to_raw;
this.exceptionClass = exceptionClass; this.handler = handler_raw;
} this.exceptionClass = exceptionClass;
}
public void writeToStream(DataOutputStream out) throws IOException {
out.writeShort(from); public void writeToStream(DataOutputStream out) throws IOException {
out.writeShort(to); out.writeShort(from);
out.writeShort(handler); out.writeShort(to);
out.writeShort(class_index); out.writeShort(handler);
} out.writeShort(class_index);
}
public String toString() {
public String toString() {
String new_line_separator = DecompilerContext.getNewLineSeparator();
String new_line_separator = DecompilerContext.getNewLineSeparator();
StringBuffer buf = new StringBuffer();
buf.append("from: "+from+" to: "+to+" handler: "+handler+new_line_separator); StringBuffer buf = new StringBuffer();
buf.append("from_instr: "+from_instr+" to_instr: "+to_instr+" handler_instr: "+handler_instr+new_line_separator); buf.append("from: " + from + " to: " + to + " handler: " + handler + new_line_separator);
buf.append("exceptionClass: "+exceptionClass+new_line_separator); buf.append("from_instr: " + from_instr + " to_instr: " + to_instr + " handler_instr: " + handler_instr + new_line_separator);
return buf.toString(); buf.append("exceptionClass: " + exceptionClass + new_line_separator);
} return buf.toString();
}
} }

@ -1,57 +1,58 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
import java.util.ArrayList;
import java.util.List;
import org.jetbrains.java.decompiler.code.interpreter.Util; import org.jetbrains.java.decompiler.code.interpreter.Util;
import org.jetbrains.java.decompiler.struct.StructContext; import org.jetbrains.java.decompiler.struct.StructContext;
import java.util.ArrayList;
import java.util.List;
public class ExceptionTable { public class ExceptionTable {
private List<ExceptionHandler> handlers = new ArrayList<ExceptionHandler>(); private List<ExceptionHandler> handlers = new ArrayList<ExceptionHandler>();
public ExceptionTable() {} public ExceptionTable() {
}
public ExceptionTable(List<ExceptionHandler> handlers) {
this.handlers = handlers; public ExceptionTable(List<ExceptionHandler> handlers) {
} this.handlers = handlers;
}
public ExceptionHandler getHandlerByClass(StructContext context, int line, String valclass, boolean withany) {
public ExceptionHandler getHandlerByClass(StructContext context, int line, String valclass, boolean withany) {
ExceptionHandler res = null; // no handler found
ExceptionHandler res = null; // no handler found
for(ExceptionHandler handler : handlers) {
if(handler.from<=line && handler.to>line) { for (ExceptionHandler handler : handlers) {
String name = handler.exceptionClass; if (handler.from <= line && handler.to > line) {
String name = handler.exceptionClass;
if((withany && name==null) || // any -> finally or synchronized handler
(name!=null && Util.instanceOf(context, valclass, name))) { if ((withany && name == null) || // any -> finally or synchronized handler
res = handler; (name != null && Util.instanceOf(context, valclass, name))) {
break; res = handler;
} break;
} }
} }
}
return res;
} return res;
}
public List<ExceptionHandler> getHandlers() {
return handlers; public List<ExceptionHandler> getHandlers() {
} return handlers;
}
} }

@ -1,17 +1,18 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
import org.jetbrains.java.decompiler.util.VBStyleCollection; import org.jetbrains.java.decompiler.util.VBStyleCollection;
@ -19,20 +20,19 @@ import org.jetbrains.java.decompiler.util.VBStyleCollection;
public class FullInstructionSequence extends InstructionSequence { public class FullInstructionSequence extends InstructionSequence {
// ***************************************************************************** // *****************************************************************************
// constructors // constructors
// ***************************************************************************** // *****************************************************************************
public FullInstructionSequence(VBStyleCollection<Instruction, Integer> collinstr, ExceptionTable extable) { public FullInstructionSequence(VBStyleCollection<Instruction, Integer> collinstr, ExceptionTable extable) {
this.collinstr = collinstr; this.collinstr = collinstr;
this.exceptionTable = extable; this.exceptionTable = extable;
// translate raw exception handlers to instr
for(ExceptionHandler handler : extable.getHandlers()) {
handler.from_instr = this.getPointerByAbsOffset(handler.from);
handler.to_instr = this.getPointerByAbsOffset(handler.to);
handler.handler_instr = this.getPointerByAbsOffset(handler.handler);
}
}
// translate raw exception handlers to instr
for (ExceptionHandler handler : extable.getHandlers()) {
handler.from_instr = this.getPointerByAbsOffset(handler.from);
handler.to_instr = this.getPointerByAbsOffset(handler.to);
handler.handler_instr = this.getPointerByAbsOffset(handler.handler);
}
}
} }

@ -1,17 +1,18 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
import java.io.DataOutputStream; import java.io.DataOutputStream;
@ -24,13 +25,12 @@ import java.io.IOException;
public class IfInstruction extends JumpInstruction { public class IfInstruction extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opcode); out.writeByte(opcode);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,17 +1,18 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
import java.io.DataOutputStream; import java.io.DataOutputStream;
@ -19,106 +20,107 @@ import java.io.IOException;
public class Instruction implements CodeConstants { public class Instruction implements CodeConstants {
// ***************************************************************************** // *****************************************************************************
// public fields // public fields
// ***************************************************************************** // *****************************************************************************
public int opcode; public int opcode;
public int group = CodeConstants.GROUP_GENERAL; public int group = CodeConstants.GROUP_GENERAL;
public boolean wide = false; public boolean wide = false;
public int bytecode_version = BYTECODE_JAVA_LE_4; public int bytecode_version = BYTECODE_JAVA_LE_4;
// ***************************************************************************** // *****************************************************************************
// private fields // private fields
// ***************************************************************************** // *****************************************************************************
private int[] operands = null; private int[] operands = null;
// ***************************************************************************** // *****************************************************************************
// public methods // public methods
// ***************************************************************************** // *****************************************************************************
public Instruction() {} public Instruction() {
}
public int length() {
return 1; public int length() {
} return 1;
}
public int operandsCount() {
return (operands==null)?0:operands.length; public int operandsCount() {
} return (operands == null) ? 0 : operands.length;
}
public int getOperand(int index) {
return operands[index]; public int getOperand(int index) {
} return operands[index];
}
public Instruction clone() {
return ConstantsUtil.getInstructionInstance(opcode, wide, group, bytecode_version, operands==null?null:(int[])operands.clone()); public Instruction clone() {
} return ConstantsUtil.getInstructionInstance(opcode, wide, group, bytecode_version, operands == null ? null : (int[])operands.clone());
}
public String toString() {
public String toString() {
String res = wide?"@wide ":"";
res+="@"+ConstantsUtil.getName(opcode); String res = wide ? "@wide " : "";
res += "@" + ConstantsUtil.getName(opcode);
int len = operandsCount();
for(int i=0;i<len;i++) { int len = operandsCount();
int op = operands[i]; for (int i = 0; i < len; i++) {
if(op<0) { int op = operands[i];
res+=" -"+Integer.toHexString(-op); if (op < 0) {
} else { res += " -" + Integer.toHexString(-op);
res+=" "+Integer.toHexString(op); }
} else {
} res += " " + Integer.toHexString(op);
}
return res; }
} return res;
}
public boolean canFallthrough() {
return opcode!=opc_goto && opcode!=opc_goto_w && opcode!=opc_ret && public boolean canFallthrough() {
!(opcode>=opc_ireturn && opcode<=opc_return) && opcode!=opc_athrow return opcode != opc_goto && opcode != opc_goto_w && opcode != opc_ret &&
&& opcode!=opc_jsr && opcode!=opc_tableswitch && opcode!=opc_lookupswitch; !(opcode >= opc_ireturn && opcode <= opc_return) && opcode != opc_athrow
} && opcode != opc_jsr && opcode != opc_tableswitch && opcode != opc_lookupswitch;
}
public boolean equalsInstruction(Instruction instr) {
if(opcode != instr.opcode || wide != instr.wide public boolean equalsInstruction(Instruction instr) {
|| operandsCount() != instr.operandsCount()) { if (opcode != instr.opcode || wide != instr.wide
return false; || operandsCount() != instr.operandsCount()) {
} return false;
}
if(operands != null) {
for(int i=0;i<operands.length;i++) { if (operands != null) {
if(operands[i] != instr.getOperand(i)) { for (int i = 0; i < operands.length; i++) {
return false; if (operands[i] != instr.getOperand(i)) {
} return false;
} }
} }
}
return true;
} return true;
}
// should be overwritten by subclasses
public void initInstruction(InstructionSequence seq) {} // should be overwritten by subclasses
public void initInstruction(InstructionSequence seq) {
// should be overwritten by subclasses }
public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opcode); // should be overwritten by subclasses
} public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opcode);
// ***************************************************************************** }
// getter and setter methods
// ***************************************************************************** // *****************************************************************************
// getter and setter methods
public int[] getOperands() { // *****************************************************************************
return operands;
} public int[] getOperands() {
return operands;
public void setOperands(int[] operands) { }
this.operands = operands;
} public void setOperands(int[] operands) {
this.operands = operands;
}
} }

@ -1,219 +1,227 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.jetbrains.java.decompiler.code.interpreter.Util; import org.jetbrains.java.decompiler.code.interpreter.Util;
import org.jetbrains.java.decompiler.main.DecompilerContext; import org.jetbrains.java.decompiler.main.DecompilerContext;
import org.jetbrains.java.decompiler.struct.StructContext; import org.jetbrains.java.decompiler.struct.StructContext;
import org.jetbrains.java.decompiler.util.InterpreterUtil; import org.jetbrains.java.decompiler.util.InterpreterUtil;
import org.jetbrains.java.decompiler.util.VBStyleCollection; import org.jetbrains.java.decompiler.util.VBStyleCollection;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public abstract class InstructionSequence { public abstract class InstructionSequence {
// ***************************************************************************** // *****************************************************************************
// private fields // private fields
// ***************************************************************************** // *****************************************************************************
protected VBStyleCollection<Instruction, Integer> collinstr = new VBStyleCollection<Instruction, Integer>(); protected VBStyleCollection<Instruction, Integer> collinstr = new VBStyleCollection<Instruction, Integer>();
protected int pointer = 0; protected int pointer = 0;
protected ExceptionTable exceptionTable = new ExceptionTable(); protected ExceptionTable exceptionTable = new ExceptionTable();
// ***************************************************************************** // *****************************************************************************
// public methods // public methods
// ***************************************************************************** // *****************************************************************************
// to nbe overwritten // to nbe overwritten
public InstructionSequence clone() {return null;} public InstructionSequence clone() {
return null;
public void clear() { }
collinstr.clear();
pointer = 0; public void clear() {
exceptionTable = new ExceptionTable(); collinstr.clear();
} pointer = 0;
exceptionTable = new ExceptionTable();
public void addInstruction(Instruction inst, int offset){ }
collinstr.addWithKey(inst, offset);
} public void addInstruction(Instruction inst, int offset) {
collinstr.addWithKey(inst, offset);
public void addInstruction(int index, Instruction inst, int offset){ }
collinstr.addWithKeyAndIndex(index, inst, offset);
} public void addInstruction(int index, Instruction inst, int offset) {
collinstr.addWithKeyAndIndex(index, inst, offset);
public void addSequence(InstructionSequence seq){ }
for(int i=0;i<seq.length();i++) {
addInstruction(seq.getInstr(i), -1); // TODO: any sensible value possible? public void addSequence(InstructionSequence seq) {
} for (int i = 0; i < seq.length(); i++) {
} addInstruction(seq.getInstr(i), -1); // TODO: any sensible value possible?
}
public void removeInstruction(int index) { }
collinstr.remove(index);
} public void removeInstruction(int index) {
collinstr.remove(index);
public Instruction getCurrentInstr() { }
return (Instruction)collinstr.get(pointer);
} public Instruction getCurrentInstr() {
return (Instruction)collinstr.get(pointer);
public Instruction getInstr(int index) { }
return (Instruction)collinstr.get(index);
} public Instruction getInstr(int index) {
return (Instruction)collinstr.get(index);
public Instruction getLastInstr() { }
return (Instruction)collinstr.getLast();
} public Instruction getLastInstr() {
return (Instruction)collinstr.getLast();
public int getCurrentOffset() { }
return ((Integer)collinstr.getKey(pointer)).intValue();
} public int getCurrentOffset() {
return ((Integer)collinstr.getKey(pointer)).intValue();
public int getOffset(int index) { }
return ((Integer)collinstr.getKey(index)).intValue();
} public int getOffset(int index) {
return ((Integer)collinstr.getKey(index)).intValue();
public int getPointerByAbsOffset(int offset) { }
Integer absoffset = new Integer(offset);
if(collinstr.containsKey(absoffset)) { public int getPointerByAbsOffset(int offset) {
return collinstr.getIndexByKey(absoffset); Integer absoffset = new Integer(offset);
} else { if (collinstr.containsKey(absoffset)) {
return -1; return collinstr.getIndexByKey(absoffset);
} }
} else {
return -1;
public int getPointerByRelOffset(int offset) { }
Integer absoffset = new Integer(((Integer)collinstr.getKey(pointer)).intValue()+offset); }
if(collinstr.containsKey(absoffset)) {
return collinstr.getIndexByKey(absoffset); public int getPointerByRelOffset(int offset) {
} else { Integer absoffset = new Integer(((Integer)collinstr.getKey(pointer)).intValue() + offset);
return -1; if (collinstr.containsKey(absoffset)) {
} return collinstr.getIndexByKey(absoffset);
} }
else {
public void setPointerByAbsOffset(int offset) { return -1;
Integer absoffset = new Integer(((Integer)collinstr.getKey(pointer)).intValue()+offset); }
if(collinstr.containsKey(absoffset)) { }
pointer = collinstr.getIndexByKey(absoffset);
} public void setPointerByAbsOffset(int offset) {
} Integer absoffset = new Integer(((Integer)collinstr.getKey(pointer)).intValue() + offset);
if (collinstr.containsKey(absoffset)) {
public int length() { pointer = collinstr.getIndexByKey(absoffset);
return collinstr.size(); }
} }
public boolean isEmpty() { public int length() {
return collinstr.isEmpty(); return collinstr.size();
} }
public void addToPointer(int diff) { public boolean isEmpty() {
this.pointer += diff; return collinstr.isEmpty();
} }
public String toString() { public void addToPointer(int diff) {
return toString(0); this.pointer += diff;
} }
public String toString(int indent) { public String toString() {
return toString(0);
String new_line_separator = DecompilerContext.getNewLineSeparator(); }
StringBuffer buf = new StringBuffer(); public String toString(int indent) {
for(int i=0;i<collinstr.size();i++) { String new_line_separator = DecompilerContext.getNewLineSeparator();
buf.append(InterpreterUtil.getIndentString(indent));
buf.append(((Integer)collinstr.getKey(i)).intValue()); StringBuffer buf = new StringBuffer();
buf.append(": ");
buf.append(((Instruction)collinstr.get(i)).toString()); for (int i = 0; i < collinstr.size(); i++) {
buf.append(new_line_separator); buf.append(InterpreterUtil.getIndentString(indent));
} buf.append(((Integer)collinstr.getKey(i)).intValue());
buf.append(": ");
return buf.toString(); buf.append(((Instruction)collinstr.get(i)).toString());
} buf.append(new_line_separator);
}
public void writeCodeToStream(DataOutputStream out) throws IOException {
return buf.toString();
for(int i=0;i<collinstr.size();i++) { }
((Instruction)collinstr.get(i)).writeToStream(out, ((Integer)collinstr.getKey(i)).intValue());
} public void writeCodeToStream(DataOutputStream out) throws IOException {
}
for (int i = 0; i < collinstr.size(); i++) {
public void writeExceptionsToStream(DataOutputStream out) throws IOException { ((Instruction)collinstr.get(i)).writeToStream(out, ((Integer)collinstr.getKey(i)).intValue());
}
List<ExceptionHandler> handlers = exceptionTable.getHandlers(); }
out.writeShort(handlers.size()); public void writeExceptionsToStream(DataOutputStream out) throws IOException {
for(int i=0;i<handlers.size();i++) {
((ExceptionHandler)handlers.get(i)).writeToStream(out); List<ExceptionHandler> handlers = exceptionTable.getHandlers();
}
} out.writeShort(handlers.size());
for (int i = 0; i < handlers.size(); i++) {
public void sortHandlers(final StructContext context) { ((ExceptionHandler)handlers.get(i)).writeToStream(out);
}
Collections.sort(exceptionTable.getHandlers(), new Comparator<ExceptionHandler>() { }
public int compare(ExceptionHandler handler0, ExceptionHandler handler1) { public void sortHandlers(final StructContext context) {
if(handler0.to == handler1.to) { Collections.sort(exceptionTable.getHandlers(), new Comparator<ExceptionHandler>() {
if(handler0.exceptionClass == null) {
return 1; public int compare(ExceptionHandler handler0, ExceptionHandler handler1) {
} else {
if(handler1.exceptionClass == null) { if (handler0.to == handler1.to) {
return -1; if (handler0.exceptionClass == null) {
} else if(handler0.exceptionClass.equals(handler1.exceptionClass)){ return 1;
return (handler0.from > handler1.from)?-1:1; // invalid code }
} else { else {
if(Util.instanceOf(context, handler0.exceptionClass, handler1.exceptionClass)) { if (handler1.exceptionClass == null) {
return -1; return -1;
} else { }
return 1; else if (handler0.exceptionClass.equals(handler1.exceptionClass)) {
} return (handler0.from > handler1.from) ? -1 : 1; // invalid code
} }
} else {
} else { if (Util.instanceOf(context, handler0.exceptionClass, handler1.exceptionClass)) {
return (handler0.to > handler1.to)?1:-1; return -1;
} }
} else {
}); return 1;
}
} }
}
}
// ***************************************************************************** else {
// getter and setter methods return (handler0.to > handler1.to) ? 1 : -1;
// ***************************************************************************** }
}
public int getPointer() { });
return pointer; }
}
public void setPointer(int pointer) { // *****************************************************************************
this.pointer = pointer; // getter and setter methods
} // *****************************************************************************
public ExceptionTable getExceptionTable() { public int getPointer() {
return exceptionTable; return pointer;
} }
public void setExceptionTable(ExceptionTable exceptionTable) { public void setPointer(int pointer) {
this.exceptionTable = exceptionTable; this.pointer = pointer;
} }
public ExceptionTable getExceptionTable() {
return exceptionTable;
}
public void setExceptionTable(ExceptionTable exceptionTable) {
this.exceptionTable = exceptionTable;
}
} }

@ -1,17 +1,18 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
/* /*
@ -23,19 +24,19 @@ package org.jetbrains.java.decompiler.code;
public class JumpInstruction extends Instruction { public class JumpInstruction extends Instruction {
public int destination; public int destination;
public JumpInstruction() {} public JumpInstruction() {
}
public void initInstruction(InstructionSequence seq) {
destination = seq.getPointerByRelOffset(this.getOperand(0)); public void initInstruction(InstructionSequence seq) {
} destination = seq.getPointerByRelOffset(this.getOperand(0));
}
public JumpInstruction clone() {
JumpInstruction newinstr = (JumpInstruction)super.clone(); public JumpInstruction clone() {
JumpInstruction newinstr = (JumpInstruction)super.clone();
newinstr.destination = destination;
return newinstr; newinstr.destination = destination;
} return newinstr;
}
} }

@ -1,39 +1,39 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
import org.jetbrains.java.decompiler.util.VBStyleCollection; import org.jetbrains.java.decompiler.util.VBStyleCollection;
public class SimpleInstructionSequence extends InstructionSequence { public class SimpleInstructionSequence extends InstructionSequence {
public SimpleInstructionSequence() {} public SimpleInstructionSequence() {
}
public SimpleInstructionSequence(VBStyleCollection<Instruction, Integer> collinstr) {
this.collinstr = collinstr;
}
public SimpleInstructionSequence clone() {
SimpleInstructionSequence newseq = new SimpleInstructionSequence(collinstr.clone());
newseq.setPointer(this.getPointer());
public SimpleInstructionSequence(VBStyleCollection<Instruction, Integer> collinstr) { return newseq;
this.collinstr = collinstr; }
}
public SimpleInstructionSequence clone() {
SimpleInstructionSequence newseq = new SimpleInstructionSequence(collinstr.clone());
newseq.setPointer(this.getPointer());
return newseq;
}
public void removeInstruction(int index) { public void removeInstruction(int index) {
collinstr.remove(index); collinstr.remove(index);
} }
} }

@ -1,17 +1,18 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code; package org.jetbrains.java.decompiler.code;
/* /*
@ -20,74 +21,77 @@ package org.jetbrains.java.decompiler.code;
public class SwitchInstruction extends Instruction { public class SwitchInstruction extends Instruction {
private int[] destinations; private int[] destinations;
private int[] values; private int[] values;
private int defaultdest; private int defaultdest;
public SwitchInstruction() {} public SwitchInstruction() {
}
public void initInstruction(InstructionSequence seq) {
public void initInstruction(InstructionSequence seq) {
int pref = (opcode==CodeConstants.opc_tableswitch?3:2);
int len = this.getOperands().length - pref; int pref = (opcode == CodeConstants.opc_tableswitch ? 3 : 2);
defaultdest = seq.getPointerByRelOffset(this.getOperand(0)); int len = this.getOperands().length - pref;
defaultdest = seq.getPointerByRelOffset(this.getOperand(0));
int low = 0;
int low = 0;
if(opcode==CodeConstants.opc_lookupswitch) {
len/=2; if (opcode == CodeConstants.opc_lookupswitch) {
} else { len /= 2;
low = this.getOperand(1); }
} else {
low = this.getOperand(1);
destinations = new int[len]; }
values = new int[len];
destinations = new int[len];
for(int i=0,k=0;i<len;i++,k++) { values = new int[len];
if(opcode==CodeConstants.opc_lookupswitch){
values[i] = this.getOperand(pref+k); for (int i = 0, k = 0; i < len; i++, k++) {
k++; if (opcode == CodeConstants.opc_lookupswitch) {
} else { values[i] = this.getOperand(pref + k);
values[i] = low+k; k++;
} }
destinations[i] = seq.getPointerByRelOffset(this.getOperand(pref+k)); else {
} values[i] = low + k;
} }
destinations[i] = seq.getPointerByRelOffset(this.getOperand(pref + k));
public SwitchInstruction clone() { }
SwitchInstruction newinstr = (SwitchInstruction)super.clone(); }
newinstr.defaultdest = defaultdest; public SwitchInstruction clone() {
newinstr.destinations = destinations.clone(); SwitchInstruction newinstr = (SwitchInstruction)super.clone();
newinstr.values = values.clone();
newinstr.defaultdest = defaultdest;
return newinstr; newinstr.destinations = destinations.clone();
} newinstr.values = values.clone();
public int[] getDestinations() { return newinstr;
return destinations; }
}
public int[] getDestinations() {
public void setDestinations(int[] destinations) { return destinations;
this.destinations = destinations; }
}
public void setDestinations(int[] destinations) {
public int getDefaultdest() { this.destinations = destinations;
return defaultdest; }
}
public int getDefaultdest() {
public void setDefaultdest(int defaultdest) { return defaultdest;
this.defaultdest = defaultdest; }
}
public void setDefaultdest(int defaultdest) {
public int[] getValues() { this.defaultdest = defaultdest;
return values; }
}
public int[] getValues() {
public void setValues(int[] values) { return values;
this.values = values; }
}
public void setValues(int[] values) {
this.values = values;
}
} }

@ -1,265 +1,266 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code.cfg; package org.jetbrains.java.decompiler.code.cfg;
import java.util.ArrayList;
import java.util.List;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;
import org.jetbrains.java.decompiler.code.InstructionSequence; import org.jetbrains.java.decompiler.code.InstructionSequence;
import org.jetbrains.java.decompiler.code.SimpleInstructionSequence; import org.jetbrains.java.decompiler.code.SimpleInstructionSequence;
import org.jetbrains.java.decompiler.main.DecompilerContext; import org.jetbrains.java.decompiler.main.DecompilerContext;
import org.jetbrains.java.decompiler.modules.decompiler.decompose.IGraphNode; import org.jetbrains.java.decompiler.modules.decompiler.decompose.IGraphNode;
import java.util.ArrayList;
import java.util.List;
public class BasicBlock implements IGraphNode { public class BasicBlock implements IGraphNode {
// ***************************************************************************** // *****************************************************************************
// public fields // public fields
// ***************************************************************************** // *****************************************************************************
public int id = 0; public int id = 0;
public int mark = 0; public int mark = 0;
// ***************************************************************************** // *****************************************************************************
// private fields // private fields
// ***************************************************************************** // *****************************************************************************
private InstructionSequence seq = new SimpleInstructionSequence(); private InstructionSequence seq = new SimpleInstructionSequence();
private List<BasicBlock> preds = new ArrayList<BasicBlock>(); private List<BasicBlock> preds = new ArrayList<BasicBlock>();
private List<BasicBlock> succs = new ArrayList<BasicBlock>(); private List<BasicBlock> succs = new ArrayList<BasicBlock>();
private List<Integer> instrOldOffsets = new ArrayList<Integer>(); private List<Integer> instrOldOffsets = new ArrayList<Integer>();
private List<BasicBlock> predExceptions = new ArrayList<BasicBlock>(); private List<BasicBlock> predExceptions = new ArrayList<BasicBlock>();
private List<BasicBlock> succExceptions = new ArrayList<BasicBlock>(); private List<BasicBlock> succExceptions = new ArrayList<BasicBlock>();
public BasicBlock() {
public BasicBlock() {} }
public BasicBlock(int id) { public BasicBlock(int id) {
this.id = id; this.id = id;
} }
// ***************************************************************************** // *****************************************************************************
// public methods // public methods
// ***************************************************************************** // *****************************************************************************
public Object clone() { public Object clone() {
BasicBlock block = new BasicBlock(); BasicBlock block = new BasicBlock();
block.id = id; block.id = id;
block.setSeq(seq.clone()); block.setSeq(seq.clone());
block.setInstrOldOffsets(new ArrayList<Integer>(instrOldOffsets)); block.setInstrOldOffsets(new ArrayList<Integer>(instrOldOffsets));
return block; return block;
} }
public void free() { public void free() {
preds.clear(); preds.clear();
succs.clear(); succs.clear();
instrOldOffsets.clear(); instrOldOffsets.clear();
succExceptions.clear(); succExceptions.clear();
seq = new SimpleInstructionSequence(); seq = new SimpleInstructionSequence();
} }
public Instruction getInstruction(int index) { public Instruction getInstruction(int index) {
return seq.getInstr(index); return seq.getInstr(index);
} }
public Instruction getLastInstruction() { public Instruction getLastInstruction() {
if(seq.isEmpty()) { if (seq.isEmpty()) {
return null; return null;
} else { }
return seq.getLastInstr(); else {
} return seq.getLastInstr();
} }
}
public int size() {
return seq.length(); public int size() {
} return seq.length();
}
public void addPredecessor(BasicBlock block) {
preds.add(block); public void addPredecessor(BasicBlock block) {
} preds.add(block);
}
public void removePredecessor(BasicBlock block) {
while(preds.remove(block)); public void removePredecessor(BasicBlock block) {
} while (preds.remove(block)) ;
}
public void addSuccessor(BasicBlock block) {
succs.add(block); public void addSuccessor(BasicBlock block) {
block.addPredecessor(this); succs.add(block);
} block.addPredecessor(this);
}
public void removeSuccessor(BasicBlock block) {
while(succs.remove(block)); public void removeSuccessor(BasicBlock block) {
block.removePredecessor(this); while (succs.remove(block)) ;
} block.removePredecessor(this);
}
// FIXME: unify block comparisons: id or direkt equality
public void replaceSuccessor(BasicBlock oldBlock, BasicBlock newBlock) { // FIXME: unify block comparisons: id or direkt equality
for(int i=0;i<succs.size();i++) { public void replaceSuccessor(BasicBlock oldBlock, BasicBlock newBlock) {
if(succs.get(i).id == oldBlock.id) { for (int i = 0; i < succs.size(); i++) {
succs.set(i, newBlock); if (succs.get(i).id == oldBlock.id) {
oldBlock.removePredecessor(this); succs.set(i, newBlock);
newBlock.addPredecessor(this); oldBlock.removePredecessor(this);
} newBlock.addPredecessor(this);
} }
}
for(int i=0;i<succExceptions.size();i++) {
if(succExceptions.get(i).id == oldBlock.id) { for (int i = 0; i < succExceptions.size(); i++) {
succExceptions.set(i, newBlock); if (succExceptions.get(i).id == oldBlock.id) {
oldBlock.removePredecessorException(this); succExceptions.set(i, newBlock);
newBlock.addPredecessorException(this); oldBlock.removePredecessorException(this);
} newBlock.addPredecessorException(this);
} }
} }
}
public void addPredecessorException(BasicBlock block) {
predExceptions.add(block); public void addPredecessorException(BasicBlock block) {
} predExceptions.add(block);
}
public void removePredecessorException(BasicBlock block) {
while(predExceptions.remove(block)); public void removePredecessorException(BasicBlock block) {
} while (predExceptions.remove(block)) ;
}
public void addSuccessorException(BasicBlock block) {
if(!succExceptions.contains(block)) { public void addSuccessorException(BasicBlock block) {
succExceptions.add(block); if (!succExceptions.contains(block)) {
block.addPredecessorException(this); succExceptions.add(block);
} block.addPredecessorException(this);
} }
}
public void removeSuccessorException(BasicBlock block) {
while(succExceptions.remove(block)); public void removeSuccessorException(BasicBlock block) {
block.removePredecessorException(this); while (succExceptions.remove(block)) ;
} block.removePredecessorException(this);
}
public String toString() {
return toString(0); public String toString() {
} return toString(0);
}
public String toString(int indent) {
public String toString(int indent) {
String new_line_separator = DecompilerContext.getNewLineSeparator();
String new_line_separator = DecompilerContext.getNewLineSeparator();
return id+":" + new_line_separator +seq.toString(indent);
} return id + ":" + new_line_separator + seq.toString(indent);
}
public String toStringOldIndices() {
public String toStringOldIndices() {
String new_line_separator = DecompilerContext.getNewLineSeparator();
String new_line_separator = DecompilerContext.getNewLineSeparator();
StringBuffer buf = new StringBuffer();
StringBuffer buf = new StringBuffer();
for(int i=0;i<seq.length();i++) {
if(i<instrOldOffsets.size()) { for (int i = 0; i < seq.length(); i++) {
buf.append(instrOldOffsets.get(i)); if (i < instrOldOffsets.size()) {
} else { buf.append(instrOldOffsets.get(i));
buf.append("-1"); }
} else {
buf.append(": "); buf.append("-1");
buf.append(seq.getInstr(i).toString()); }
buf.append(new_line_separator); buf.append(": ");
} buf.append(seq.getInstr(i).toString());
buf.append(new_line_separator);
return buf.toString(); }
}
return buf.toString();
public boolean isSuccessor(BasicBlock block) { }
for(BasicBlock succ : succs) {
if(succ.id == block.id) { public boolean isSuccessor(BasicBlock block) {
return true; for (BasicBlock succ : succs) {
} if (succ.id == block.id) {
} return true;
return false; }
} }
return false;
public boolean isPredecessor(BasicBlock block) { }
for(int i=0;i<preds.size();i++) {
if(preds.get(i).id == block.id) { public boolean isPredecessor(BasicBlock block) {
return true; for (int i = 0; i < preds.size(); i++) {
} if (preds.get(i).id == block.id) {
} return true;
return false; }
} }
return false;
// ***************************************************************************** }
// getter and setter methods
// ***************************************************************************** // *****************************************************************************
// getter and setter methods
public List<Integer> getInstrOldOffsets() { // *****************************************************************************
return instrOldOffsets;
} public List<Integer> getInstrOldOffsets() {
return instrOldOffsets;
public void setInstrOldOffsets(List<Integer> instrInds) { }
this.instrOldOffsets = instrInds;
} public void setInstrOldOffsets(List<Integer> instrInds) {
this.instrOldOffsets = instrInds;
public List<? extends IGraphNode> getPredecessors() { }
List<BasicBlock> lst = new ArrayList<BasicBlock>(preds);
lst.addAll(predExceptions); public List<? extends IGraphNode> getPredecessors() {
return lst; List<BasicBlock> lst = new ArrayList<BasicBlock>(preds);
} lst.addAll(predExceptions);
return lst;
public List<BasicBlock> getPreds() { }
return preds;
} public List<BasicBlock> getPreds() {
return preds;
public void setPreds(List<BasicBlock> preds) { }
this.preds = preds;
} public void setPreds(List<BasicBlock> preds) {
this.preds = preds;
public InstructionSequence getSeq() { }
return seq;
} public InstructionSequence getSeq() {
return seq;
public void setSeq(InstructionSequence seq) { }
this.seq = seq;
} public void setSeq(InstructionSequence seq) {
this.seq = seq;
public List<BasicBlock> getSuccs() { }
return succs;
} public List<BasicBlock> getSuccs() {
return succs;
public void setSuccs(List<BasicBlock> succs) { }
this.succs = succs;
} public void setSuccs(List<BasicBlock> succs) {
this.succs = succs;
}
public List<BasicBlock> getSuccExceptions() {
return succExceptions;
} public List<BasicBlock> getSuccExceptions() {
return succExceptions;
}
public void setSuccExceptions(List<BasicBlock> succExceptions) {
this.succExceptions = succExceptions;
} public void setSuccExceptions(List<BasicBlock> succExceptions) {
this.succExceptions = succExceptions;
public List<BasicBlock> getPredExceptions() { }
return predExceptions;
} public List<BasicBlock> getPredExceptions() {
return predExceptions;
public void setPredExceptions(List<BasicBlock> predExceptions) { }
this.predExceptions = predExceptions;
} public void setPredExceptions(List<BasicBlock> predExceptions) {
this.predExceptions = predExceptions;
}
} }

@ -1,128 +1,129 @@
/* /*
* Fernflower - The Analytical Java Decompiler * Copyright 2000-2014 JetBrains s.r.o.
* http://www.reversed-java.com
* *
* (C) 2008 - 2010, Stiver * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* *
* This software is NEITHER public domain NOR free software * http://www.apache.org/licenses/LICENSE-2.0
* as per GNU License. See license.txt for more details.
* *
* This software is distributed WITHOUT ANY WARRANTY; without * Unless required by applicable law or agreed to in writing, software
* even the implied warranty of MERCHANTABILITY or FITNESS FOR * distributed under the License is distributed on an "AS IS" BASIS,
* A PARTICULAR PURPOSE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.java.decompiler.code.cfg; package org.jetbrains.java.decompiler.code.cfg;
import org.jetbrains.java.decompiler.main.DecompilerContext;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.jetbrains.java.decompiler.main.DecompilerContext;
public class ExceptionRangeCFG { public class ExceptionRangeCFG {
private List<BasicBlock> protectedRange = new ArrayList<BasicBlock>(); // FIXME: replace with set private List<BasicBlock> protectedRange = new ArrayList<BasicBlock>(); // FIXME: replace with set
private BasicBlock handler; private BasicBlock handler;
private List<String> exceptionTypes; private List<String> exceptionTypes;
public ExceptionRangeCFG(List<BasicBlock> protectedRange, BasicBlock handler, List<String> exceptionType) { public ExceptionRangeCFG(List<BasicBlock> protectedRange, BasicBlock handler, List<String> exceptionType) {
this.protectedRange = protectedRange; this.protectedRange = protectedRange;
this.handler = handler; this.handler = handler;
if(exceptionType != null) { if (exceptionType != null) {
this.exceptionTypes = new ArrayList<String>(exceptionType); this.exceptionTypes = new ArrayList<String>(exceptionType);
} }
} }
public boolean isCircular() { public boolean isCircular() {
return protectedRange.contains(handler); return protectedRange.contains(handler);
} }
public String toString() { public String toString() {
String new_line_separator = DecompilerContext.getNewLineSeparator(); String new_line_separator = DecompilerContext.getNewLineSeparator();
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
buf.append("exceptionType:"); buf.append("exceptionType:");
for(String exception_type : exceptionTypes) { for (String exception_type : exceptionTypes) {
buf.append(" "+exception_type); buf.append(" " + exception_type);
} }
buf.append(new_line_separator); buf.append(new_line_separator);
buf.append("handler: "+handler.id+new_line_separator); buf.append("handler: " + handler.id + new_line_separator);
buf.append("range: "); buf.append("range: ");
for(int i=0;i<protectedRange.size();i++) { for (int i = 0; i < protectedRange.size(); i++) {
buf.append(protectedRange.get(i).id+" "); buf.append(protectedRange.get(i).id + " ");
} }
buf.append(new_line_separator); buf.append(new_line_separator);
return buf.toString(); return buf.toString();
} }
public BasicBlock getHandler() { public BasicBlock getHandler() {
return handler; return handler;
} }
public void setHandler(BasicBlock handler) { public void setHandler(BasicBlock handler) {
this.handler = handler; this.handler = handler;
} }
public List<BasicBlock> getProtectedRange() { public List<BasicBlock> getProtectedRange() {
return protectedRange; return protectedRange;
} }
public void setProtectedRange(List<BasicBlock> protectedRange) { public void setProtectedRange(List<BasicBlock> protectedRange) {
this.protectedRange = protectedRange; this.protectedRange = protectedRange;
} }
public List<String> getExceptionTypes() { public List<String> getExceptionTypes() {
return this.exceptionTypes; return this.exceptionTypes;
} }
public void addExceptionType(String exceptionType) { public void addExceptionType(String exceptionType) {
if(this.exceptionTypes == null) { if (this.exceptionTypes == null) {
return; return;
} }
if(exceptionType == null) { if (exceptionType == null) {
this.exceptionTypes = null; this.exceptionTypes = null;
} else { }
this.exceptionTypes.add(exceptionType); else {
} this.exceptionTypes.add(exceptionType);
} }
}
public String getUniqueExceptionsString() {
public String getUniqueExceptionsString() {
if(exceptionTypes == null) {
return null; if (exceptionTypes == null) {
} return null;
}
Set<String> setExceptionStrings = new HashSet<String>();
Set<String> setExceptionStrings = new HashSet<String>();
for(String exceptionType : exceptionTypes) { // normalize order
setExceptionStrings.add(exceptionType); for (String exceptionType : exceptionTypes) { // normalize order
} setExceptionStrings.add(exceptionType);
}
String ret = "";
for(String exception : setExceptionStrings) { String ret = "";
if(!ret.isEmpty()) { for (String exception : setExceptionStrings) {
ret += ":"; if (!ret.isEmpty()) {
} ret += ":";
ret += exception; }
} ret += exception;
}
return ret;
} return ret;
}
// public void setExceptionType(String exceptionType) {
// this.exceptionType = exceptionType; // public void setExceptionType(String exceptionType) {
// } // this.exceptionType = exceptionType;
// }
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,43 +1,60 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class ALOAD extends 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 { private static int[] opcodes = new int[]{opc_aload_0, opc_aload_1, opc_aload_2, opc_aload_3};
int index = getOperand(0);
if(index>3) { public void writeToStream(DataOutputStream out, int offset) throws IOException {
if(wide) { int index = getOperand(0);
out.writeByte(opc_wide); if (index > 3) {
} if (wide) {
out.writeByte(opc_aload); out.writeByte(opc_wide);
if(wide) { }
out.writeShort(index); out.writeByte(opc_aload);
} else { if (wide) {
out.writeByte(index); out.writeShort(index);
} }
} else { else {
out.writeByte(opcodes[index]); out.writeByte(index);
} }
} }
else {
public int length() { out.writeByte(opcodes[index]);
int index = getOperand(0); }
if(index>3) { }
if(wide) {
return 4;
} else {
return 2;
}
} else {
return 1;
}
}
public int length() {
int index = getOperand(0);
if (index > 3) {
if (wide) {
return 4;
}
else {
return 2;
}
}
else {
return 1;
}
}
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class ANEWARRAY extends Instruction { public class ANEWARRAY extends Instruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_anewarray); out.writeByte(opc_anewarray);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,42 +1,60 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class ASTORE extends Instruction { public class ASTORE extends Instruction {
private static int[] opcodes = new int[] {opc_astore_0,opc_astore_1,opc_astore_2,opc_astore_3}; 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 { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);
if(index>3) { if (index > 3) {
if(wide) { if (wide) {
out.writeByte(opc_wide); out.writeByte(opc_wide);
} }
out.writeByte(opc_astore); out.writeByte(opc_astore);
if(wide) { if (wide) {
out.writeShort(index); out.writeShort(index);
} else { }
out.writeByte(index); else {
} out.writeByte(index);
} else { }
out.writeByte(opcodes[index]); }
} else {
} out.writeByte(opcodes[index]);
}
public int length() { }
int index = getOperand(0);
if(index>3) { public int length() {
if(wide) { int index = getOperand(0);
return 4; if (index > 3) {
} else { if (wide) {
return 2; return 4;
} }
} else { else {
return 1; return 2;
} }
} }
else {
return 1;
}
}
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,7 +1,22 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;
public class BALOAD extends Instruction { public class BALOAD extends Instruction {
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,30 +1,48 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class BIPUSH extends 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}; 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); public void writeToStream(DataOutputStream out, int offset) throws IOException {
if(value<-1 || value > 5) { int value = getOperand(0);
out.writeByte(opc_bipush); if (value < -1 || value > 5) {
out.writeByte(value); out.writeByte(opc_bipush);
} else { out.writeByte(value);
out.writeByte(opcodes[value+1]); }
} else {
} out.writeByte(opcodes[value + 1]);
}
public int length() { }
int value = getOperand(0);
if(value<-1 || value > 5) { public int length() {
return 2; int value = getOperand(0);
} else { if (value < -1 || value > 5) {
return 1; return 2;
} }
} else {
return 1;
}
}
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,20 +1,34 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class CHECKCAST extends Instruction { public class CHECKCAST extends Instruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_checkcast); out.writeByte(opc_checkcast);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,42 +1,60 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class DLOAD extends Instruction { public class DLOAD extends Instruction {
private static int[] opcodes = new int[] {opc_dload_0,opc_dload_1,opc_dload_2,opc_dload_3}; 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 { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);
if(index>3) { if (index > 3) {
if(wide) { if (wide) {
out.writeByte(opc_wide); out.writeByte(opc_wide);
} }
out.writeByte(opc_dload); out.writeByte(opc_dload);
if(wide) { if (wide) {
out.writeShort(index); out.writeShort(index);
} else { }
out.writeByte(index); else {
} out.writeByte(index);
} else { }
out.writeByte(opcodes[index]); }
} else {
} out.writeByte(opcodes[index]);
}
public int length() { }
int index = getOperand(0);
if(index>3) { public int length() {
if(wide) { int index = getOperand(0);
return 4; if (index > 3) {
} else { if (wide) {
return 2; return 4;
} }
} else { else {
return 1; return 2;
} }
} }
else {
return 1;
}
}
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,41 +1,60 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class DSTORE extends Instruction { public class DSTORE extends Instruction {
private static int[] opcodes = new int[] {opc_dstore_0,opc_dstore_1,opc_dstore_2,opc_dstore_3}; 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 { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);
if(index>3) { if (index > 3) {
if(wide) { if (wide) {
out.writeByte(opc_wide); out.writeByte(opc_wide);
} }
out.writeByte(opc_dstore); out.writeByte(opc_dstore);
if(wide) { if (wide) {
out.writeShort(index); out.writeShort(index);
} else { }
out.writeByte(index); else {
} out.writeByte(index);
} else { }
out.writeByte(opcodes[index]); }
} else {
} out.writeByte(opcodes[index]);
}
public int length() { }
int index = getOperand(0);
if(index>3) { public int length() {
if(wide) { int index = getOperand(0);
return 4; if (index > 3) {
} else { if (wide) {
return 2; return 4;
} }
} else { else {
return 1; return 2;
} }
} }
else {
return 1;
}
}
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,7 +1,22 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;
public class DUP_X2 extends Instruction { public class DUP_X2 extends Instruction {
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,42 +1,60 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class FLOAD extends Instruction { public class FLOAD extends Instruction {
private static int[] opcodes = new int[] {opc_fload_0,opc_fload_1,opc_fload_2,opc_fload_3}; 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 { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);
if(index>3) { if (index > 3) {
if(wide) { if (wide) {
out.writeByte(opc_wide); out.writeByte(opc_wide);
} }
out.writeByte(opc_fload); out.writeByte(opc_fload);
if(wide) { if (wide) {
out.writeShort(index); out.writeShort(index);
} else { }
out.writeByte(index); else {
} out.writeByte(index);
} else { }
out.writeByte(opcodes[index]); }
} else {
} out.writeByte(opcodes[index]);
}
public int length() { }
int index = getOperand(0);
if(index>3) { public int length() {
if(wide) { int index = getOperand(0);
return 4; if (index > 3) {
} else { if (wide) {
return 2; return 4;
} }
} else { else {
return 1; return 2;
} }
} }
else {
return 1;
}
}
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,41 +1,60 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class FSTORE extends Instruction { public class FSTORE extends Instruction {
private static int[] opcodes = new int[] {opc_fstore_0,opc_fstore_1,opc_fstore_2,opc_fstore_3}; 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 { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int index = getOperand(0); int index = getOperand(0);
if(index>3) { if (index > 3) {
if(wide) { if (wide) {
out.writeByte(opc_wide); out.writeByte(opc_wide);
} }
out.writeByte(opc_fstore); out.writeByte(opc_fstore);
if(wide) { if (wide) {
out.writeShort(index); out.writeShort(index);
} else { }
out.writeByte(index); else {
} out.writeByte(index);
} else { }
out.writeByte(opcodes[index]); }
} else {
} out.writeByte(opcodes[index]);
}
public int length() { }
int index = getOperand(0);
if(index>3) { public int length() {
if(wide) { int index = getOperand(0);
return 4; if (index > 3) {
} else { if (wide) {
return 2; return 4;
} }
} else { else {
return 1; return 2;
} }
} }
else {
return 1;
}
}
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,18 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class GETFIELD extends Instruction { public class GETFIELD extends Instruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_getfield); out.writeByte(opc_getfield);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.Instruction;
public class GETSTATIC extends Instruction { public class GETSTATIC extends Instruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_getstatic); out.writeByte(opc_getstatic);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,30 +1,46 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class GOTO extends JumpInstruction { public class GOTO extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
int operand = getOperand(0); int operand = getOperand(0);
if(operand < -32768 || operand > 32767) { if (operand < -32768 || operand > 32767) {
out.writeByte(opc_goto_w); out.writeByte(opc_goto_w);
out.writeInt(operand); out.writeInt(operand);
} else { }
out.writeByte(opc_goto); else {
out.writeShort(operand); out.writeByte(opc_goto);
} out.writeShort(operand);
} }
}
public int length() {
int operand = getOperand(0); public int length() {
if(operand < -32768 || operand > 32767) { int operand = getOperand(0);
return 5; if (operand < -32768 || operand > 32767) {
} else { return 5;
return 3; }
} else {
} return 3;
}
}
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class GOTO_W extends JumpInstruction { public class GOTO_W extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_goto_w); out.writeByte(opc_goto_w);
out.writeInt(getOperand(0)); out.writeInt(getOperand(0));
} }
public int length() { public int length() {
return 5; return 5;
} }
} }

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.Instruction; import org.jetbrains.java.decompiler.code.Instruction;

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IFEQ extends JumpInstruction { public class IFEQ extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_ifeq); out.writeByte(opc_ifeq);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IFGE extends JumpInstruction { public class IFGE extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_ifge); out.writeByte(opc_ifge);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IFGT extends JumpInstruction { public class IFGT extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_ifgt); out.writeByte(opc_ifgt);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IFLE extends JumpInstruction { public class IFLE extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_ifle); out.writeByte(opc_ifle);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IFLT extends JumpInstruction { public class IFLT extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_iflt); out.writeByte(opc_iflt);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IFNE extends JumpInstruction { public class IFNE extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_ifne); out.writeByte(opc_ifne);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IFNONNULL extends JumpInstruction { public class IFNONNULL extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_ifnonnull); out.writeByte(opc_ifnonnull);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IFNULL extends JumpInstruction { public class IFNULL extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_ifnull); out.writeByte(opc_ifnull);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,20 +1,34 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IF_ACMPEQ extends JumpInstruction { public class IF_ACMPEQ extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_if_acmpeq); out.writeByte(opc_if_acmpeq);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IF_ACMPNE extends JumpInstruction { public class IF_ACMPNE extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_if_acmpne); out.writeByte(opc_if_acmpne);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IF_ICMPEQ extends JumpInstruction { public class IF_ICMPEQ extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_if_icmpeq); out.writeByte(opc_if_icmpeq);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IF_ICMPGE extends JumpInstruction { public class IF_ICMPGE extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_if_icmpge); out.writeByte(opc_if_icmpge);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

@ -1,19 +1,33 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.java.decompiler.code.instructions; package org.jetbrains.java.decompiler.code.instructions;
import org.jetbrains.java.decompiler.code.JumpInstruction;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import org.jetbrains.java.decompiler.code.JumpInstruction;
public class IF_ICMPGT extends JumpInstruction { public class IF_ICMPGT extends JumpInstruction {
public void writeToStream(DataOutputStream out, int offset) throws IOException { public void writeToStream(DataOutputStream out, int offset) throws IOException {
out.writeByte(opc_if_icmpgt); out.writeByte(opc_if_icmpgt);
out.writeShort(getOperand(0)); out.writeShort(getOperand(0));
} }
public int length() { public int length() {
return 3; return 3;
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save