Java Code Examples for org.objectweb.asm.Opcodes#RET
The following examples show how to use
org.objectweb.asm.Opcodes#RET .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenerationPass.java From maple-ir with GNU General Public License v3.0 | 6 votes |
static boolean isExitOpcode(int opcode) { switch(opcode) { case Opcodes.RET: case Opcodes.ATHROW: case Opcodes.RETURN: case Opcodes.IRETURN: case Opcodes.LRETURN: case Opcodes.FRETURN: case Opcodes.DRETURN: case Opcodes.ARETURN: { return true; } default: { return false; } } }
Example 2
Source File: LocalVariablesSorter.java From Concurnas with MIT License | 5 votes |
@Override public void visitVarInsn(final int opcode, final int var) { Type varType; switch (opcode) { case Opcodes.LLOAD: case Opcodes.LSTORE: varType = Type.LONG_TYPE; break; case Opcodes.DLOAD: case Opcodes.DSTORE: varType = Type.DOUBLE_TYPE; break; case Opcodes.FLOAD: case Opcodes.FSTORE: varType = Type.FLOAT_TYPE; break; case Opcodes.ILOAD: case Opcodes.ISTORE: varType = Type.INT_TYPE; break; case Opcodes.ALOAD: case Opcodes.ASTORE: case Opcodes.RET: varType = OBJECT_TYPE; break; default: throw new IllegalArgumentException("Invalid opcode " + opcode); } super.visitVarInsn(opcode, remap(var, varType)); }
Example 3
Source File: InstructionAdapter.java From Concurnas with MIT License | 5 votes |
@Override public void visitVarInsn(final int opcode, final int var) { switch (opcode) { case Opcodes.ILOAD: load(var, Type.INT_TYPE); break; case Opcodes.LLOAD: load(var, Type.LONG_TYPE); break; case Opcodes.FLOAD: load(var, Type.FLOAT_TYPE); break; case Opcodes.DLOAD: load(var, Type.DOUBLE_TYPE); break; case Opcodes.ALOAD: load(var, OBJECT_TYPE); break; case Opcodes.ISTORE: store(var, Type.INT_TYPE); break; case Opcodes.LSTORE: store(var, Type.LONG_TYPE); break; case Opcodes.FSTORE: store(var, Type.FLOAT_TYPE); break; case Opcodes.DSTORE: store(var, Type.DOUBLE_TYPE); break; case Opcodes.ASTORE: store(var, OBJECT_TYPE); break; case Opcodes.RET: ret(var); break; default: throw new IllegalArgumentException(); } }
Example 4
Source File: RejectionMethodVisitor.java From AVM with MIT License | 5 votes |
private void checkOpcode(int opcode) { if (false // We reject JSR and RET (although these haven't been generated in a long time, anyway, and aren't allowed in new class files). || (Opcodes.JSR == opcode) || (Opcodes.RET == opcode) // We also want to reject instructions which could interact with the thread state: MONITORENTER, MONITOREXIT. || (Opcodes.MONITORENTER == opcode) || (Opcodes.MONITOREXIT == opcode) ) { RejectedClassException.blacklistedOpcode(opcode); } }
Example 5
Source File: LocalVariablesSorter.java From JByteMod-Beta with GNU General Public License v2.0 | 5 votes |
@Override public void visitVarInsn(final int opcode, final int var) { Type varType; switch (opcode) { case Opcodes.LLOAD: case Opcodes.LSTORE: varType = Type.LONG_TYPE; break; case Opcodes.DLOAD: case Opcodes.DSTORE: varType = Type.DOUBLE_TYPE; break; case Opcodes.FLOAD: case Opcodes.FSTORE: varType = Type.FLOAT_TYPE; break; case Opcodes.ILOAD: case Opcodes.ISTORE: varType = Type.INT_TYPE; break; case Opcodes.ALOAD: case Opcodes.ASTORE: case Opcodes.RET: varType = OBJECT_TYPE; break; default: throw new IllegalArgumentException("Invalid opcode " + opcode); } super.visitVarInsn(opcode, remap(var, varType)); }
Example 6
Source File: InstructionAdapter.java From JByteMod-Beta with GNU General Public License v2.0 | 5 votes |
@Override public void visitVarInsn(final int opcode, final int var) { switch (opcode) { case Opcodes.ILOAD: load(var, Type.INT_TYPE); break; case Opcodes.LLOAD: load(var, Type.LONG_TYPE); break; case Opcodes.FLOAD: load(var, Type.FLOAT_TYPE); break; case Opcodes.DLOAD: load(var, Type.DOUBLE_TYPE); break; case Opcodes.ALOAD: load(var, OBJECT_TYPE); break; case Opcodes.ISTORE: store(var, Type.INT_TYPE); break; case Opcodes.LSTORE: store(var, Type.LONG_TYPE); break; case Opcodes.FSTORE: store(var, Type.FLOAT_TYPE); break; case Opcodes.DSTORE: store(var, Type.DOUBLE_TYPE); break; case Opcodes.ASTORE: store(var, OBJECT_TYPE); break; case Opcodes.RET: ret(var); break; default: throw new IllegalArgumentException(); } }
Example 7
Source File: LocalVariablesSorter.java From JReFrameworker with MIT License | 5 votes |
@Override public void visitVarInsn(final int opcode, final int var) { Type varType; switch (opcode) { case Opcodes.LLOAD: case Opcodes.LSTORE: varType = Type.LONG_TYPE; break; case Opcodes.DLOAD: case Opcodes.DSTORE: varType = Type.DOUBLE_TYPE; break; case Opcodes.FLOAD: case Opcodes.FSTORE: varType = Type.FLOAT_TYPE; break; case Opcodes.ILOAD: case Opcodes.ISTORE: varType = Type.INT_TYPE; break; case Opcodes.ALOAD: case Opcodes.ASTORE: case Opcodes.RET: varType = OBJECT_TYPE; break; default: throw new IllegalArgumentException("Invalid opcode " + opcode); } super.visitVarInsn(opcode, remap(var, varType)); }
Example 8
Source File: InstructionAdapter.java From JReFrameworker with MIT License | 5 votes |
@Override public void visitVarInsn(final int opcode, final int var) { switch (opcode) { case Opcodes.ILOAD: load(var, Type.INT_TYPE); break; case Opcodes.LLOAD: load(var, Type.LONG_TYPE); break; case Opcodes.FLOAD: load(var, Type.FLOAT_TYPE); break; case Opcodes.DLOAD: load(var, Type.DOUBLE_TYPE); break; case Opcodes.ALOAD: load(var, OBJECT_TYPE); break; case Opcodes.ISTORE: store(var, Type.INT_TYPE); break; case Opcodes.LSTORE: store(var, Type.LONG_TYPE); break; case Opcodes.FSTORE: store(var, Type.FLOAT_TYPE); break; case Opcodes.DSTORE: store(var, Type.DOUBLE_TYPE); break; case Opcodes.ASTORE: store(var, OBJECT_TYPE); break; case Opcodes.RET: ret(var); break; default: throw new IllegalArgumentException(); } }
Example 9
Source File: LocalVariablesSorter.java From JReFrameworker with MIT License | 5 votes |
@Override public void visitVarInsn(final int opcode, final int var) { Type varType; switch (opcode) { case Opcodes.LLOAD: case Opcodes.LSTORE: varType = Type.LONG_TYPE; break; case Opcodes.DLOAD: case Opcodes.DSTORE: varType = Type.DOUBLE_TYPE; break; case Opcodes.FLOAD: case Opcodes.FSTORE: varType = Type.FLOAT_TYPE; break; case Opcodes.ILOAD: case Opcodes.ISTORE: varType = Type.INT_TYPE; break; case Opcodes.ALOAD: case Opcodes.ASTORE: case Opcodes.RET: varType = OBJECT_TYPE; break; default: throw new IllegalArgumentException("Invalid opcode " + opcode); } super.visitVarInsn(opcode, remap(var, varType)); }
Example 10
Source File: InstructionAdapter.java From JReFrameworker with MIT License | 5 votes |
@Override public void visitVarInsn(final int opcode, final int var) { switch (opcode) { case Opcodes.ILOAD: load(var, Type.INT_TYPE); break; case Opcodes.LLOAD: load(var, Type.LONG_TYPE); break; case Opcodes.FLOAD: load(var, Type.FLOAT_TYPE); break; case Opcodes.DLOAD: load(var, Type.DOUBLE_TYPE); break; case Opcodes.ALOAD: load(var, OBJECT_TYPE); break; case Opcodes.ISTORE: store(var, Type.INT_TYPE); break; case Opcodes.LSTORE: store(var, Type.LONG_TYPE); break; case Opcodes.FSTORE: store(var, Type.FLOAT_TYPE); break; case Opcodes.DSTORE: store(var, Type.DOUBLE_TYPE); break; case Opcodes.ASTORE: store(var, OBJECT_TYPE); break; case Opcodes.RET: ret(var); break; default: throw new IllegalArgumentException(); } }
Example 11
Source File: JVMImpl.java From serianalyzer with GNU General Public License v3.0 | 4 votes |
/** * @param opcode * @param var * @param s */ static void handleVarInsn ( int opcode, int var, JVMStackState s ) { Set<BaseType> v; switch ( opcode ) { case Opcodes.LLOAD: case Opcodes.ILOAD: case Opcodes.FLOAD: case Opcodes.DLOAD: case Opcodes.ALOAD: v = s.getVariable(var); if ( log.isTraceEnabled() ) { log.trace("LOAD " + opcode + "@" + var + ":" + v); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } if ( v == null || v.isEmpty() ) { s.push(new BasicVariable(toType(opcode), "unknown " + var, true)); //$NON-NLS-1$ } else if ( v.size() == 1 ) { s.push(v.iterator().next()); } else { Set<BaseType> alts = new HashSet<>(); for ( BaseType o : v ) { if ( o instanceof MultiAlternatives && ! ( (MultiAlternatives) o ).getAlternatives().isEmpty() ) { alts.addAll( ( (MultiAlternatives) o ).getAlternatives()); } else { alts.add(o); } } s.push(new MultiAlternatives(alts)); } break; case Opcodes.LSTORE: case Opcodes.ISTORE: case Opcodes.FSTORE: case Opcodes.DSTORE: case Opcodes.ASTORE: s.getVariable(var).add(s.pop()); break; case Opcodes.RET: break; default: log.warn("Unimplemented opcode " + opcode); //$NON-NLS-1$ } }
Example 12
Source File: MethodVisitorBuilder.java From testability-explorer with Apache License 2.0 | 4 votes |
public void visitVarInsn(final int opcode, final int var) { switch (opcode) { case Opcodes.ILOAD : load(var, JavaType.INT); break; case Opcodes.LLOAD : load(var, JavaType.LONG); break; case Opcodes.FLOAD : load(var, JavaType.FLOAT); break; case Opcodes.DLOAD : load(var, JavaType.DOUBLE); break; case Opcodes.ALOAD : load(var, JavaType.OBJECT); break; case Opcodes.ISTORE : store(var, JavaType.INT); break; case Opcodes.LSTORE : store(var, JavaType.LONG); break; case Opcodes.FSTORE : store(var, JavaType.FLOAT); break; case Opcodes.DSTORE : store(var, JavaType.DOUBLE); break; case Opcodes.ASTORE : store(var, JavaType.OBJECT); break; case Opcodes.RET : recorder.add(new Runnable() { public void run() { block.addOp(new RetSub(lineNumber)); } }); break; default : throw new UnsupportedOperationException("opcode: " + opcode); } }
Example 13
Source File: VarOp.java From CodenameOne with GNU General Public License v2.0 | 4 votes |
@Override public void appendInstruction(StringBuilder b) { b.append(" "); switch(opcode) { case Opcodes.ILOAD: b.append("(*SP).type = CN1_TYPE_INT; /* ILOAD */ \n" + " (*SP).data.i = ilocals_"); b.append(var); b.append("_; \n SP++;\n"); return; case Opcodes.LLOAD: b.append("BC_LLOAD("); break; case Opcodes.FLOAD: b.append("BC_FLOAD("); break; case Opcodes.DLOAD: b.append("BC_DLOAD("); break; case Opcodes.ALOAD: b.append("BC_ALOAD("); break; case Opcodes.ISTORE: b.append("BC_ISTORE("); break; case Opcodes.LSTORE: b.append("BC_LSTORE("); break; case Opcodes.FSTORE: b.append("BC_FSTORE("); break; case Opcodes.DSTORE: b.append("BC_DSTORE("); break; case Opcodes.ASTORE: b.append("BC_ASTORE("); break; case Opcodes.RET: b.append("/* RET TODO */"); //b.append("goto label_"); //b.append(var); //b.append("; /* RET */\n"); return; case Opcodes.SIPUSH: case Opcodes.BIPUSH: b.append("PUSH_INT("); break; case Opcodes.NEWARRAY: switch(var) { case 4: // boolean b.append("PUSH_OBJ(allocArray(threadStateData, POP_INT(), &class_array1__JAVA_BOOLEAN, sizeof(JAVA_ARRAY_BOOLEAN), 1));\n"); break; case 5: // char b.append("PUSH_OBJ(allocArray(threadStateData, POP_INT(), &class_array1__JAVA_CHAR, sizeof(JAVA_ARRAY_CHAR), 1));\n"); break; case 6: // float b.append("PUSH_OBJ(allocArray(threadStateData, POP_INT(), &class_array1__JAVA_FLOAT, sizeof(JAVA_ARRAY_FLOAT), 1));\n"); break; case 7: // double b.append("PUSH_OBJ(allocArray(threadStateData, POP_INT(), &class_array1__JAVA_DOUBLE, sizeof(JAVA_ARRAY_DOUBLE), 1));\n"); break; case 8: // byte b.append("PUSH_OBJ(allocArray(threadStateData, POP_INT(), &class_array1__JAVA_BYTE, sizeof(JAVA_ARRAY_BYTE), 1));\n"); break; case 9: // short b.append("PUSH_OBJ(allocArray(threadStateData, POP_INT(), &class_array1__JAVA_SHORT, sizeof(JAVA_ARRAY_SHORT), 1));\n"); break; case 10: // int b.append("PUSH_OBJ(allocArray(threadStateData, POP_INT(), &class_array1__JAVA_INT, sizeof(JAVA_ARRAY_INT), 1));\n"); break; case 11: // long b.append("PUSH_OBJ(allocArray(threadStateData, POP_INT(), &class_array1__JAVA_LONG, sizeof(JAVA_ARRAY_LONG), 1));\n"); break; } return; default: throw new RuntimeException("Missing opcode: " + opcode); } b.append(var); b.append(");\n"); }