/** * Throws an exception when an invalid state is hit in a tableswitch */ private static void stateNotFound(final CodeAttribute c, final TableSwitchBuilder builder) { c.branchEnd(builder.getDefaultBranchEnd().get()); c.newInstruction(RuntimeException.class); c.dup(); c.ldc("Invalid character"); c.invokespecial(RuntimeException.class.getName(), "<init>", "(Ljava/lang/String;)V"); c.athrow(); }
ctor.getCodeAttribute().invokespecial(SerializationHackProxy.class.getName(), "<init>", "()V"); ctor.getCodeAttribute().returnInstruction();
public byte[] createTokenizer(final String[] httpVerbs, String[] httpVersions, String[] standardHeaders) { final String className = existingClassName + CLASS_NAME_SUFFIX; final ClassFile file = new ClassFile(className, existingClassName); final ClassMethod ctor = file.addMethod(AccessFlag.PUBLIC, "<init>", "V", DescriptorUtils.parameterDescriptors(constructorDescriptor)); ctor.getCodeAttribute().aload(0); ctor.getCodeAttribute().loadMethodParameters(); ctor.getCodeAttribute().invokespecial(existingClassName, "<init>", constructorDescriptor); ctor.getCodeAttribute().returnInstruction(); final ClassMethod sctor = file.addMethod(AccessFlag.PUBLIC | AccessFlag.STATIC, "<clinit>", "V"); final AtomicInteger fieldCounter = new AtomicInteger(1); sctor.getCodeAttribute().invokestatic(existingClassName, "httpStrings", "()" + DescriptorUtils.makeDescriptor(Map.class)); sctor.getCodeAttribute().astore(CONSTRUCTOR_HTTP_STRING_MAP_VAR); createStateMachines(httpVerbs, httpVersions, standardHeaders, className, file, sctor, fieldCounter); sctor.getCodeAttribute().returnInstruction(); return file.toBytecode(); }
c.invokespecial(BAD_REQUEST_EXCEPTION, "<init>", "()V"); c.athrow();
sc.ldc(state.soFar); sc.invokespecial(HTTP_STRING_CLASS, "<init>", "(Ljava/lang/String;)V"); sc.putstatic(file.getName(), state.httpStringFieldName, HTTP_STRING_DESCRIPTOR); sc.branchEnd(done);
c.invokespecial(BAD_REQUEST_EXCEPTION, "<init>", "()V"); c.athrow(); c.iconst(0); c.iload(STATE_POS_VAR); c.invokespecial(HTTP_STRING_CLASS, "<init>", "([BII)V"); stateMachine.handleOtherToken(c); c.invokespecial(BAD_REQUEST_EXCEPTION, "<init>", "()V"); c.athrow(); c.dupX1(); c.swap(); c.invokespecial(HTTP_STRING_CLASS, "<init>", "(Ljava/lang/String;)V"); stateMachine.handleOtherToken(c);
ctor.getCodeAttribute().invokespecial(superclass.getName(), "<init>", "()V"); ctor.getCodeAttribute().returnInstruction();
public void invokespecial(Method method) { if (Modifier.isStatic(method.getModifiers())) { throw new InvalidBytecodeException("Cannot use invokespacial to invoke a static method"); } invokespecial(method.getDeclaringClass().getName(), method.getName(), DescriptorUtils.methodDescriptor(method), DescriptorUtils.makeDescriptor(method.getReturnType()), DescriptorUtils.parameterDescriptors(method .getParameterTypes())); }
public void invokespecial(Method method) { if (Modifier.isStatic(method.getModifiers())) { throw new InvalidBytecodeException("Cannot use invokespacial to invoke a static method"); } invokespecial(method.getDeclaringClass().getName(), method.getName(), DescriptorUtils.methodDescriptor(method), DescriptorUtils.makeDescriptor(method.getReturnType()), DescriptorUtils.parameterDescriptors(method .getParameterTypes())); }
public void invokespecial(Method method) { if (Modifier.isStatic(method.getModifiers())) { throw new InvalidBytecodeException("Cannot use invokespacial to invoke a static method"); } invokespecial(method.getDeclaringClass().getName(), method.getName(), DescriptorUtils.methodDescriptor(method), DescriptorUtils.makeDescriptor(method.getReturnType()), DescriptorUtils.parameterDescriptors(method .getParameterTypes())); }
public void invokespecial(Method method) { if (Modifier.isStatic(method.getModifiers())) { throw new InvalidBytecodeException("Cannot use invokespacial to invoke a static method"); } invokespecial(method.getDeclaringClass().getName(), method.getName(), DescriptorUtils.methodDescriptor(method), DescriptorUtils.makeDescriptor(method.getReturnType()), DescriptorUtils.parameterDescriptors(method .getParameterTypes())); }
public void invokespecial(Method method) { if (Modifier.isStatic(method.getModifiers())) { throw new InvalidBytecodeException("Cannot use invokespacial to invoke a static method"); } invokespecial(method.getDeclaringClass().getName(), method.getName(), DescriptorUtils.methodDescriptor(method), DescriptorUtils.makeDescriptor(method.getReturnType()), DescriptorUtils.parameterDescriptors(method .getParameterTypes())); }
public void invokespecial(String className, String methodName, String descriptor) { String[] params = DescriptorUtils.parameterDescriptors(descriptor); String returnType = DescriptorUtils.returnType(descriptor); invokespecial(className, methodName, descriptor, returnType, params); }
public void invokespecial(String className, String methodName, String descriptor) { String[] params = DescriptorUtils.parameterDescriptors(descriptor); String returnType = DescriptorUtils.returnType(descriptor); invokespecial(className, methodName, descriptor, returnType, params); }
public void invokespecial(String className, String methodName, String descriptor) { String[] params = DescriptorUtils.parameterDescriptors(descriptor); String returnType = DescriptorUtils.returnType(descriptor); invokespecial(className, methodName, descriptor, returnType, params); }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }