Returns a JVM instruction opcode adapted to this Type. This method must not be used for method types. @param opcode a JVM instruction opcode. This opcode must be one of ILOAD, ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL, ISHR, IUSHR, IAND, IOR, IXOR and IRETURN
(final int opcode)
| 779 | * FRETURN. |
| 780 | */ |
| 781 | public int getOpcode(final int opcode) { |
| 782 | if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) { |
| 783 | switch (sort) { |
| 784 | case BOOLEAN: |
| 785 | case BYTE: |
| 786 | return opcode + (Opcodes.BALOAD - Opcodes.IALOAD); |
| 787 | case CHAR: |
| 788 | return opcode + (Opcodes.CALOAD - Opcodes.IALOAD); |
| 789 | case SHORT: |
| 790 | return opcode + (Opcodes.SALOAD - Opcodes.IALOAD); |
| 791 | case INT: |
| 792 | return opcode; |
| 793 | case FLOAT: |
| 794 | return opcode + (Opcodes.FALOAD - Opcodes.IALOAD); |
| 795 | case LONG: |
| 796 | return opcode + (Opcodes.LALOAD - Opcodes.IALOAD); |
| 797 | case DOUBLE: |
| 798 | return opcode + (Opcodes.DALOAD - Opcodes.IALOAD); |
| 799 | case ARRAY: |
| 800 | case OBJECT: |
| 801 | case INTERNAL: |
| 802 | return opcode + (Opcodes.AALOAD - Opcodes.IALOAD); |
| 803 | case METHOD: |
| 804 | case VOID: |
| 805 | throw new UnsupportedOperationException(); |
| 806 | default: |
| 807 | throw new AssertionError(); |
| 808 | } |
| 809 | } else { |
| 810 | switch (sort) { |
| 811 | case VOID: |
| 812 | if (opcode != Opcodes.IRETURN) { |
| 813 | throw new UnsupportedOperationException(); |
| 814 | } |
| 815 | return Opcodes.RETURN; |
| 816 | case BOOLEAN: |
| 817 | case BYTE: |
| 818 | case CHAR: |
| 819 | case SHORT: |
| 820 | case INT: |
| 821 | return opcode; |
| 822 | case FLOAT: |
| 823 | return opcode + (Opcodes.FRETURN - Opcodes.IRETURN); |
| 824 | case LONG: |
| 825 | return opcode + (Opcodes.LRETURN - Opcodes.IRETURN); |
| 826 | case DOUBLE: |
| 827 | return opcode + (Opcodes.DRETURN - Opcodes.IRETURN); |
| 828 | case ARRAY: |
| 829 | case OBJECT: |
| 830 | case INTERNAL: |
| 831 | if (opcode != Opcodes.ILOAD && opcode != Opcodes.ISTORE && opcode != Opcodes.IRETURN) { |
| 832 | throw new UnsupportedOperationException(); |
| 833 | } |
| 834 | return opcode + (Opcodes.ARETURN - Opcodes.IRETURN); |
| 835 | case METHOD: |
| 836 | throw new UnsupportedOperationException(); |
| 837 | default: |
| 838 | throw new AssertionError(); |
no outgoing calls
no test coverage detected