@Override public void handleOtherToken(final CodeAttribute c) { c.aload(PARSE_STATE_VAR); c.swap(); c.dup(); c.invokestatic(CONNECTORS_CLASS, "verifyToken", "(" + HTTP_STRING_DESCRIPTOR + ")V"); c.putfield(parseStateClass, "nextHeader", HTTP_STRING_DESCRIPTOR); }
@Override public void handleOtherToken(final CodeAttribute c) { c.aload(HTTP_RESULT); c.swap(); c.dup(); c.invokestatic(CONNECTORS_CLASS, "verifyToken", "(" + HTTP_STRING_DESCRIPTOR + ")V"); c.invokevirtual(resultClass, "setRequestMethod", "(" + HTTP_STRING_DESCRIPTOR + ")" + HTTP_EXCHANGE_DESCRIPTOR); c.pop(); }
init.invokestatic(StubStrategy.class.getName(), "forMethod", "([Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/ClassLoader;)Lorg/wildfly/iiop/openjdk/rmi/marshal/strategy/StubStrategy;");
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(); }
clinit.invokestatic(stubClassName, init(methodIndex), "()V");
void startIfNotEmpty(CodeAttribute b, ClassMethod method) { b.invokestatic(INTERCEPTION_DECORATION_CONTEXT_CLASS_NAME, START_INTERCEPTOR_CONTEXT_IF_NOT_EMPTY_METHOD_NAME, RETURNS_STACK_DESCRIPTOR); // store the outcome so that we know later whether to end the context or not storeToLocalVariable(0); }
void startIfNotEmpty(CodeAttribute b, ClassMethod method) { b.invokestatic(INTERCEPTION_DECORATION_CONTEXT_CLASS_NAME, START_INTERCEPTOR_CONTEXT_IF_NOT_EMPTY_METHOD_NAME, RETURNS_STACK_DESCRIPTOR); // store the outcome so that we know later whether to end the context or not storeToLocalVariable(0); }
void startIfNotEmpty(CodeAttribute b, ClassMethod method) { b.invokestatic(INTERCEPTION_DECORATION_CONTEXT_CLASS_NAME, START_INTERCEPTOR_CONTEXT_IF_NOT_EMPTY_METHOD_NAME, RETURNS_STACK_DESCRIPTOR); // store the outcome so that we know later whether to end the context or not storeToLocalVariable(0); }
void startIfNotEmpty(CodeAttribute b, ClassMethod method) { b.invokestatic(INTERCEPTION_DECORATION_CONTEXT_CLASS_NAME, START_INTERCEPTOR_CONTEXT_IF_NOT_EMPTY_METHOD_NAME, RETURNS_STACK_DESCRIPTOR); // store the outcome so that we know later whether to end the context or not storeToLocalVariable(0); }
public void invokestatic(Method method) { if (!Modifier.isStatic(method.getModifiers())) { throw new InvalidBytecodeException("Cannot use invokestatic to invoke a non static method"); } invokestatic(method.getDeclaringClass().getName(), method.getName(), DescriptorUtils.methodDescriptor(method), DescriptorUtils.makeDescriptor(method.getReturnType()), DescriptorUtils.parameterDescriptors(method .getParameterTypes())); }
public void invokestatic(Method method) { if (!Modifier.isStatic(method.getModifiers())) { throw new InvalidBytecodeException("Cannot use invokestatic to invoke a non static method"); } invokestatic(method.getDeclaringClass().getName(), method.getName(), DescriptorUtils.methodDescriptor(method), DescriptorUtils.makeDescriptor(method.getReturnType()), DescriptorUtils.parameterDescriptors(method .getParameterTypes())); }
public void invokestatic(Method method) { if (!Modifier.isStatic(method.getModifiers())) { throw new InvalidBytecodeException("Cannot use invokestatic to invoke a non static method"); } invokestatic(method.getDeclaringClass().getName(), method.getName(), DescriptorUtils.methodDescriptor(method), DescriptorUtils.makeDescriptor(method.getReturnType()), DescriptorUtils.parameterDescriptors(method .getParameterTypes())); }
public void invokestatic(Method method) { if (!Modifier.isStatic(method.getModifiers())) { throw new InvalidBytecodeException("Cannot use invokestatic to invoke a non static method"); } invokestatic(method.getDeclaringClass().getName(), method.getName(), DescriptorUtils.methodDescriptor(method), DescriptorUtils.makeDescriptor(method.getReturnType()), DescriptorUtils.parameterDescriptors(method .getParameterTypes())); }
public void invokestatic(String className, String methodName, String descriptor) { String[] params = DescriptorUtils.parameterDescriptors(descriptor); String returnType = DescriptorUtils.returnType(descriptor); invokestatic(className, methodName, descriptor, returnType, params); }
public void invokestatic(String className, String methodName, String descriptor) { String[] params = DescriptorUtils.parameterDescriptors(descriptor); String returnType = DescriptorUtils.returnType(descriptor); invokestatic(className, methodName, descriptor, returnType, params); }
public void invokestatic(String className, String methodName, String descriptor) { String[] params = DescriptorUtils.parameterDescriptors(descriptor); String returnType = DescriptorUtils.returnType(descriptor); invokestatic(className, methodName, descriptor, returnType, params); }
@Override public void getDeclaredMethod(final ClassMethod classMethod, final String declaringClass, final String methodName, final String[] parameterTypes, ClassMethod staticConstructor) { String weldMemberName = WELD_MEMBER_PREFIX + METHOD_COUNT.incrementAndGet(); staticConstructor.getClassFile().addField(AccessFlag.PRIVATE | AccessFlag.STATIC, weldMemberName, LJAVA_LANG_REFLECT_METHOD); final CodeAttribute code = staticConstructor.getCodeAttribute(); addInitMethod(declaringClass, methodName, parameterTypes, weldMemberName, staticConstructor.getClassFile()); code.invokestatic(staticConstructor.getClassFile().getName(), weldMemberName, "()Ljava/lang/reflect/Method;"); code.putstatic(classMethod.getClassFile().getName(), weldMemberName, LJAVA_LANG_REFLECT_METHOD); CodeAttribute methodCode = classMethod.getCodeAttribute(); methodCode.getstatic(classMethod.getClassFile().getName(), weldMemberName, LJAVA_LANG_REFLECT_METHOD); }
@Override public void getDeclaredMethod(final ClassMethod classMethod, final String declaringClass, final String methodName, final String[] parameterTypes, ClassMethod staticConstructor) { String weldMemberName = WELD_MEMBER_PREFIX + METHOD_COUNT.incrementAndGet(); staticConstructor.getClassFile().addField(AccessFlag.PRIVATE | AccessFlag.STATIC, weldMemberName, LJAVA_LANG_REFLECT_METHOD); final CodeAttribute code = staticConstructor.getCodeAttribute(); addInitMethod(declaringClass, methodName, parameterTypes, weldMemberName, staticConstructor.getClassFile()); code.invokestatic(staticConstructor.getClassFile().getName(), weldMemberName, "()Ljava/lang/reflect/Method;"); code.putstatic(classMethod.getClassFile().getName(), weldMemberName, LJAVA_LANG_REFLECT_METHOD); CodeAttribute methodCode = classMethod.getCodeAttribute(); methodCode.getstatic(classMethod.getClassFile().getName(), weldMemberName, LJAVA_LANG_REFLECT_METHOD); }
@Override public void getDeclaredMethod(final ClassMethod classMethod, final String declaringClass, final String methodName, final String[] parameterTypes, ClassMethod staticConstructor) { String weldMemberName = WELD_MEMBER_PREFIX + METHOD_COUNT.incrementAndGet(); staticConstructor.getClassFile().addField(AccessFlag.PRIVATE | AccessFlag.STATIC, weldMemberName, LJAVA_LANG_REFLECT_METHOD); final CodeAttribute code = staticConstructor.getCodeAttribute(); addInitMethod(declaringClass, methodName, parameterTypes, weldMemberName, staticConstructor.getClassFile()); code.invokestatic(staticConstructor.getClassFile().getName(), weldMemberName, "()Ljava/lang/reflect/Method;"); code.putstatic(classMethod.getClassFile().getName(), weldMemberName, LJAVA_LANG_REFLECT_METHOD); CodeAttribute methodCode = classMethod.getCodeAttribute(); methodCode.getstatic(classMethod.getClassFile().getName(), weldMemberName, LJAVA_LANG_REFLECT_METHOD); }
@Override public void getDeclaredMethod(final ClassMethod classMethod, final String declaringClass, final String methodName, final String[] parameterTypes, ClassMethod staticConstructor) { String weldMemberName = WELD_MEMBER_PREFIX + METHOD_COUNT.incrementAndGet(); staticConstructor.getClassFile().addField(AccessFlag.PRIVATE | AccessFlag.STATIC, weldMemberName, LJAVA_LANG_REFLECT_METHOD); final CodeAttribute code = staticConstructor.getCodeAttribute(); addInitMethod(declaringClass, methodName, parameterTypes, weldMemberName, staticConstructor.getClassFile()); code.invokestatic(staticConstructor.getClassFile().getName(), weldMemberName, "()Ljava/lang/reflect/Method;"); code.putstatic(classMethod.getClassFile().getName(), weldMemberName, LJAVA_LANG_REFLECT_METHOD); CodeAttribute methodCode = classMethod.getCodeAttribute(); methodCode.getstatic(classMethod.getClassFile().getName(), weldMemberName, LJAVA_LANG_REFLECT_METHOD); }