@Override public void updateParseState(final CodeAttribute c) { c.pop(); c.aload(PARSE_STATE_VAR); c.iconst(HEADER_VALUE); c.putfield(PARSE_STATE_CLASS, "state", "I"); }
@Override public void updateParseState(final CodeAttribute c) { c.pop(); c.aload(PARSE_STATE_VAR); c.iconst(HEADER_VALUE); c.putfield(parseStateClass, "state", "I"); }
@Override public void updateParseState(final CodeAttribute c) { c.pop(); c.aload(PARSE_STATE_VAR); c.iconst(PATH); c.putfield(parseStateClass, "state", "I"); }
@Override public void updateParseState(final CodeAttribute c) { c.aload(PARSE_STATE_VAR); c.swap(); c.putfield(parseStateClass, "leftOver", "B"); c.aload(PARSE_STATE_VAR); c.iconst(AFTER_VERSION); c.putfield(parseStateClass, "state", "I"); }
@Override public void updateParseState(final CodeAttribute c) { c.aload(PARSE_STATE_VAR); c.swap(); c.putfield(PARSE_STATE_CLASS, "leftOver", "B"); c.aload(PARSE_STATE_VAR); c.iconst(STATUS_CODE); c.putfield(PARSE_STATE_CLASS, "state", "I"); }
c.branchEnd(end); c.aload(PARSE_STATE_VAR); c.iconst(0); c.putfield(parseStateClass, "leftOver", "B"); final Map<State, BranchEnd> ends = new IdentityHashMap<State, BranchEnd>(); for (State state : currentState.next.values()) { c.iconst(state.value); ends.put(state, c.ifIcmpeq()); c.dup(); c.iconst(':'); tokenEnds.add(c.ifIcmpeq()); c.dup(); c.iconst('\r'); tokenEnds.add(c.ifIcmpeq()); c.dup(); c.iconst('\n'); tokenEnds.add(c.ifIcmpeq()); c.dup(); c.iconst(' '); tokenEnds.add(c.ifIcmpeq()); }else if (expectNewline) { c.iconst('\r'); tokenEnds.add(c.ifIcmpeq()); c.dup(); c.iconst('\n'); tokenEnds.add(c.ifIcmpeq()); } else {
ca.iconst(0); ca.anewarray(Object.class.getName()); ca.iconst(paramTypes.length); ca.anewarray(Object.class.getName()); int index = 1; ca.iconst(j); if (!type.isPrimitive()) { init.iconst(len); init.anewarray(String.class.getName()); for (i = 0; i < len; i++) { init.dup(); init.iconst(i); init.ldc(CDRStream.abbrevFor(paramTypes[i])); init.aastore(); init.iconst(n); init.anewarray(String.class.getName()); try { if (!RemoteException.class.isAssignableFrom(exceptions[i])) { init.dup(); init.iconst(j); init.ldc( ExceptionAnalysis.getExceptionAnalysis(exceptions[i]) init.iconst(n);
c.iconst(0); c.returnInstruction(); c.iconst(0); c.putfield(parseStateClass, "pos", "I"); c.aconstNull(); c.putfield(parseStateClass, "currentBytes", "[B"); c.aload(STATE_STRING_BUILDER_VAR); c.iconst(0); c.invokevirtual(StringBuilder.class.getName(), "setLength", "(I)V"); c.iconst(0); c.putfield(parseStateClass, "parseState", "I"); c.returnInstruction(); final Set<BranchEnd> badPrefixHandleSpace = new LinkedHashSet<BranchEnd>(); if (stateMachine.isHeader()) { c.iconst(':'); prefixHandleSpace.add(c.ifIcmpeq()); c.dup(); c.iconst(' '); prefixHandleSpace.add(c.ifIcmpeq()); c.dup(); c.iconst('\r'); prefixHandleSpace.add(c.ifIcmpeq()); c.dup(); c.iconst('\n'); prefixHandleSpace.add(c.ifIcmpeq()); }else if(!expectNewline) {
/** * Adds an ldc instruction for an int. * * @param value The value to load */ public void ldc(int value) { if (value > -2 && value < 6) { iconst(value); return; } int index = constPool.addIntegerEntry(value); ldcInternal(index); advanceFrame(currentFrame.push("I")); }
/** * Adds an ldc instruction for an int. * * @param value The value to load */ public void ldc(int value) { if (value > -2 && value < 6) { iconst(value); return; } int index = constPool.addIntegerEntry(value); ldcInternal(index); advanceFrame(currentFrame.push("I")); }
/** * Adds an ldc instruction for an int. * * @param value The value to load */ public void ldc(int value) { if (value > -2 && value < 6) { iconst(value); return; } int index = constPool.addIntegerEntry(value); ldcInternal(index); advanceFrame(currentFrame.push("I")); }
/** * Adds an ldc instruction for an int. * * @param value */ public void ldc(int value) { if (value > -2 && value < 6) { iconst(value); return; } int index = constPool.addIntegerEntry(value); ldcInternal(index); advanceFrame(currentFrame.push("I")); }
/** * Adds an ldc instruction for an int. * * @param value The value to load */ public void ldc(int value) { if (value > -2 && value < 6) { iconst(value); return; } int index = constPool.addIntegerEntry(value); ldcInternal(index); advanceFrame(currentFrame.push("I")); }
/** {@inheritDoc} */ @Override public void overrideMethod(ClassMethod method, Method superclassMethod) { CodeAttribute ca = method.getCodeAttribute(); Class<?> returnType = superclassMethod.getReturnType(); if (!returnType.isPrimitive()) { ca.aconstNull(); } else if (returnType == double.class) { ca.dconst(0); } else if (returnType == float.class) { ca.fconst(0); } else if (returnType == long.class) { ca.lconst(0); } else if (returnType == void.class) { // do nothing } else { ca.iconst(0); } ca.returnInstruction(); }
private void addInitMethod(final String declaringClass, final String methodName, final String[] parameterTypes, String weldMethodName, ClassFile classFile) { ClassMethod initMethod = classFile.addMethod(AccessFlag.of(AccessFlag.PRIVATE, AccessFlag.STATIC), weldMethodName, LJAVA_LANG_REFLECT_METHOD); final CodeAttribute code = initMethod.getCodeAttribute(); BytecodeUtils.pushClassType(code, declaringClass); // now we have the class on the stack code.ldc(methodName); // now we need to load the parameter types into an array code.iconst(parameterTypes.length); code.anewarray(Class.class.getName()); for (int i = 0; i < parameterTypes.length; ++i) { code.dup(); // duplicate the array reference code.iconst(i); // now load the class object String type = parameterTypes[i]; BytecodeUtils.pushClassType(code, type); // and store it in the array code.aastore(); } code.invokestatic(DefaultBytecodeMethodResolver.class.getName(), "getMethod", "(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"); code.returnInstruction(); }
private void addInitMethod(final String declaringClass, final String methodName, final String[] parameterTypes, String weldMethodName, ClassFile classFile) { ClassMethod initMethod = classFile.addMethod(AccessFlag.of(AccessFlag.PRIVATE, AccessFlag.STATIC), weldMethodName, LJAVA_LANG_REFLECT_METHOD); final CodeAttribute code = initMethod.getCodeAttribute(); BytecodeUtils.pushClassType(code, declaringClass); // now we have the class on the stack code.ldc(methodName); // now we need to load the parameter types into an array code.iconst(parameterTypes.length); code.anewarray(Class.class.getName()); for (int i = 0; i < parameterTypes.length; ++i) { code.dup(); // duplicate the array reference code.iconst(i); // now load the class object String type = parameterTypes[i]; BytecodeUtils.pushClassType(code, type); // and store it in the array code.aastore(); } code.invokestatic(DefaultBytecodeMethodResolver.class.getName(), "getMethod", "(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"); code.returnInstruction(); }
private void addInitMethod(final String declaringClass, final String methodName, final String[] parameterTypes, String weldMethodName, ClassFile classFile) { ClassMethod initMethod = classFile.addMethod(AccessFlag.of(AccessFlag.PRIVATE, AccessFlag.STATIC), weldMethodName, LJAVA_LANG_REFLECT_METHOD); final CodeAttribute code = initMethod.getCodeAttribute(); BytecodeUtils.pushClassType(code, declaringClass); // now we have the class on the stack code.ldc(methodName); // now we need to load the parameter types into an array code.iconst(parameterTypes.length); code.anewarray(Class.class.getName()); for (int i = 0; i < parameterTypes.length; ++i) { code.dup(); // duplicate the array reference code.iconst(i); // now load the class object String type = parameterTypes[i]; BytecodeUtils.pushClassType(code, type); // and store it in the array code.aastore(); } code.invokestatic(DefaultBytecodeMethodResolver.class.getName(), "getMethod", "(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"); code.returnInstruction(); }
private void addInitMethod(final String declaringClass, final String methodName, final String[] parameterTypes, String weldMethodName, ClassFile classFile) { ClassMethod initMethod = classFile.addMethod(AccessFlag.of(AccessFlag.PRIVATE, AccessFlag.STATIC), weldMethodName, LJAVA_LANG_REFLECT_METHOD); final CodeAttribute code = initMethod.getCodeAttribute(); BytecodeUtils.pushClassType(code, declaringClass); // now we have the class on the stack code.ldc(methodName); // now we need to load the parameter types into an array code.iconst(parameterTypes.length); code.anewarray(Class.class.getName()); for (int i = 0; i < parameterTypes.length; ++i) { code.dup(); // duplicate the array reference code.iconst(i); // now load the class object String type = parameterTypes[i]; BytecodeUtils.pushClassType(code, type); // and store it in the array code.aastore(); } code.invokestatic(DefaultBytecodeMethodResolver.class.getName(), "getMethod", "(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"); code.returnInstruction(); }
private void addInitMethod(final String declaringClass, final String methodName, final String[] parameterTypes, String weldMethodName, ClassFile classFile) { ClassMethod initMethod = classFile.addMethod(AccessFlag.of(AccessFlag.PRIVATE, AccessFlag.STATIC), weldMethodName, LJAVA_LANG_REFLECT_METHOD); final CodeAttribute code = initMethod.getCodeAttribute(); BytecodeUtils.pushClassType(code, declaringClass); // now we have the class on the stack code.ldc(methodName); // now we need to load the parameter types into an array code.iconst(parameterTypes.length); code.anewarray(Class.class.getName()); for (int i = 0; i < parameterTypes.length; ++i) { code.dup(); // duplicate the array reference code.iconst(i); // now load the class object String type = parameterTypes[i]; BytecodeUtils.pushClassType(code, type); // and store it in the array code.aastore(); } code.invokestatic(DefaultBytecodeMethodResolver.class.getName(), "getMethod", "(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"); code.returnInstruction(); }