changeset 485:b3fee1e2779a

Modularize generator sources to separate projects. (Keeps ASMv4 from being transitive dependency from jmh-core).
author shade
date Thu, 06 Mar 2014 21:25:06 +0400
parents 28ef7c0cdd92
children e272e2d1e7ab
files jmh-archetypes/jmh-java-benchmark-archetype/src/main/resources/archetype-resources/pom.xml jmh-core-benchmarks/pom.xml jmh-core-it/pom.xml jmh-core/pom.xml jmh-core/src/main/java/org/openjdk/jmh/generators/GenerateMicroBenchmarkProcessor.java jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APClassInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APFieldInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APGeneratorDestinaton.java jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APGeneratorSource.java jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APMetadataInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APMethodInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APParameterInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMFieldInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMGeneratorSource.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMMethodInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMParameterInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/AnnotationInvocationHandler.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ClassInfoRepo.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/SourceElementError.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/SourceError.java jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/SourceThrowableError.java jmh-core/src/main/java/org/openjdk/jmh/generators/core/FileSystemDestination.java jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFClassInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFConstructorInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFFieldInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFGeneratorSource.java jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFMethodInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFParameterInfo.java jmh-core/src/main/java/org/openjdk/jmh/generators/source/SourceElementError.java jmh-core/src/main/java/org/openjdk/jmh/generators/source/SourceError.java jmh-core/src/main/java/org/openjdk/jmh/generators/source/SourceThrowableError.java jmh-core/src/main/resources/META-INF/services/javax.annotation.processing.Processor jmh-generator-annprocess/pom.xml jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/GenerateMicroBenchmarkProcessor.java jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APClassInfo.java jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APFieldInfo.java jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APGeneratorDestinaton.java jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APGeneratorSource.java jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APMetadataInfo.java jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APMethodInfo.java jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APParameterInfo.java jmh-generator-annprocess/src/main/resources/META-INF/services/javax.annotation.processing.Processor jmh-generator-bytecode/pom.xml jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMFieldInfo.java jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMGeneratorSource.java jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMMethodInfo.java jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMParameterInfo.java jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/AnnotationInvocationHandler.java jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ClassInfoRepo.java jmh-generator-maven-plugin/pom.xml jmh-generator-maven-plugin/src/main/java/org/openjdk/jmh/JmhMojo.java jmh-generator-reflection/pom.xml jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFClassInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFConstructorInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFFieldInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFGeneratorSource.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFMethodInfo.java jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFParameterInfo.java jmh-samples/pom.xml pom.xml
diffstat 62 files changed, 2497 insertions(+), 2151 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-archetypes/jmh-java-benchmark-archetype/src/main/resources/archetype-resources/pom.xml	Thu Mar 06 20:32:14 2014 +0400
+++ b/jmh-archetypes/jmh-java-benchmark-archetype/src/main/resources/archetype-resources/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -40,6 +40,11 @@
             <artifactId>jmh-core</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-generator-annprocess</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 
     <properties>
--- a/jmh-core-benchmarks/pom.xml	Thu Mar 06 20:32:14 2014 +0400
+++ b/jmh-core-benchmarks/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -47,7 +47,12 @@
         <dependency>
             <groupId>org.openjdk.jmh</groupId>
             <artifactId>jmh-core</artifactId>
-            <version>1.0-SNAPSHOT</version>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-generator-annprocess</artifactId>
+            <version>${project.version}</version>
         </dependency>
     </dependencies>
 
--- a/jmh-core-it/pom.xml	Thu Mar 06 20:32:14 2014 +0400
+++ b/jmh-core-it/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -105,6 +105,13 @@
     <profiles>
         <profile>
             <id>default</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.openjdk.jmh</groupId>
+                    <artifactId>jmh-generator-annprocess</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+            </dependencies>
             <activation>
                 <activeByDefault>true</activeByDefault>
             </activation>
--- a/jmh-core/pom.xml	Thu Mar 06 20:32:14 2014 +0400
+++ b/jmh-core/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -67,11 +67,6 @@
             <artifactId>commons-math3</artifactId>
             <version>3.2</version>
         </dependency>
-        <dependency>
-            <groupId>org.ow2.asm</groupId>
-            <artifactId>asm</artifactId>
-            <version>4.2</version>
-        </dependency>
     </dependencies>
 
     <prerequisites>
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/GenerateMicroBenchmarkProcessor.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators;
-
-import org.openjdk.jmh.generators.annotations.APGeneratorDestinaton;
-import org.openjdk.jmh.generators.annotations.APGeneratorSource;
-import org.openjdk.jmh.generators.core.BenchmarkGenerator;
-import org.openjdk.jmh.generators.source.GeneratorDestination;
-import org.openjdk.jmh.generators.source.GeneratorSource;
-
-import javax.annotation.processing.AbstractProcessor;
-import javax.annotation.processing.RoundEnvironment;
-import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.annotation.processing.SupportedSourceVersion;
-import javax.lang.model.SourceVersion;
-import javax.lang.model.element.TypeElement;
-import java.util.Set;
-
-/**
- * @author staffan.friberg@oracle.com
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
- */
-@SupportedAnnotationTypes("*")
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
-public class GenerateMicroBenchmarkProcessor extends AbstractProcessor {
-
-    private final BenchmarkGenerator generator = new BenchmarkGenerator();
-
-    @Override
-    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-        GeneratorSource source = new APGeneratorSource(roundEnv, processingEnv);
-        GeneratorDestination destination = new APGeneratorDestinaton(roundEnv, processingEnv);
-        if (!roundEnv.processingOver()) {
-            generator.generate(source, destination);
-        } else {
-            generator.complete(source, destination);
-        }
-        return true;
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APClassInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.annotations;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.FieldInfo;
-import org.openjdk.jmh.generators.source.MethodInfo;
-
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
-import javax.lang.model.element.ExecutableElement;
-import javax.lang.model.element.Modifier;
-import javax.lang.model.element.PackageElement;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.element.VariableElement;
-import javax.lang.model.type.TypeKind;
-import javax.lang.model.type.TypeMirror;
-import javax.lang.model.util.ElementFilter;
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class APClassInfo extends APMetadataInfo implements ClassInfo {
-
-    private final TypeElement el;
-
-    public APClassInfo(ProcessingEnvironment processEnv, TypeElement element) {
-        super(processEnv, element);
-        this.el = element;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        return el.getAnnotation(annClass);
-    }
-
-    @Override
-    public Collection<MethodInfo> getConstructors() {
-        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
-        for (ExecutableElement e : ElementFilter.constructorsIn(el.getEnclosedElements())) {
-            mis.add(new APMethodInfo(processEnv, this, e));
-        }
-        return mis;
-    }
-
-    @Override
-    public String getName() {
-        return el.getSimpleName().toString();
-    }
-
-    @Override
-    public String getQualifiedName() {
-        return el.getQualifiedName().toString();
-    }
-
-    @Override
-    public Collection<FieldInfo> getFields() {
-        List<FieldInfo> ls = new ArrayList<FieldInfo>();
-        for (VariableElement e : ElementFilter.fieldsIn(el.getEnclosedElements())) {
-            ls.add(new APFieldInfo(processEnv, e));
-        }
-        return ls;
-    }
-
-
-    @Override
-    public Collection<MethodInfo> getMethods() {
-        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
-        for (ExecutableElement e : ElementFilter.methodsIn(el.getEnclosedElements())) {
-            mis.add(new APMethodInfo(processEnv, this, e));
-        }
-        return mis;
-    }
-
-    @Override
-    public String getPackageName() {
-        Element walk = el;
-        while (walk.getKind() != ElementKind.PACKAGE) {
-            walk = walk.getEnclosingElement();
-        }
-        return ((PackageElement)walk).getQualifiedName().toString();
-    }
-
-    @Override
-    public ClassInfo getSuperClass() {
-        TypeMirror superclass = el.getSuperclass();
-        if (superclass.getKind() == TypeKind.NONE) {
-            return null;
-        } else {
-            TypeElement element = (TypeElement) processEnv.getTypeUtils().asElement(superclass);
-            return new APClassInfo(processEnv, element);
-        }
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        Element enclosingElement = el.getEnclosingElement();
-        if (enclosingElement.getKind() == ElementKind.CLASS) {
-            return new APClassInfo(processEnv, (TypeElement) enclosingElement);
-        } else {
-            return null;
-        }
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return el.getModifiers().contains(Modifier.ABSTRACT);
-    }
-
-    @Override
-    public boolean isPublic() {
-        return el.getModifiers().contains(Modifier.PUBLIC);
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return el.getModifiers().contains(Modifier.STRICTFP);
-    }
-
-    @Override
-    public boolean isFinal() {
-        return el.getModifiers().contains(Modifier.FINAL);
-    }
-
-    public String toString() {
-        return getQualifiedName();
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APFieldInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.annotations;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.FieldInfo;
-
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.lang.model.element.Modifier;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.element.VariableElement;
-import java.lang.annotation.Annotation;
-
-public class APFieldInfo extends APMetadataInfo implements FieldInfo {
-
-    private final VariableElement ve;
-
-    public APFieldInfo(ProcessingEnvironment processEnv, VariableElement ve) {
-        super(processEnv, ve);
-        this.ve = ve;
-    }
-
-    @Override
-    public String getName() {
-        return ve.getSimpleName().toString();
-    }
-
-    @Override
-    public String getType() {
-        return ve.asType().toString();
-    }
-
-    @Override
-    public boolean isPublic() {
-        return ve.getModifiers().contains(Modifier.PUBLIC);
-    }
-
-    @Override
-    public boolean isStatic() {
-        return ve.getModifiers().contains(Modifier.STATIC);
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        return ve.getAnnotation(annClass);
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return new APClassInfo(processEnv, (TypeElement)ve.getEnclosingElement());
-    }
-
-    public String toString() {
-        return getType() + " " + getName();
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APGeneratorDestinaton.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.annotations;
-
-import org.openjdk.jmh.generators.source.GeneratorDestination;
-import org.openjdk.jmh.generators.source.MetadataInfo;
-
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.annotation.processing.RoundEnvironment;
-import javax.tools.Diagnostic;
-import javax.tools.StandardLocation;
-import java.io.IOException;
-import java.io.Writer;
-
-public class APGeneratorDestinaton implements GeneratorDestination {
-
-    private final RoundEnvironment roundEnv;
-    private final ProcessingEnvironment processingEnv;
-
-    public APGeneratorDestinaton(RoundEnvironment roundEnv, ProcessingEnvironment processingEnv) {
-        this.roundEnv = roundEnv;
-        this.processingEnv = processingEnv;
-    }
-
-    @Override
-    public Writer newResource(String resourcePath) throws IOException {
-        return processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", resourcePath).openWriter();
-    }
-
-    @Override
-    public Writer newClass(String className) throws IOException {
-        return processingEnv.getFiler().createSourceFile(className).openWriter();
-    }
-
-    @Override
-    public void printError(String message) {
-        processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message);
-    }
-
-    @Override
-    public void printError(String message, MetadataInfo element) {
-        processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message, ((APMetadataInfo)element).getElement());
-    }
-
-    @Override
-    public void printError(String message, Throwable throwable) {
-        printError(message + " " + throwable);
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APGeneratorSource.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.annotations;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.GeneratorSource;
-
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.annotation.processing.RoundEnvironment;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.util.ElementFilter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.List;
-import java.util.TreeSet;
-
-public class APGeneratorSource implements GeneratorSource {
-
-    private final RoundEnvironment roundEnv;
-    private final ProcessingEnvironment processingEnv;
-    private Collection<ClassInfo> classInfos;
-
-    public APGeneratorSource(RoundEnvironment roundEnv, ProcessingEnvironment processingEnv) {
-        this.roundEnv = roundEnv;
-        this.processingEnv = processingEnv;
-    }
-
-    @Override
-    public Collection<ClassInfo> getClasses() {
-        if (classInfos != null) {
-            return classInfos;
-        }
-
-        Collection<TypeElement> discoveredClasses = new TreeSet<TypeElement>(new Comparator<TypeElement>() {
-            @Override
-            public int compare(TypeElement o1, TypeElement o2) {
-                return o1.getQualifiedName().toString().compareTo(o2.getQualifiedName().toString());
-            }
-        });
-
-        // Need to do a few rollovers to find all classes that have @GMB-annotated methods in their
-        // subclasses. This is mostly due to some of the nested classes not discoverable at once,
-        // when we need to discover the enclosing class first. With the potentially non-zero nesting
-        // depth, we need to do a few rounds. Hopefully we will just do a single stride in most
-        // cases.
-
-        List<TypeElement> front = new ArrayList<TypeElement>();
-
-        for (Element e : roundEnv.getRootElements()) {
-            if (e.getKind() != ElementKind.CLASS) continue;
-            front.add((TypeElement) e);
-        }
-
-        while (!front.isEmpty()) {
-            discoveredClasses.addAll(front);
-
-            List<TypeElement> newClasses = new ArrayList<TypeElement>();
-            for (Element e : front) {
-                TypeElement walk = (TypeElement) e;
-                do {
-                    for (TypeElement nested : ElementFilter.typesIn(walk.getEnclosedElements())) {
-                        newClasses.add(nested);
-                    }
-                } while ((walk = (TypeElement) processingEnv.getTypeUtils().asElement(walk.getSuperclass())) != null);
-            }
-            front = newClasses;
-        }
-
-        classInfos = convert(discoveredClasses);
-        return classInfos;
-    }
-
-    protected Collection<ClassInfo> convert(Collection<TypeElement> els) {
-        List<ClassInfo> list = new ArrayList<ClassInfo>();
-        for (TypeElement el : els) {
-            list.add(new APClassInfo(processingEnv, el));
-        }
-        return list;
-    }
-
-    @Override
-    public ClassInfo resolveClass(String className) {
-        return new APClassInfo(processingEnv, processingEnv.getElementUtils().getTypeElement(className));
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APMetadataInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.annotations;
-
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.lang.model.element.Element;
-
-public class APMetadataInfo {
-
-    protected final ProcessingEnvironment processEnv;
-    private final Element element;
-
-    public APMetadataInfo(ProcessingEnvironment processEnv, Element element) {
-        this.processEnv = processEnv;
-        this.element = element;
-    }
-
-    public Element getElement() {
-        return element;
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APMethodInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.annotations;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.MethodInfo;
-import org.openjdk.jmh.generators.source.ParameterInfo;
-
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.lang.model.element.ExecutableElement;
-import javax.lang.model.element.Modifier;
-import javax.lang.model.element.VariableElement;
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.Collection;
-
-public class APMethodInfo extends APMetadataInfo implements MethodInfo {
-
-    private final ClassInfo ci;
-    private final ExecutableElement el;
-
-    public APMethodInfo(ProcessingEnvironment processEnv, ClassInfo ci, ExecutableElement el) {
-        super(processEnv, el);
-        this.ci = ci;
-        this.el = el;
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return ci;
-    }
-
-    @Override
-    public String getName() {
-        return el.getSimpleName().toString();
-    }
-
-    @Override
-    public String getReturnType() {
-        return el.getReturnType().toString();
-    }
-
-    @Override
-    public Collection<ParameterInfo> getParameters() {
-        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
-        for (VariableElement v : el.getParameters()) {
-            pis.add(new APParameterInfo(processEnv, v));
-        }
-        return pis;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        return el.getAnnotation(annClass);
-    }
-
-    @Override
-    public boolean isPublic() {
-        return el.getModifiers().contains(Modifier.PUBLIC);
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return el.getModifiers().contains(Modifier.ABSTRACT);
-    }
-
-    @Override
-    public boolean isSynchronized() {
-        return el.getModifiers().contains(Modifier.SYNCHRONIZED);
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return el.getModifiers().contains(Modifier.STRICTFP);
-    }
-
-    @Override
-    public String getQualifiedName() {
-        return ci.getQualifiedName() + "." + el.toString();
-    }
-
-    @Override
-    public int compareTo(MethodInfo o) {
-        return getQualifiedName().compareTo(o.getQualifiedName());
-    }
-
-    public String toString() {
-        return getDeclaringClass() + " " + getName() ;
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/APParameterInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.annotations;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.ParameterInfo;
-
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.element.VariableElement;
-
-public class APParameterInfo extends APMetadataInfo implements ParameterInfo {
-    private final VariableElement ve;
-    private final TypeElement stateType;
-
-    public APParameterInfo(ProcessingEnvironment processEnv, VariableElement ve) {
-        super(processEnv, ve);
-        this.ve = ve;
-        this.stateType = (TypeElement) processEnv.getTypeUtils().asElement(ve.asType());
-    }
-
-    @Override
-    public ClassInfo getType() {
-        return new APClassInfo(processEnv, stateType);
-    }
-
-    public String toString() {
-        return getType() + " " + ve.getSimpleName();
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.FieldVisitor;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.Type;
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.FieldInfo;
-import org.openjdk.jmh.generators.source.MethodInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ASMClassInfo extends ClassVisitor implements ClassInfo {
-
-    private String idName;
-    private String packageName;
-    private String qualifiedName;
-    private String name;
-    private int access;
-
-    private final List<MethodInfo> methods;
-    private final List<MethodInfo> constructors;
-    private final List<FieldInfo> fields;
-    private final Map<String, AnnotationInvocationHandler> annotations = new HashMap<String, AnnotationInvocationHandler>();
-    private final ClassInfoRepo classInfos;
-    private String superName;
-    private String declaringClass;
-
-    public ASMClassInfo(ClassInfoRepo classInfos) {
-        super(Opcodes.ASM4);
-        this.classInfos = classInfos;
-        methods = new ArrayList<MethodInfo>();
-        constructors = new ArrayList<MethodInfo>();
-        fields = new ArrayList<FieldInfo>();
-    }
-
-    public String getIdName() {
-        return idName;
-    }
-
-    @Override
-    public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-        super.visit(version, access, name, signature, superName, interfaces);
-        this.superName = superName;
-        this.idName = name;
-        this.access = access;
-        qualifiedName = name.replace("/", ".");
-        packageName = qualifiedName.substring(0, qualifiedName.lastIndexOf("."));
-        qualifiedName = qualifiedName.replace('$', '.');
-        this.name = qualifiedName.substring(qualifiedName.lastIndexOf(".") + 1);
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        AnnotationInvocationHandler handler = annotations.get(annClass.getCanonicalName());
-        if (handler == null) {
-            return null;
-        } else {
-            return (T) Proxy.newProxyInstance(
-                    Thread.currentThread().getContextClassLoader(),
-                    new Class[]{annClass},
-                    handler);
-        }
-    }
-
-    @Override
-    public AnnotationVisitor visitAnnotation(final String desc, boolean visible) {
-        AnnotationInvocationHandler annHandler = new AnnotationInvocationHandler(super.visitAnnotation(desc, visible));
-        annotations.put(Type.getType(desc).getClassName(), annHandler);
-        return annHandler;
-    }
-
-    @Override
-    public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
-        ASMFieldInfo fi = new ASMFieldInfo(super.visitField(access, name, desc, signature, value),
-                this, access, name, desc, signature);
-        fields.add(fi);
-        return fi;
-    }
-
-    @Override
-    public MethodVisitor visitMethod(int access, final String methodName, String methodDesc, String signature, String[] exceptions) {
-        ASMMethodInfo mi = new ASMMethodInfo(super.visitMethod(access, methodName, methodDesc, signature, exceptions),
-                classInfos, this, access, methodName, methodDesc, signature);
-        methods.add(mi);
-        if (methodName.equals("<init>")) {
-            constructors.add(mi);
-        }
-        return mi;
-    }
-
-    @Override
-    public String getPackageName() {
-        return packageName;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getQualifiedName() {
-        return qualifiedName;
-    }
-
-    @Override
-    public Collection<FieldInfo> getFields() {
-        return fields;
-    }
-
-    @Override
-    public Collection<MethodInfo> getConstructors() {
-        return constructors;
-    }
-
-    @Override
-    public Collection<MethodInfo> getMethods() {
-        return methods;
-    }
-
-    @Override
-    public ClassInfo getSuperClass() {
-        return classInfos.get(superName);
-    }
-
-    @Override
-    public void visitInnerClass(String name, String outerName, String innerName, int access) {
-        if (name.equals(idName)) {
-            declaringClass = outerName;
-        }
-        super.visitInnerClass(name, outerName, innerName, access);
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        if (declaringClass != null) {
-            return classInfos.get(declaringClass);
-        } else {
-            return null;
-        }
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return (access & Opcodes.ACC_ABSTRACT) > 0;
-    }
-
-    @Override
-    public boolean isPublic() {
-        return (access & Opcodes.ACC_PUBLIC) > 0;
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return (access & Opcodes.ACC_STRICT) > 0;
-    }
-
-    @Override
-    public boolean isFinal() {
-        return (access & Opcodes.ACC_FINAL) > 0;
-    }
-
-    @Override
-    public String toString() {
-        return qualifiedName;
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMFieldInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.FieldVisitor;
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.Type;
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.FieldInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Proxy;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ASMFieldInfo extends FieldVisitor implements FieldInfo {
-
-    private final String type;
-    private final ASMClassInfo declaringClass;
-    private final int access;
-    private final String name;
-    private final Map<String, AnnotationInvocationHandler> annotations;
-
-    public ASMFieldInfo(FieldVisitor fieldVisitor, ASMClassInfo declaringClass, int access, String name, String desc, String signature) {
-        super(Opcodes.ASM4, fieldVisitor);
-        this.declaringClass = declaringClass;
-        this.access = access;
-        this.name = name;
-        this.type = Type.getReturnType(desc).getClassName();
-        this.annotations = new HashMap<String, AnnotationInvocationHandler>();
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getType() {
-        return type;
-    }
-
-    @Override
-    public boolean isPublic() {
-        return (access & Opcodes.ACC_PUBLIC) > 0;
-    }
-
-    @Override
-    public boolean isStatic() {
-        return (access & Opcodes.ACC_STATIC) > 0;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        AnnotationInvocationHandler handler = annotations.get(annClass.getCanonicalName());
-        if (handler == null) {
-            return null;
-        } else {
-            return (T) Proxy.newProxyInstance(
-                    Thread.currentThread().getContextClassLoader(),
-                    new Class[]{annClass},
-                    handler);
-        }
-    }
-
-    @Override
-    public AnnotationVisitor visitAnnotation(final String desc, boolean visible) {
-        AnnotationInvocationHandler annHandler = new AnnotationInvocationHandler(super.visitAnnotation(desc, visible));
-        annotations.put(Type.getType(desc).getClassName(), annHandler);
-        return annHandler;
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return declaringClass;
-    }
-
-    @Override
-    public String toString() {
-        return declaringClass.getQualifiedName() + "." + name;
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMGeneratorSource.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-import org.objectweb.asm.ClassReader;
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.GeneratorSource;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Collection;
-
-public class ASMGeneratorSource implements GeneratorSource {
-
-    private final ClassInfoRepo classInfos;
-
-    public ASMGeneratorSource() {
-        this.classInfos = new ClassInfoRepo();
-    }
-
-    public void processClasses(Collection<File> classFiles)  throws IOException {
-        for (File f : classFiles) {
-            processClass(f);
-        }
-    }
-
-    public void processClass(File classFile) throws IOException {
-        final ASMClassInfo ci = new ASMClassInfo(classInfos);
-        FileInputStream fos = null;
-        try {
-            fos = new FileInputStream(classFile);
-            ClassReader reader = new ClassReader(fos);
-            reader.accept(ci, 0);
-            classInfos.put(ci.getIdName(), ci);
-        } finally {
-            if (fos != null) {
-                fos.close();
-            }
-        }
-    }
-
-    @Override
-    public Collection<ClassInfo> getClasses() {
-        return classInfos.getInfos();
-    }
-
-    @Override
-    public ClassInfo resolveClass(String className) {
-        return classInfos.get(className);
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMMethodInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.Type;
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.MethodInfo;
-import org.openjdk.jmh.generators.source.ParameterInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ASMMethodInfo extends MethodVisitor implements MethodInfo  {
-
-    private final ASMClassInfo declaringClass;
-    private final Map<String, AnnotationInvocationHandler> annotations;
-    private final int access;
-    private final String name;
-    private final String returnType;
-    private final Type[] argumentTypes;
-    private final ClassInfoRepo repo;
-
-    public ASMMethodInfo(MethodVisitor methodVisitor, ClassInfoRepo repo, ASMClassInfo declaringClass, int access, String name, String desc, String signature) {
-        super(Opcodes.ASM4, methodVisitor);
-        this.declaringClass = declaringClass;
-        this.repo = repo;
-        this.access = access;
-        this.name = name;
-        this.returnType = Type.getReturnType(desc).getClassName();
-        this.annotations = new HashMap<String, AnnotationInvocationHandler>();
-        this.argumentTypes = Type.getArgumentTypes(desc);
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        AnnotationInvocationHandler handler = annotations.get(annClass.getCanonicalName());
-        if (handler == null) {
-            return null;
-        } else {
-            return (T) Proxy.newProxyInstance(
-                    Thread.currentThread().getContextClassLoader(),
-                    new Class[]{annClass},
-                    handler);
-        }
-    }
-
-    @Override
-    public AnnotationVisitor visitAnnotation(final String desc, boolean visible) {
-        AnnotationInvocationHandler annHandler = new AnnotationInvocationHandler(super.visitAnnotation(desc, visible));
-        annotations.put(Type.getType(desc).getClassName(), annHandler);
-        return annHandler;
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return declaringClass;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getQualifiedName() {
-        return declaringClass.getQualifiedName() + "." + name;
-    }
-
-    @Override
-    public String getReturnType() {
-        return returnType;
-    }
-
-    @Override
-    public Collection<ParameterInfo> getParameters() {
-        Collection<ParameterInfo> result = new ArrayList<ParameterInfo>();
-        for (Type t : argumentTypes) {
-            ClassInfo ci = repo.get(t.getClassName());
-            result.add(new ASMParameterInfo(ci));
-        }
-        return result;
-    }
-
-    @Override
-    public boolean isPublic() {
-        return (access & Opcodes.ACC_PUBLIC) > 0;
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return (access & Opcodes.ACC_ABSTRACT) > 0;
-    }
-
-    @Override
-    public boolean isSynchronized() {
-        return (access & Opcodes.ACC_SYNCHRONIZED) > 0;
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return (access & Opcodes.ACC_STRICT) > 0;
-    }
-
-    @Override
-    public int compareTo(MethodInfo o) {
-        return getQualifiedName().compareTo(o.getQualifiedName());
-    }
-
-    @Override
-    public String toString() {
-        return getQualifiedName() + "()";
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ASMParameterInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.ParameterInfo;
-
-public class ASMParameterInfo implements ParameterInfo {
-
-    private final ClassInfo ci;
-
-    public ASMParameterInfo(ClassInfo ci) {
-        this.ci = ci;
-    }
-
-    @Override
-    public ClassInfo getType() {
-        return ci;
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/AnnotationInvocationHandler.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.Opcodes;
-import org.openjdk.jmh.util.internal.HashMultimap;
-import org.openjdk.jmh.util.internal.Multimap;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-public class AnnotationInvocationHandler extends AnnotationVisitor implements InvocationHandler {
-    private final Multimap<String, Object> values;
-
-    public AnnotationInvocationHandler(AnnotationVisitor annotationVisitor) {
-        super(Opcodes.ASM4, annotationVisitor);
-        this.values = new HashMultimap<String, Object>();
-    }
-
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        String key = method.getName();
-        Class<?> returnType = method.getReturnType();
-
-        if (key.equalsIgnoreCase("toString")) {
-            return values;
-        }
-
-        Collection<Object> vs = values.get(key);
-
-        if (returnType.isArray()) {
-            Class<?> componentType = returnType.getComponentType();
-            if (componentType.isEnum()) {
-                int count = vs.size();
-                List<Object> list = new ArrayList<Object>(vs);
-
-                Object o = Array.newInstance(componentType, count);
-                for (int c = 0; c < count; c++) {
-                    Object v = list.get(c);
-                    if (v instanceof String) {
-                        Method m = componentType.getMethod("valueOf", String.class);
-                        v =  m.invoke(null, v);
-                    }
-                    Array.set(o, c, v);
-                }
-                return o;
-            } else if (componentType.isPrimitive()) {
-                throw new IllegalStateException("Primitive arrays are not handled yet");
-            } else {
-                String[] strings = vs.toArray(new String[vs.size()]);
-                if (strings.length == 0) {
-                    strings = (String[]) method.getDefaultValue();
-                }
-                return strings;
-            }
-        } else {
-            Object value;
-            if (vs == null || vs.isEmpty()) {
-                value = method.getDefaultValue();
-            } else {
-                if (vs.size() == 1) {
-                    value = vs.iterator().next();
-                } else {
-                    throw new IllegalStateException("Expected to see a single value, but got " + vs.size());
-                }
-            }
-
-            if (returnType.isEnum() && (value instanceof String)) {
-                Method m = returnType.getMethod("valueOf", String.class);
-                return m.invoke(null, value);
-            }
-            return value;
-        }
-    }
-
-    @Override
-    public void visit(String name, Object value) {
-        values.put(name, value);
-        super.visit(name, value);
-    }
-
-    @Override
-    public void visitEnum(String name, String desc, String value) {
-        values.put(name, value);
-        super.visitEnum(name, desc, value);
-    }
-
-    @Override
-    public AnnotationVisitor visitArray(final String name) {
-        return new AnnotationVisitor(Opcodes.ASM4, super.visitArray(name)) {
-            @Override
-            public void visitEnum(String n, String desc, String value) {
-                values.put(name, value);
-                super.visitEnum(n, desc, value);
-            }
-
-            @Override
-            public void visit(String n, Object value) {
-                values.put(name, value);
-                super.visit(n, value);
-            }
-        };
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/ClassInfoRepo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-import org.openjdk.jmh.generators.reflective.RFClassInfo;
-import org.openjdk.jmh.generators.source.ClassInfo;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ClassInfoRepo {
-
-    private final Map<String, ClassInfo> map = new HashMap<String, ClassInfo>();
-
-    public ClassInfo get(String desc) {
-        desc = desc.replace('/', '.');
-        ClassInfo info = map.get(desc);
-        if (info != null) {
-            return info;
-        }
-
-        try {
-            return new RFClassInfo(Class.forName(desc, false, Thread.currentThread().getContextClassLoader()));
-        } catch (ClassNotFoundException e) {
-            throw new IllegalStateException("Unable to resolve class: " + desc);
-        }
-    }
-
-    public void put(String desc, ClassInfo info) {
-        desc = desc.replace('/', '.');
-        map.put(desc, info);
-    }
-
-    public Collection<ClassInfo> getInfos() {
-        return map.values();
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/SourceElementError.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-import org.openjdk.jmh.generators.source.MetadataInfo;
-
-public class SourceElementError extends SourceError {
-
-    private final MetadataInfo element;
-
-    public SourceElementError(String message, MetadataInfo element) {
-        super(message);
-        this.element = element;
-    }
-
-    @Override
-    public String toString() {
-        return super.toString() + "\n   [" + element.toString() + "]";
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/SourceError.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-public class SourceError {
-
-    private final String message;
-
-    public SourceError(String message) {
-        this.message = message;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    @Override
-    public String toString() {
-        return message;
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/bytecode/SourceThrowableError.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.bytecode;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-public class SourceThrowableError extends SourceError {
-
-    private final Throwable element;
-
-    public SourceThrowableError(String message, Throwable element) {
-        super(message);
-        this.element = element;
-    }
-
-    @Override
-    public String toString() {
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
-        element.printStackTrace(pw);
-        pw.close();
-        return super.toString() + "\n" + sw.toString();
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/FileSystemDestination.java	Thu Mar 06 20:32:14 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/FileSystemDestination.java	Thu Mar 06 21:25:06 2014 +0400
@@ -24,11 +24,11 @@
  */
 package org.openjdk.jmh.generators.core;
 
-import org.openjdk.jmh.generators.bytecode.SourceElementError;
-import org.openjdk.jmh.generators.bytecode.SourceError;
-import org.openjdk.jmh.generators.bytecode.SourceThrowableError;
 import org.openjdk.jmh.generators.source.GeneratorDestination;
 import org.openjdk.jmh.generators.source.MetadataInfo;
+import org.openjdk.jmh.generators.source.SourceElementError;
+import org.openjdk.jmh.generators.source.SourceError;
+import org.openjdk.jmh.generators.source.SourceThrowableError;
 
 import java.io.File;
 import java.io.FileWriter;
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFClassInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.FieldInfo;
-import org.openjdk.jmh.generators.source.MethodInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collection;
-
-public class RFClassInfo implements ClassInfo {
-    private final Class<?> klass;
-
-    public RFClassInfo(Class<?> klass) {
-        this.klass = klass;
-    }
-
-    @Override
-    public String getPackageName() {
-        if (klass.getDeclaringClass() != null) {
-            return klass.getDeclaringClass().getPackage().getName();
-        } else {
-            return klass.getPackage().getName();
-        }
-    }
-
-    @Override
-    public String getName() {
-        String name = klass.getSimpleName();
-        if (name.contains("$")) {
-            return name.substring(name.lastIndexOf("$"));
-        } else {
-            return name;
-        }
-    }
-
-    @Override
-    public String getQualifiedName() {
-        String name = klass.getCanonicalName();
-        if (name.contains("$")) {
-            return name.replace("$", ".");
-        } else {
-            return name;
-        }
-    }
-
-    @Override
-    public Collection<FieldInfo> getFields() {
-        Collection<FieldInfo> fis = new ArrayList<FieldInfo>();
-        for (Field f : klass.getDeclaredFields()) {
-            fis.add(new RFFieldInfo(this, f));
-        }
-        return fis;
-    }
-
-    @Override
-    public Collection<MethodInfo> getConstructors() {
-        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
-        for (Constructor m : klass.getConstructors()) {
-            mis.add(new RFConstructorInfo(this, m));
-        }
-        return mis;
-    }
-
-    @Override
-    public Collection<MethodInfo> getMethods() {
-        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
-        for (Method m : klass.getMethods()) {
-            mis.add(new RFMethodInfo(this, m));
-        }
-        return mis;
-    }
-
-    @Override
-    public ClassInfo getSuperClass() {
-        if (klass.getSuperclass() != null) {
-            return new RFClassInfo(klass.getSuperclass());
-        } else {
-            return null;
-        }
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        if (klass.getDeclaringClass() != null) {
-            return new RFClassInfo(klass.getDeclaringClass());
-        } else {
-            return null;
-        }
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        return klass.getAnnotation(annClass);
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return Modifier.isAbstract(klass.getModifiers());
-    }
-
-    @Override
-    public boolean isPublic() {
-        return Modifier.isPublic(klass.getModifiers());
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return Modifier.isStrict(klass.getModifiers());
-    }
-
-    @Override
-    public boolean isFinal() {
-        return Modifier.isFinal(klass.getModifiers());
-    }
-
-    @Override
-    public String toString() {
-        return getQualifiedName();
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFConstructorInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.MethodInfo;
-import org.openjdk.jmh.generators.source.ParameterInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collection;
-
-public class RFConstructorInfo implements MethodInfo {
-
-    private final RFClassInfo declaringClass;
-    private final Constructor m;
-
-    public RFConstructorInfo(RFClassInfo declaringClass, Constructor m) {
-        this.declaringClass = declaringClass;
-        this.m = m;
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return declaringClass;
-    }
-
-    @Override
-    public String getName() {
-        return m.getName();
-    }
-
-    @Override
-    public String getQualifiedName() {
-        return declaringClass.getQualifiedName() + "." + m.getName();
-    }
-
-    @Override
-    public String getReturnType() {
-        throw new IllegalStateException("Asking the return type for constructor");
-    }
-
-    @Override
-    public Collection<ParameterInfo> getParameters() {
-        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
-        for (Class<?> cl : m.getParameterTypes()) {
-            pis.add(new RFParameterInfo(cl));
-        }
-        return pis;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        throw new IllegalStateException("Asking annotations for constructor");
-    }
-
-    @Override
-    public boolean isPublic() {
-        return Modifier.isPublic(m.getModifiers());
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return Modifier.isAbstract(m.getModifiers());
-    }
-
-    @Override
-    public boolean isSynchronized() {
-        return Modifier.isSynchronized(m.getModifiers());
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return Modifier.isStrict(m.getModifiers());
-    }
-
-    @Override
-    public int compareTo(MethodInfo o) {
-        return getQualifiedName().compareTo(o.getQualifiedName());
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFFieldInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.FieldInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-
-public class RFFieldInfo implements FieldInfo {
-    private final ClassInfo declaringClass;
-    private final Field f;
-
-    public RFFieldInfo(ClassInfo declaringClass, Field f) {
-        this.declaringClass = declaringClass;
-        this.f = f;
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return declaringClass;
-    }
-
-    @Override
-    public String getName() {
-        return f.getName();
-    }
-
-    @Override
-    public String getType() {
-        return f.getType().getCanonicalName();
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        return f.getAnnotation(annClass);
-    }
-
-    @Override
-    public boolean isPublic() {
-        return Modifier.isPublic(f.getModifiers());
-    }
-
-    @Override
-    public boolean isStatic() {
-        return Modifier.isStatic(f.getModifiers());
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFGeneratorSource.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.GeneratorSource;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-
-public class RFGeneratorSource implements GeneratorSource {
-
-    private final Collection<Class> classes;
-
-    public RFGeneratorSource() {
-        this.classes = new ArrayList<Class>();
-    }
-
-    @Override
-    public Collection<ClassInfo> getClasses() {
-        Collection<ClassInfo> cis = new ArrayList<ClassInfo>();
-        for (Class c : classes) {
-            cis.add(new RFClassInfo(c));
-        }
-        return cis;
-    }
-
-    @Override
-    public ClassInfo resolveClass(String className) {
-        String desc = className.replace('/', '.');
-        try {
-            return new RFClassInfo(Class.forName(desc, false, Thread.currentThread().getContextClassLoader()));
-        } catch (ClassNotFoundException e) {
-            throw new IllegalStateException("Unable to resolve class: " + desc);
-        }
-    }
-
-    public void processClasses(Class... cs) {
-        processClasses(Arrays.asList(cs));
-    }
-
-    public void processClasses(Collection<Class> cs) {
-        classes.addAll(cs);
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFMethodInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.MethodInfo;
-import org.openjdk.jmh.generators.source.ParameterInfo;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collection;
-
-public class RFMethodInfo implements MethodInfo {
-
-    private final RFClassInfo declaringClass;
-    private final Method m;
-
-    public RFMethodInfo(RFClassInfo declaringClass, Method m) {
-        this.declaringClass = declaringClass;
-        this.m = m;
-    }
-
-    @Override
-    public ClassInfo getDeclaringClass() {
-        return declaringClass;
-    }
-
-    @Override
-    public String getName() {
-        return m.getName();
-    }
-
-    @Override
-    public String getQualifiedName() {
-        return declaringClass.getQualifiedName() + "." + m.getName();
-    }
-
-    @Override
-    public String getReturnType() {
-        return m.getReturnType().getCanonicalName();
-    }
-
-    @Override
-    public Collection<ParameterInfo> getParameters() {
-        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
-        for (Class<?> cl : m.getParameterTypes()) {
-            pis.add(new RFParameterInfo(cl));
-        }
-        return pis;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
-        return m.getAnnotation(annClass);
-    }
-
-    @Override
-    public boolean isPublic() {
-        return Modifier.isPublic(m.getModifiers());
-    }
-
-    @Override
-    public boolean isAbstract() {
-        return Modifier.isAbstract(m.getModifiers());
-    }
-
-    @Override
-    public boolean isSynchronized() {
-        return Modifier.isSynchronized(m.getModifiers());
-    }
-
-    @Override
-    public boolean isStrictFP() {
-        return Modifier.isStrict(m.getModifiers());
-    }
-
-    @Override
-    public int compareTo(MethodInfo o) {
-        return getQualifiedName().compareTo(o.getQualifiedName());
-    }
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/reflective/RFParameterInfo.java	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.generators.reflective;
-
-import org.openjdk.jmh.generators.source.ClassInfo;
-import org.openjdk.jmh.generators.source.ParameterInfo;
-
-public class RFParameterInfo implements ParameterInfo {
-    private final Class<?> cl;
-
-    public RFParameterInfo(Class<?> cl) {
-        this.cl = cl;
-    }
-
-    @Override
-    public ClassInfo getType() {
-        return new RFClassInfo(cl);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/source/SourceElementError.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.source;
+
+public class SourceElementError extends SourceError {
+
+    private final MetadataInfo element;
+
+    public SourceElementError(String message, MetadataInfo element) {
+        super(message);
+        this.element = element;
+    }
+
+    @Override
+    public String toString() {
+        return super.toString() + "\n   [" + element.toString() + "]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/source/SourceError.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.source;
+
+public class SourceError {
+
+    private final String message;
+
+    public SourceError(String message) {
+        this.message = message;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    @Override
+    public String toString() {
+        return message;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/source/SourceThrowableError.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.source;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+public class SourceThrowableError extends SourceError {
+
+    private final Throwable element;
+
+    public SourceThrowableError(String message, Throwable element) {
+        super(message);
+        this.element = element;
+    }
+
+    @Override
+    public String toString() {
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        element.printStackTrace(pw);
+        pw.close();
+        return super.toString() + "\n" + sw.toString();
+    }
+}
--- a/jmh-core/src/main/resources/META-INF/services/javax.annotation.processing.Processor	Thu Mar 06 20:32:14 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#    Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
-#    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-#    This code is free software; you can redistribute it and/or modify it
-#    under the terms of the GNU General Public License version 2 only, as
-#    published by the Free Software Foundation.  Oracle designates this
-#    particular file as subject to the "Classpath" exception as provided
-#    by Oracle in the LICENSE file that accompanied this code.
-#
-#    This code is distributed in the hope that it will be useful, but WITHOUT
-#    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-#    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-#    version 2 for more details (a copy is included in the LICENSE file that
-#    accompanied this code).
-#
-#    You should have received a copy of the GNU General Public License version
-#    2 along with this work; if not, write to the Free Software Foundation,
-#    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-#    Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-#    or visit www.oracle.com if you need additional information or have any
-#    questions.
-#
-org.openjdk.jmh.generators.GenerateMicroBenchmarkProcessor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,107 @@
+<!--
+Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.openjdk.jmh</groupId>
+        <artifactId>jmh-parent</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <name>JMH Generators: Annotation Processors</name>
+    <artifactId>jmh-generator-annprocess</artifactId>
+    <packaging>jar</packaging>
+
+    <description>
+        JMH benchmark generator, based on annotation processors.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <prerequisites>
+        <maven>3.0</maven>
+    </prerequisites>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <compilerVersion>1.6</compilerVersion>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                    <compilerArgument>-proc:none</compilerArgument>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.14.1</version>
+                <configuration>
+                    <useFile>false</useFile>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>com.mycila.maven-license-plugin</groupId>
+                <artifactId>maven-license-plugin</artifactId>
+                <version>1.10.b1</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>format</goal>
+                        </goals>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <header>file:///${project.basedir}/../src/license/gpl_cpe/header.txt</header>
+                            <skipExistingHeaders>false</skipExistingHeaders>
+                            <strictCheck>true</strictCheck>
+                            <mapping>
+                                <java>PHP</java>
+                            </mapping>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/GenerateMicroBenchmarkProcessor.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators;
+
+import org.openjdk.jmh.generators.annotations.APGeneratorDestinaton;
+import org.openjdk.jmh.generators.annotations.APGeneratorSource;
+import org.openjdk.jmh.generators.core.BenchmarkGenerator;
+import org.openjdk.jmh.generators.source.GeneratorDestination;
+import org.openjdk.jmh.generators.source.GeneratorSource;
+
+import javax.annotation.processing.AbstractProcessor;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.TypeElement;
+import java.util.Set;
+
+/**
+ * @author staffan.friberg@oracle.com
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+@SupportedAnnotationTypes("*")
+@SupportedSourceVersion(SourceVersion.RELEASE_6)
+public class GenerateMicroBenchmarkProcessor extends AbstractProcessor {
+
+    private final BenchmarkGenerator generator = new BenchmarkGenerator();
+
+    @Override
+    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+        GeneratorSource source = new APGeneratorSource(roundEnv, processingEnv);
+        GeneratorDestination destination = new APGeneratorDestinaton(roundEnv, processingEnv);
+        if (!roundEnv.processingOver()) {
+            generator.generate(source, destination);
+        } else {
+            generator.complete(source, destination);
+        }
+        return true;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APClassInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.annotations;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.FieldInfo;
+import org.openjdk.jmh.generators.source.MethodInfo;
+
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.PackageElement;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.util.ElementFilter;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class APClassInfo extends APMetadataInfo implements ClassInfo {
+
+    private final TypeElement el;
+
+    public APClassInfo(ProcessingEnvironment processEnv, TypeElement element) {
+        super(processEnv, element);
+        this.el = element;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        return el.getAnnotation(annClass);
+    }
+
+    @Override
+    public Collection<MethodInfo> getConstructors() {
+        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
+        for (ExecutableElement e : ElementFilter.constructorsIn(el.getEnclosedElements())) {
+            mis.add(new APMethodInfo(processEnv, this, e));
+        }
+        return mis;
+    }
+
+    @Override
+    public String getName() {
+        return el.getSimpleName().toString();
+    }
+
+    @Override
+    public String getQualifiedName() {
+        return el.getQualifiedName().toString();
+    }
+
+    @Override
+    public Collection<FieldInfo> getFields() {
+        List<FieldInfo> ls = new ArrayList<FieldInfo>();
+        for (VariableElement e : ElementFilter.fieldsIn(el.getEnclosedElements())) {
+            ls.add(new APFieldInfo(processEnv, e));
+        }
+        return ls;
+    }
+
+
+    @Override
+    public Collection<MethodInfo> getMethods() {
+        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
+        for (ExecutableElement e : ElementFilter.methodsIn(el.getEnclosedElements())) {
+            mis.add(new APMethodInfo(processEnv, this, e));
+        }
+        return mis;
+    }
+
+    @Override
+    public String getPackageName() {
+        Element walk = el;
+        while (walk.getKind() != ElementKind.PACKAGE) {
+            walk = walk.getEnclosingElement();
+        }
+        return ((PackageElement)walk).getQualifiedName().toString();
+    }
+
+    @Override
+    public ClassInfo getSuperClass() {
+        TypeMirror superclass = el.getSuperclass();
+        if (superclass.getKind() == TypeKind.NONE) {
+            return null;
+        } else {
+            TypeElement element = (TypeElement) processEnv.getTypeUtils().asElement(superclass);
+            return new APClassInfo(processEnv, element);
+        }
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        Element enclosingElement = el.getEnclosingElement();
+        if (enclosingElement.getKind() == ElementKind.CLASS) {
+            return new APClassInfo(processEnv, (TypeElement) enclosingElement);
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return el.getModifiers().contains(Modifier.ABSTRACT);
+    }
+
+    @Override
+    public boolean isPublic() {
+        return el.getModifiers().contains(Modifier.PUBLIC);
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return el.getModifiers().contains(Modifier.STRICTFP);
+    }
+
+    @Override
+    public boolean isFinal() {
+        return el.getModifiers().contains(Modifier.FINAL);
+    }
+
+    public String toString() {
+        return getQualifiedName();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APFieldInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.annotations;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.FieldInfo;
+
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
+import java.lang.annotation.Annotation;
+
+public class APFieldInfo extends APMetadataInfo implements FieldInfo {
+
+    private final VariableElement ve;
+
+    public APFieldInfo(ProcessingEnvironment processEnv, VariableElement ve) {
+        super(processEnv, ve);
+        this.ve = ve;
+    }
+
+    @Override
+    public String getName() {
+        return ve.getSimpleName().toString();
+    }
+
+    @Override
+    public String getType() {
+        return ve.asType().toString();
+    }
+
+    @Override
+    public boolean isPublic() {
+        return ve.getModifiers().contains(Modifier.PUBLIC);
+    }
+
+    @Override
+    public boolean isStatic() {
+        return ve.getModifiers().contains(Modifier.STATIC);
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        return ve.getAnnotation(annClass);
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return new APClassInfo(processEnv, (TypeElement)ve.getEnclosingElement());
+    }
+
+    public String toString() {
+        return getType() + " " + getName();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APGeneratorDestinaton.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.annotations;
+
+import org.openjdk.jmh.generators.source.GeneratorDestination;
+import org.openjdk.jmh.generators.source.MetadataInfo;
+
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.annotation.processing.RoundEnvironment;
+import javax.tools.Diagnostic;
+import javax.tools.StandardLocation;
+import java.io.IOException;
+import java.io.Writer;
+
+public class APGeneratorDestinaton implements GeneratorDestination {
+
+    private final RoundEnvironment roundEnv;
+    private final ProcessingEnvironment processingEnv;
+
+    public APGeneratorDestinaton(RoundEnvironment roundEnv, ProcessingEnvironment processingEnv) {
+        this.roundEnv = roundEnv;
+        this.processingEnv = processingEnv;
+    }
+
+    @Override
+    public Writer newResource(String resourcePath) throws IOException {
+        return processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", resourcePath).openWriter();
+    }
+
+    @Override
+    public Writer newClass(String className) throws IOException {
+        return processingEnv.getFiler().createSourceFile(className).openWriter();
+    }
+
+    @Override
+    public void printError(String message) {
+        processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message);
+    }
+
+    @Override
+    public void printError(String message, MetadataInfo element) {
+        processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message, ((APMetadataInfo)element).getElement());
+    }
+
+    @Override
+    public void printError(String message, Throwable throwable) {
+        printError(message + " " + throwable);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APGeneratorSource.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.annotations;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.GeneratorSource;
+
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.annotation.processing.RoundEnvironment;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.util.ElementFilter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
+import java.util.TreeSet;
+
+public class APGeneratorSource implements GeneratorSource {
+
+    private final RoundEnvironment roundEnv;
+    private final ProcessingEnvironment processingEnv;
+    private Collection<ClassInfo> classInfos;
+
+    public APGeneratorSource(RoundEnvironment roundEnv, ProcessingEnvironment processingEnv) {
+        this.roundEnv = roundEnv;
+        this.processingEnv = processingEnv;
+    }
+
+    @Override
+    public Collection<ClassInfo> getClasses() {
+        if (classInfos != null) {
+            return classInfos;
+        }
+
+        Collection<TypeElement> discoveredClasses = new TreeSet<TypeElement>(new Comparator<TypeElement>() {
+            @Override
+            public int compare(TypeElement o1, TypeElement o2) {
+                return o1.getQualifiedName().toString().compareTo(o2.getQualifiedName().toString());
+            }
+        });
+
+        // Need to do a few rollovers to find all classes that have @GMB-annotated methods in their
+        // subclasses. This is mostly due to some of the nested classes not discoverable at once,
+        // when we need to discover the enclosing class first. With the potentially non-zero nesting
+        // depth, we need to do a few rounds. Hopefully we will just do a single stride in most
+        // cases.
+
+        List<TypeElement> front = new ArrayList<TypeElement>();
+
+        for (Element e : roundEnv.getRootElements()) {
+            if (e.getKind() != ElementKind.CLASS) continue;
+            front.add((TypeElement) e);
+        }
+
+        while (!front.isEmpty()) {
+            discoveredClasses.addAll(front);
+
+            List<TypeElement> newClasses = new ArrayList<TypeElement>();
+            for (Element e : front) {
+                TypeElement walk = (TypeElement) e;
+                do {
+                    for (TypeElement nested : ElementFilter.typesIn(walk.getEnclosedElements())) {
+                        newClasses.add(nested);
+                    }
+                } while ((walk = (TypeElement) processingEnv.getTypeUtils().asElement(walk.getSuperclass())) != null);
+            }
+            front = newClasses;
+        }
+
+        classInfos = convert(discoveredClasses);
+        return classInfos;
+    }
+
+    protected Collection<ClassInfo> convert(Collection<TypeElement> els) {
+        List<ClassInfo> list = new ArrayList<ClassInfo>();
+        for (TypeElement el : els) {
+            list.add(new APClassInfo(processingEnv, el));
+        }
+        return list;
+    }
+
+    @Override
+    public ClassInfo resolveClass(String className) {
+        return new APClassInfo(processingEnv, processingEnv.getElementUtils().getTypeElement(className));
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APMetadataInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.annotations;
+
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.Element;
+
+public class APMetadataInfo {
+
+    protected final ProcessingEnvironment processEnv;
+    private final Element element;
+
+    public APMetadataInfo(ProcessingEnvironment processEnv, Element element) {
+        this.processEnv = processEnv;
+        this.element = element;
+    }
+
+    public Element getElement() {
+        return element;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APMethodInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.annotations;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.MethodInfo;
+import org.openjdk.jmh.generators.source.ParameterInfo;
+
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.VariableElement;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class APMethodInfo extends APMetadataInfo implements MethodInfo {
+
+    private final ClassInfo ci;
+    private final ExecutableElement el;
+
+    public APMethodInfo(ProcessingEnvironment processEnv, ClassInfo ci, ExecutableElement el) {
+        super(processEnv, el);
+        this.ci = ci;
+        this.el = el;
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return ci;
+    }
+
+    @Override
+    public String getName() {
+        return el.getSimpleName().toString();
+    }
+
+    @Override
+    public String getReturnType() {
+        return el.getReturnType().toString();
+    }
+
+    @Override
+    public Collection<ParameterInfo> getParameters() {
+        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
+        for (VariableElement v : el.getParameters()) {
+            pis.add(new APParameterInfo(processEnv, v));
+        }
+        return pis;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        return el.getAnnotation(annClass);
+    }
+
+    @Override
+    public boolean isPublic() {
+        return el.getModifiers().contains(Modifier.PUBLIC);
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return el.getModifiers().contains(Modifier.ABSTRACT);
+    }
+
+    @Override
+    public boolean isSynchronized() {
+        return el.getModifiers().contains(Modifier.SYNCHRONIZED);
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return el.getModifiers().contains(Modifier.STRICTFP);
+    }
+
+    @Override
+    public String getQualifiedName() {
+        return ci.getQualifiedName() + "." + el.toString();
+    }
+
+    @Override
+    public int compareTo(MethodInfo o) {
+        return getQualifiedName().compareTo(o.getQualifiedName());
+    }
+
+    public String toString() {
+        return getDeclaringClass() + " " + getName() ;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/src/main/java/org/openjdk/jmh/generators/annotations/APParameterInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.annotations;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.ParameterInfo;
+
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
+
+public class APParameterInfo extends APMetadataInfo implements ParameterInfo {
+    private final VariableElement ve;
+    private final TypeElement stateType;
+
+    public APParameterInfo(ProcessingEnvironment processEnv, VariableElement ve) {
+        super(processEnv, ve);
+        this.ve = ve;
+        this.stateType = (TypeElement) processEnv.getTypeUtils().asElement(ve.asType());
+    }
+
+    @Override
+    public ClassInfo getType() {
+        return new APClassInfo(processEnv, stateType);
+    }
+
+    public String toString() {
+        return getType() + " " + ve.getSimpleName();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-annprocess/src/main/resources/META-INF/services/javax.annotation.processing.Processor	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,24 @@
+#    Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+#    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+#    This code is free software; you can redistribute it and/or modify it
+#    under the terms of the GNU General Public License version 2 only, as
+#    published by the Free Software Foundation.  Oracle designates this
+#    particular file as subject to the "Classpath" exception as provided
+#    by Oracle in the LICENSE file that accompanied this code.
+#
+#    This code is distributed in the hope that it will be useful, but WITHOUT
+#    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#    version 2 for more details (a copy is included in the LICENSE file that
+#    accompanied this code).
+#
+#    You should have received a copy of the GNU General Public License version
+#    2 along with this work; if not, write to the Free Software Foundation,
+#    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+#    Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+#    or visit www.oracle.com if you need additional information or have any
+#    questions.
+#
+org.openjdk.jmh.generators.GenerateMicroBenchmarkProcessor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-bytecode/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,116 @@
+<!--
+Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.openjdk.jmh</groupId>
+        <artifactId>jmh-parent</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <name>JMH Generators: Bytecode</name>
+    <artifactId>jmh-generator-bytecode</artifactId>
+    <packaging>jar</packaging>
+
+    <description>
+        JMH benchmark generator, based on bytecode inspection.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-generator-reflection</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ow2.asm</groupId>
+            <artifactId>asm</artifactId>
+            <version>4.2</version>
+        </dependency>
+    </dependencies>
+
+    <prerequisites>
+        <maven>3.0</maven>
+    </prerequisites>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <compilerVersion>1.6</compilerVersion>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                    <compilerArgument>-proc:none</compilerArgument>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.14.1</version>
+                <configuration>
+                    <useFile>false</useFile>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>com.mycila.maven-license-plugin</groupId>
+                <artifactId>maven-license-plugin</artifactId>
+                <version>1.10.b1</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>format</goal>
+                        </goals>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <header>file:///${project.basedir}/../src/license/gpl_cpe/header.txt</header>
+                            <skipExistingHeaders>false</skipExistingHeaders>
+                            <strictCheck>true</strictCheck>
+                            <mapping>
+                                <java>PHP</java>
+                            </mapping>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMClassInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.bytecode;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.FieldInfo;
+import org.openjdk.jmh.generators.source.MethodInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ASMClassInfo extends ClassVisitor implements ClassInfo {
+
+    private String idName;
+    private String packageName;
+    private String qualifiedName;
+    private String name;
+    private int access;
+
+    private final List<MethodInfo> methods;
+    private final List<MethodInfo> constructors;
+    private final List<FieldInfo> fields;
+    private final Map<String, AnnotationInvocationHandler> annotations = new HashMap<String, AnnotationInvocationHandler>();
+    private final ClassInfoRepo classInfos;
+    private String superName;
+    private String declaringClass;
+
+    public ASMClassInfo(ClassInfoRepo classInfos) {
+        super(Opcodes.ASM4);
+        this.classInfos = classInfos;
+        methods = new ArrayList<MethodInfo>();
+        constructors = new ArrayList<MethodInfo>();
+        fields = new ArrayList<FieldInfo>();
+    }
+
+    public String getIdName() {
+        return idName;
+    }
+
+    @Override
+    public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
+        super.visit(version, access, name, signature, superName, interfaces);
+        this.superName = superName;
+        this.idName = name;
+        this.access = access;
+        qualifiedName = name.replace("/", ".");
+        packageName = qualifiedName.substring(0, qualifiedName.lastIndexOf("."));
+        qualifiedName = qualifiedName.replace('$', '.');
+        this.name = qualifiedName.substring(qualifiedName.lastIndexOf(".") + 1);
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        AnnotationInvocationHandler handler = annotations.get(annClass.getCanonicalName());
+        if (handler == null) {
+            return null;
+        } else {
+            return (T) Proxy.newProxyInstance(
+                    Thread.currentThread().getContextClassLoader(),
+                    new Class[]{annClass},
+                    handler);
+        }
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(final String desc, boolean visible) {
+        AnnotationInvocationHandler annHandler = new AnnotationInvocationHandler(super.visitAnnotation(desc, visible));
+        annotations.put(Type.getType(desc).getClassName(), annHandler);
+        return annHandler;
+    }
+
+    @Override
+    public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
+        ASMFieldInfo fi = new ASMFieldInfo(super.visitField(access, name, desc, signature, value),
+                this, access, name, desc, signature);
+        fields.add(fi);
+        return fi;
+    }
+
+    @Override
+    public MethodVisitor visitMethod(int access, final String methodName, String methodDesc, String signature, String[] exceptions) {
+        ASMMethodInfo mi = new ASMMethodInfo(super.visitMethod(access, methodName, methodDesc, signature, exceptions),
+                classInfos, this, access, methodName, methodDesc, signature);
+        methods.add(mi);
+        if (methodName.equals("<init>")) {
+            constructors.add(mi);
+        }
+        return mi;
+    }
+
+    @Override
+    public String getPackageName() {
+        return packageName;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String getQualifiedName() {
+        return qualifiedName;
+    }
+
+    @Override
+    public Collection<FieldInfo> getFields() {
+        return fields;
+    }
+
+    @Override
+    public Collection<MethodInfo> getConstructors() {
+        return constructors;
+    }
+
+    @Override
+    public Collection<MethodInfo> getMethods() {
+        return methods;
+    }
+
+    @Override
+    public ClassInfo getSuperClass() {
+        return classInfos.get(superName);
+    }
+
+    @Override
+    public void visitInnerClass(String name, String outerName, String innerName, int access) {
+        if (name.equals(idName)) {
+            declaringClass = outerName;
+        }
+        super.visitInnerClass(name, outerName, innerName, access);
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        if (declaringClass != null) {
+            return classInfos.get(declaringClass);
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return (access & Opcodes.ACC_ABSTRACT) > 0;
+    }
+
+    @Override
+    public boolean isPublic() {
+        return (access & Opcodes.ACC_PUBLIC) > 0;
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return (access & Opcodes.ACC_STRICT) > 0;
+    }
+
+    @Override
+    public boolean isFinal() {
+        return (access & Opcodes.ACC_FINAL) > 0;
+    }
+
+    @Override
+    public String toString() {
+        return qualifiedName;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMFieldInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.bytecode;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.FieldInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Proxy;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ASMFieldInfo extends FieldVisitor implements FieldInfo {
+
+    private final String type;
+    private final ASMClassInfo declaringClass;
+    private final int access;
+    private final String name;
+    private final Map<String, AnnotationInvocationHandler> annotations;
+
+    public ASMFieldInfo(FieldVisitor fieldVisitor, ASMClassInfo declaringClass, int access, String name, String desc, String signature) {
+        super(Opcodes.ASM4, fieldVisitor);
+        this.declaringClass = declaringClass;
+        this.access = access;
+        this.name = name;
+        this.type = Type.getReturnType(desc).getClassName();
+        this.annotations = new HashMap<String, AnnotationInvocationHandler>();
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String getType() {
+        return type;
+    }
+
+    @Override
+    public boolean isPublic() {
+        return (access & Opcodes.ACC_PUBLIC) > 0;
+    }
+
+    @Override
+    public boolean isStatic() {
+        return (access & Opcodes.ACC_STATIC) > 0;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        AnnotationInvocationHandler handler = annotations.get(annClass.getCanonicalName());
+        if (handler == null) {
+            return null;
+        } else {
+            return (T) Proxy.newProxyInstance(
+                    Thread.currentThread().getContextClassLoader(),
+                    new Class[]{annClass},
+                    handler);
+        }
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(final String desc, boolean visible) {
+        AnnotationInvocationHandler annHandler = new AnnotationInvocationHandler(super.visitAnnotation(desc, visible));
+        annotations.put(Type.getType(desc).getClassName(), annHandler);
+        return annHandler;
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return declaringClass;
+    }
+
+    @Override
+    public String toString() {
+        return declaringClass.getQualifiedName() + "." + name;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMGeneratorSource.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.bytecode;
+
+import org.objectweb.asm.ClassReader;
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.GeneratorSource;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Collection;
+
+public class ASMGeneratorSource implements GeneratorSource {
+
+    private final ClassInfoRepo classInfos;
+
+    public ASMGeneratorSource() {
+        this.classInfos = new ClassInfoRepo();
+    }
+
+    public void processClasses(Collection<File> classFiles)  throws IOException {
+        for (File f : classFiles) {
+            processClass(f);
+        }
+    }
+
+    public void processClass(File classFile) throws IOException {
+        final ASMClassInfo ci = new ASMClassInfo(classInfos);
+        FileInputStream fos = null;
+        try {
+            fos = new FileInputStream(classFile);
+            ClassReader reader = new ClassReader(fos);
+            reader.accept(ci, 0);
+            classInfos.put(ci.getIdName(), ci);
+        } finally {
+            if (fos != null) {
+                fos.close();
+            }
+        }
+    }
+
+    @Override
+    public Collection<ClassInfo> getClasses() {
+        return classInfos.getInfos();
+    }
+
+    @Override
+    public ClassInfo resolveClass(String className) {
+        return classInfos.get(className);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMMethodInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.bytecode;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.MethodInfo;
+import org.openjdk.jmh.generators.source.ParameterInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ASMMethodInfo extends MethodVisitor implements MethodInfo  {
+
+    private final ASMClassInfo declaringClass;
+    private final Map<String, AnnotationInvocationHandler> annotations;
+    private final int access;
+    private final String name;
+    private final String returnType;
+    private final Type[] argumentTypes;
+    private final ClassInfoRepo repo;
+
+    public ASMMethodInfo(MethodVisitor methodVisitor, ClassInfoRepo repo, ASMClassInfo declaringClass, int access, String name, String desc, String signature) {
+        super(Opcodes.ASM4, methodVisitor);
+        this.declaringClass = declaringClass;
+        this.repo = repo;
+        this.access = access;
+        this.name = name;
+        this.returnType = Type.getReturnType(desc).getClassName();
+        this.annotations = new HashMap<String, AnnotationInvocationHandler>();
+        this.argumentTypes = Type.getArgumentTypes(desc);
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        AnnotationInvocationHandler handler = annotations.get(annClass.getCanonicalName());
+        if (handler == null) {
+            return null;
+        } else {
+            return (T) Proxy.newProxyInstance(
+                    Thread.currentThread().getContextClassLoader(),
+                    new Class[]{annClass},
+                    handler);
+        }
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(final String desc, boolean visible) {
+        AnnotationInvocationHandler annHandler = new AnnotationInvocationHandler(super.visitAnnotation(desc, visible));
+        annotations.put(Type.getType(desc).getClassName(), annHandler);
+        return annHandler;
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return declaringClass;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String getQualifiedName() {
+        return declaringClass.getQualifiedName() + "." + name;
+    }
+
+    @Override
+    public String getReturnType() {
+        return returnType;
+    }
+
+    @Override
+    public Collection<ParameterInfo> getParameters() {
+        Collection<ParameterInfo> result = new ArrayList<ParameterInfo>();
+        for (Type t : argumentTypes) {
+            ClassInfo ci = repo.get(t.getClassName());
+            result.add(new ASMParameterInfo(ci));
+        }
+        return result;
+    }
+
+    @Override
+    public boolean isPublic() {
+        return (access & Opcodes.ACC_PUBLIC) > 0;
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return (access & Opcodes.ACC_ABSTRACT) > 0;
+    }
+
+    @Override
+    public boolean isSynchronized() {
+        return (access & Opcodes.ACC_SYNCHRONIZED) > 0;
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return (access & Opcodes.ACC_STRICT) > 0;
+    }
+
+    @Override
+    public int compareTo(MethodInfo o) {
+        return getQualifiedName().compareTo(o.getQualifiedName());
+    }
+
+    @Override
+    public String toString() {
+        return getQualifiedName() + "()";
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ASMParameterInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.bytecode;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.ParameterInfo;
+
+public class ASMParameterInfo implements ParameterInfo {
+
+    private final ClassInfo ci;
+
+    public ASMParameterInfo(ClassInfo ci) {
+        this.ci = ci;
+    }
+
+    @Override
+    public ClassInfo getType() {
+        return ci;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/AnnotationInvocationHandler.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.bytecode;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Opcodes;
+import org.openjdk.jmh.util.internal.HashMultimap;
+import org.openjdk.jmh.util.internal.Multimap;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class AnnotationInvocationHandler extends AnnotationVisitor implements InvocationHandler {
+    private final Multimap<String, Object> values;
+
+    public AnnotationInvocationHandler(AnnotationVisitor annotationVisitor) {
+        super(Opcodes.ASM4, annotationVisitor);
+        this.values = new HashMultimap<String, Object>();
+    }
+
+    @Override
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        String key = method.getName();
+        Class<?> returnType = method.getReturnType();
+
+        if (key.equalsIgnoreCase("toString")) {
+            return values;
+        }
+
+        Collection<Object> vs = values.get(key);
+
+        if (returnType.isArray()) {
+            Class<?> componentType = returnType.getComponentType();
+            if (componentType.isEnum()) {
+                int count = vs.size();
+                List<Object> list = new ArrayList<Object>(vs);
+
+                Object o = Array.newInstance(componentType, count);
+                for (int c = 0; c < count; c++) {
+                    Object v = list.get(c);
+                    if (v instanceof String) {
+                        Method m = componentType.getMethod("valueOf", String.class);
+                        v =  m.invoke(null, v);
+                    }
+                    Array.set(o, c, v);
+                }
+                return o;
+            } else if (componentType.isPrimitive()) {
+                throw new IllegalStateException("Primitive arrays are not handled yet");
+            } else {
+                String[] strings = vs.toArray(new String[vs.size()]);
+                if (strings.length == 0) {
+                    strings = (String[]) method.getDefaultValue();
+                }
+                return strings;
+            }
+        } else {
+            Object value;
+            if (vs == null || vs.isEmpty()) {
+                value = method.getDefaultValue();
+            } else {
+                if (vs.size() == 1) {
+                    value = vs.iterator().next();
+                } else {
+                    throw new IllegalStateException("Expected to see a single value, but got " + vs.size());
+                }
+            }
+
+            if (returnType.isEnum() && (value instanceof String)) {
+                Method m = returnType.getMethod("valueOf", String.class);
+                return m.invoke(null, value);
+            }
+            return value;
+        }
+    }
+
+    @Override
+    public void visit(String name, Object value) {
+        values.put(name, value);
+        super.visit(name, value);
+    }
+
+    @Override
+    public void visitEnum(String name, String desc, String value) {
+        values.put(name, value);
+        super.visitEnum(name, desc, value);
+    }
+
+    @Override
+    public AnnotationVisitor visitArray(final String name) {
+        return new AnnotationVisitor(Opcodes.ASM4, super.visitArray(name)) {
+            @Override
+            public void visitEnum(String n, String desc, String value) {
+                values.put(name, value);
+                super.visitEnum(n, desc, value);
+            }
+
+            @Override
+            public void visit(String n, Object value) {
+                values.put(name, value);
+                super.visit(n, value);
+            }
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-bytecode/src/main/java/org/openjdk/jmh/generators/bytecode/ClassInfoRepo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.bytecode;
+
+import org.openjdk.jmh.generators.reflective.RFClassInfo;
+import org.openjdk.jmh.generators.source.ClassInfo;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ClassInfoRepo {
+
+    private final Map<String, ClassInfo> map = new HashMap<String, ClassInfo>();
+
+    public ClassInfo get(String desc) {
+        desc = desc.replace('/', '.');
+        ClassInfo info = map.get(desc);
+        if (info != null) {
+            return info;
+        }
+
+        try {
+            return new RFClassInfo(Class.forName(desc, false, Thread.currentThread().getContextClassLoader()));
+        } catch (ClassNotFoundException e) {
+            throw new IllegalStateException("Unable to resolve class: " + desc);
+        }
+    }
+
+    public void put(String desc, ClassInfo info) {
+        desc = desc.replace('/', '.');
+        map.put(desc, info);
+    }
+
+    public Collection<ClassInfo> getInfos() {
+        return map.values();
+    }
+}
--- a/jmh-generator-maven-plugin/pom.xml	Thu Mar 06 20:32:14 2014 +0400
+++ b/jmh-generator-maven-plugin/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -39,7 +39,7 @@
         </dependency>
         <dependency>
             <groupId>org.openjdk.jmh</groupId>
-            <artifactId>jmh-core</artifactId>
+            <artifactId>jmh-generator-bytecode</artifactId>
             <version>${project.version}</version>
         </dependency>
     </dependencies>
--- a/jmh-generator-maven-plugin/src/main/java/org/openjdk/jmh/JmhMojo.java	Thu Mar 06 20:32:14 2014 +0400
+++ b/jmh-generator-maven-plugin/src/main/java/org/openjdk/jmh/JmhMojo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -6,9 +6,9 @@
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
 import org.openjdk.jmh.generators.bytecode.ASMGeneratorSource;
-import org.openjdk.jmh.generators.bytecode.SourceError;
 import org.openjdk.jmh.generators.core.BenchmarkGenerator;
 import org.openjdk.jmh.generators.core.FileSystemDestination;
+import org.openjdk.jmh.generators.source.SourceError;
 
 import java.io.File;
 import java.io.IOException;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,106 @@
+<!--
+Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.openjdk.jmh</groupId>
+        <artifactId>jmh-parent</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <name>JMH Generators: Reflection</name>
+    <artifactId>jmh-generator-reflection</artifactId>
+    <packaging>jar</packaging>
+
+    <description>
+        JMH benchmark generator, based on reflection.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <prerequisites>
+        <maven>3.0</maven>
+    </prerequisites>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <compilerVersion>1.6</compilerVersion>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                    <compilerArgument>-proc:none</compilerArgument>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.14.1</version>
+                <configuration>
+                    <useFile>false</useFile>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>com.mycila.maven-license-plugin</groupId>
+                <artifactId>maven-license-plugin</artifactId>
+                <version>1.10.b1</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>format</goal>
+                        </goals>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <header>file:///${project.basedir}/../src/license/gpl_cpe/header.txt</header>
+                            <skipExistingHeaders>false</skipExistingHeaders>
+                            <strictCheck>true</strictCheck>
+                            <mapping>
+                                <java>PHP</java>
+                            </mapping>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFClassInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflective;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.FieldInfo;
+import org.openjdk.jmh.generators.source.MethodInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class RFClassInfo implements ClassInfo {
+    private final Class<?> klass;
+
+    public RFClassInfo(Class<?> klass) {
+        this.klass = klass;
+    }
+
+    @Override
+    public String getPackageName() {
+        if (klass.getDeclaringClass() != null) {
+            return klass.getDeclaringClass().getPackage().getName();
+        } else {
+            return klass.getPackage().getName();
+        }
+    }
+
+    @Override
+    public String getName() {
+        String name = klass.getSimpleName();
+        if (name.contains("$")) {
+            return name.substring(name.lastIndexOf("$"));
+        } else {
+            return name;
+        }
+    }
+
+    @Override
+    public String getQualifiedName() {
+        String name = klass.getCanonicalName();
+        if (name.contains("$")) {
+            return name.replace("$", ".");
+        } else {
+            return name;
+        }
+    }
+
+    @Override
+    public Collection<FieldInfo> getFields() {
+        Collection<FieldInfo> fis = new ArrayList<FieldInfo>();
+        for (Field f : klass.getDeclaredFields()) {
+            fis.add(new RFFieldInfo(this, f));
+        }
+        return fis;
+    }
+
+    @Override
+    public Collection<MethodInfo> getConstructors() {
+        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
+        for (Constructor m : klass.getConstructors()) {
+            mis.add(new RFConstructorInfo(this, m));
+        }
+        return mis;
+    }
+
+    @Override
+    public Collection<MethodInfo> getMethods() {
+        Collection<MethodInfo> mis = new ArrayList<MethodInfo>();
+        for (Method m : klass.getMethods()) {
+            mis.add(new RFMethodInfo(this, m));
+        }
+        return mis;
+    }
+
+    @Override
+    public ClassInfo getSuperClass() {
+        if (klass.getSuperclass() != null) {
+            return new RFClassInfo(klass.getSuperclass());
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        if (klass.getDeclaringClass() != null) {
+            return new RFClassInfo(klass.getDeclaringClass());
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        return klass.getAnnotation(annClass);
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return Modifier.isAbstract(klass.getModifiers());
+    }
+
+    @Override
+    public boolean isPublic() {
+        return Modifier.isPublic(klass.getModifiers());
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return Modifier.isStrict(klass.getModifiers());
+    }
+
+    @Override
+    public boolean isFinal() {
+        return Modifier.isFinal(klass.getModifiers());
+    }
+
+    @Override
+    public String toString() {
+        return getQualifiedName();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFConstructorInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflective;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.MethodInfo;
+import org.openjdk.jmh.generators.source.ParameterInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class RFConstructorInfo implements MethodInfo {
+
+    private final RFClassInfo declaringClass;
+    private final Constructor m;
+
+    public RFConstructorInfo(RFClassInfo declaringClass, Constructor m) {
+        this.declaringClass = declaringClass;
+        this.m = m;
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return declaringClass;
+    }
+
+    @Override
+    public String getName() {
+        return m.getName();
+    }
+
+    @Override
+    public String getQualifiedName() {
+        return declaringClass.getQualifiedName() + "." + m.getName();
+    }
+
+    @Override
+    public String getReturnType() {
+        throw new IllegalStateException("Asking the return type for constructor");
+    }
+
+    @Override
+    public Collection<ParameterInfo> getParameters() {
+        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
+        for (Class<?> cl : m.getParameterTypes()) {
+            pis.add(new RFParameterInfo(cl));
+        }
+        return pis;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        throw new IllegalStateException("Asking annotations for constructor");
+    }
+
+    @Override
+    public boolean isPublic() {
+        return Modifier.isPublic(m.getModifiers());
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return Modifier.isAbstract(m.getModifiers());
+    }
+
+    @Override
+    public boolean isSynchronized() {
+        return Modifier.isSynchronized(m.getModifiers());
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return Modifier.isStrict(m.getModifiers());
+    }
+
+    @Override
+    public int compareTo(MethodInfo o) {
+        return getQualifiedName().compareTo(o.getQualifiedName());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFFieldInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflective;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.FieldInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+public class RFFieldInfo implements FieldInfo {
+    private final ClassInfo declaringClass;
+    private final Field f;
+
+    public RFFieldInfo(ClassInfo declaringClass, Field f) {
+        this.declaringClass = declaringClass;
+        this.f = f;
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return declaringClass;
+    }
+
+    @Override
+    public String getName() {
+        return f.getName();
+    }
+
+    @Override
+    public String getType() {
+        return f.getType().getCanonicalName();
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        return f.getAnnotation(annClass);
+    }
+
+    @Override
+    public boolean isPublic() {
+        return Modifier.isPublic(f.getModifiers());
+    }
+
+    @Override
+    public boolean isStatic() {
+        return Modifier.isStatic(f.getModifiers());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFGeneratorSource.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflective;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.GeneratorSource;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+
+public class RFGeneratorSource implements GeneratorSource {
+
+    private final Collection<Class> classes;
+
+    public RFGeneratorSource() {
+        this.classes = new ArrayList<Class>();
+    }
+
+    @Override
+    public Collection<ClassInfo> getClasses() {
+        Collection<ClassInfo> cis = new ArrayList<ClassInfo>();
+        for (Class c : classes) {
+            cis.add(new RFClassInfo(c));
+        }
+        return cis;
+    }
+
+    @Override
+    public ClassInfo resolveClass(String className) {
+        String desc = className.replace('/', '.');
+        try {
+            return new RFClassInfo(Class.forName(desc, false, Thread.currentThread().getContextClassLoader()));
+        } catch (ClassNotFoundException e) {
+            throw new IllegalStateException("Unable to resolve class: " + desc);
+        }
+    }
+
+    public void processClasses(Class... cs) {
+        processClasses(Arrays.asList(cs));
+    }
+
+    public void processClasses(Collection<Class> cs) {
+        classes.addAll(cs);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFMethodInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflective;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.MethodInfo;
+import org.openjdk.jmh.generators.source.ParameterInfo;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class RFMethodInfo implements MethodInfo {
+
+    private final RFClassInfo declaringClass;
+    private final Method m;
+
+    public RFMethodInfo(RFClassInfo declaringClass, Method m) {
+        this.declaringClass = declaringClass;
+        this.m = m;
+    }
+
+    @Override
+    public ClassInfo getDeclaringClass() {
+        return declaringClass;
+    }
+
+    @Override
+    public String getName() {
+        return m.getName();
+    }
+
+    @Override
+    public String getQualifiedName() {
+        return declaringClass.getQualifiedName() + "." + m.getName();
+    }
+
+    @Override
+    public String getReturnType() {
+        return m.getReturnType().getCanonicalName();
+    }
+
+    @Override
+    public Collection<ParameterInfo> getParameters() {
+        Collection<ParameterInfo> pis = new ArrayList<ParameterInfo>();
+        for (Class<?> cl : m.getParameterTypes()) {
+            pis.add(new RFParameterInfo(cl));
+        }
+        return pis;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annClass) {
+        return m.getAnnotation(annClass);
+    }
+
+    @Override
+    public boolean isPublic() {
+        return Modifier.isPublic(m.getModifiers());
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return Modifier.isAbstract(m.getModifiers());
+    }
+
+    @Override
+    public boolean isSynchronized() {
+        return Modifier.isSynchronized(m.getModifiers());
+    }
+
+    @Override
+    public boolean isStrictFP() {
+        return Modifier.isStrict(m.getModifiers());
+    }
+
+    @Override
+    public int compareTo(MethodInfo o) {
+        return getQualifiedName().compareTo(o.getQualifiedName());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-generator-reflection/src/main/java/org/openjdk/jmh/generators/reflective/RFParameterInfo.java	Thu Mar 06 21:25:06 2014 +0400
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.generators.reflective;
+
+import org.openjdk.jmh.generators.source.ClassInfo;
+import org.openjdk.jmh.generators.source.ParameterInfo;
+
+public class RFParameterInfo implements ParameterInfo {
+    private final Class<?> cl;
+
+    public RFParameterInfo(Class<?> cl) {
+        this.cl = cl;
+    }
+
+    @Override
+    public ClassInfo getType() {
+        return new RFClassInfo(cl);
+    }
+}
--- a/jmh-samples/pom.xml	Thu Mar 06 20:32:14 2014 +0400
+++ b/jmh-samples/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -47,7 +47,12 @@
         <dependency>
             <groupId>org.openjdk.jmh</groupId>
             <artifactId>jmh-core</artifactId>
-            <version>1.0-SNAPSHOT</version>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-generator-annprocess</artifactId>
+            <version>${project.version}</version>
         </dependency>
     </dependencies>
 
--- a/pom.xml	Thu Mar 06 20:32:14 2014 +0400
+++ b/pom.xml	Thu Mar 06 21:25:06 2014 +0400
@@ -162,6 +162,9 @@
         <module>jmh-core-it</module>
         <module>jmh-core-benchmarks</module>
         <module>jmh-samples</module>
+        <module>jmh-generator-annprocess</module>
+        <module>jmh-generator-bytecode</module>
+        <module>jmh-generator-reflection</module>
         <module>jmh-generator-maven-plugin</module>
         <module>jmh-archetypes</module>
     </modules>