Rename package jet -> kotlin in preloader and instrumentation
org.jetbrains.jet.preloading -> org.jetbrains.kotlin.preloading
This commit is contained in:
@@ -8,7 +8,7 @@ But as a side effect, we got a chance to support instrumenting the compiler's co
|
||||
To run Preloader with instrumentation, pass ```instrument=...``` on the command line:
|
||||
|
||||
```
|
||||
org.jetbrains.jet.preloading.Preloader \
|
||||
org.jetbrains.kotlin.preloading.Preloader \
|
||||
dist/kotlinc/lib/kotlin-compiler.jar \
|
||||
org.jetbrains.jet.cli.jvm.K2JVMCompiler \
|
||||
5000 \
|
||||
@@ -17,12 +17,12 @@ org.jetbrains.jet.preloading.Preloader \
|
||||
```
|
||||
|
||||
This example uses an artifact already configured in our project.
|
||||
In this artifact, what to instrument is configured in the ```org.jetbrains.jet.preloading.ProfilingInstrumenterExample``` class.
|
||||
This is determined by the ```src/META-INF/services/org.jetbrains.jet.preloading.instrumentation.Instrumenter``` file (see JavaDoc for ```java.util.ServiceLoader```).
|
||||
In this artifact, what to instrument is configured in the ```org.jetbrains.kotlin.preloading.ProfilingInstrumenterExample``` class.
|
||||
This is determined by the ```src/META-INF/services/org.jetbrains.kotlin.preloading.instrumentation.Instrumenter``` file (see JavaDoc for ```java.util.ServiceLoader```).
|
||||
|
||||
## More structured description
|
||||
|
||||
**Instrumenter** is any implementation of ```org.jetbrains.jet.preloading.instrumentation.Instrumenter``` interface.
|
||||
**Instrumenter** is any implementation of ```org.jetbrains.kotlin.preloading.instrumentation.Instrumenter``` interface.
|
||||
|
||||
Preloader loads the **first** instrumenter service found on the class path.
|
||||
Services are provided through the [standard JDK mechanism](http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html).
|
||||
@@ -32,7 +32,7 @@ Every preloaded class is run through the instrumenter. Before exiting the progra
|
||||
|
||||
The ```instrumentation``` module provides a convenient way to define useful instrumenters:
|
||||
|
||||
* Derive your class from ```org.jetbrains.jet.preloading.instrumentation.InterceptionInstrumenterAdaptor```
|
||||
* Derive your class from ```org.jetbrains.kotlin.preloading.instrumentation.InterceptionInstrumenterAdaptor```
|
||||
* In this class define public static fields with ```@MethodInterceptor``` annotation
|
||||
|
||||
Whatever the type of the field, if it has methods named by the convention defined below, they will be called as follows:
|
||||
@@ -50,4 +50,4 @@ If any of the methods above, except for ```dump.*```, have parameters, they are
|
||||
* ```@MethodDesc``` - this parameter receives the JVM descriptor of the instrumented method, like ```(ILjava/lang/Object;)V```, must be a ```String```
|
||||
* ```@AllArgs``` - this parameter receives an array of all arguments of the instrumented method, must be of type ```Object[]```
|
||||
|
||||
See ```org.jetbrains.jet.preloading.ProfilingInstrumenterExample```.
|
||||
See ```org.jetbrains.kotlin.preloading.ProfilingInstrumenterExample```.
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
org.jetbrains.jet.preloading.ProfilingInstrumenterExample
|
||||
+1
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.preloading.ProfilingInstrumenterExample
|
||||
+7
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading;
|
||||
package org.jetbrains.kotlin.preloading;
|
||||
|
||||
import org.jetbrains.jet.preloading.instrumentation.InterceptionInstrumenterAdaptor;
|
||||
import org.jetbrains.jet.preloading.instrumentation.annotations.ClassName;
|
||||
import org.jetbrains.jet.preloading.instrumentation.annotations.MethodDesc;
|
||||
import org.jetbrains.jet.preloading.instrumentation.annotations.MethodInterceptor;
|
||||
import org.jetbrains.jet.preloading.instrumentation.annotations.MethodName;
|
||||
import org.jetbrains.kotlin.preloading.instrumentation.InterceptionInstrumenterAdaptor;
|
||||
import org.jetbrains.kotlin.preloading.instrumentation.annotations.ClassName;
|
||||
import org.jetbrains.kotlin.preloading.instrumentation.annotations.MethodDesc;
|
||||
import org.jetbrains.kotlin.preloading.instrumentation.annotations.MethodInterceptor;
|
||||
import org.jetbrains.kotlin.preloading.instrumentation.annotations.MethodName;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.util.*;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation;
|
||||
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation;
|
||||
|
||||
import org.jetbrains.jet.preloading.instrumentation.annotations.*;
|
||||
import org.jetbrains.kotlin.preloading.instrumentation.annotations.*;
|
||||
import org.jetbrains.org.objectweb.asm.*;
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
|
||||
import org.jetbrains.org.objectweb.asm.util.Textifier;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.util.Collections;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation;
|
||||
|
||||
class MemberData {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation;
|
||||
|
||||
public class MethodData extends MemberData {
|
||||
private final FieldData ownerField;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation.annotations;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation.annotations;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation.annotations;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation.annotations;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation.annotations;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation.annotations;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading;
|
||||
package org.jetbrains.kotlin.preloading;
|
||||
|
||||
public interface ClassCondition {
|
||||
boolean accept(String className);
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading;
|
||||
package org.jetbrains.kotlin.preloading;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading;
|
||||
package org.jetbrains.kotlin.preloading;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading;
|
||||
package org.jetbrains.kotlin.preloading;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading;
|
||||
package org.jetbrains.kotlin.preloading;
|
||||
|
||||
import org.jetbrains.jet.preloading.instrumentation.Instrumenter;
|
||||
import org.jetbrains.kotlin.preloading.instrumentation.Instrumenter;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading;
|
||||
package org.jetbrains.kotlin.preloading;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.preloading.instrumentation;
|
||||
package org.jetbrains.kotlin.preloading.instrumentation;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
Reference in New Issue
Block a user