Rename package jet -> kotlin in preloader and instrumentation

org.jetbrains.jet.preloading -> org.jetbrains.kotlin.preloading
This commit is contained in:
Alexander Udalov
2015-01-03 15:31:18 +03:00
parent e73ffe76a0
commit 1bf3ca2e26
31 changed files with 62 additions and 62 deletions
@@ -25,7 +25,7 @@ import org.apache.tools.ant.types.Commandline
import java.io.PrintStream
import org.apache.tools.ant.AntClassLoader
import java.lang.ref.SoftReference
import org.jetbrains.jet.preloading.ClassPreloadingUtils
import org.jetbrains.kotlin.preloading.ClassPreloadingUtils
import java.net.JarURLConnection
object CompilerClassLoaderHolder {
+1 -1
View File
@@ -383,7 +383,7 @@
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.preloader}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
<attribute name="Main-Class" value="org.jetbrains.jet.preloading.Preloader"/>
<attribute name="Main-Class" value="org.jetbrains.kotlin.preloading.Preloader"/>
</manifest>
</jar>
</target>
+1 -1
View File
@@ -82,6 +82,6 @@ CPSELECT="-cp "
$JAVA_OPTS \
"${java_args[@]}" \
${CPSELECT}"${KOTLIN_HOME}/lib/kotlin-preloader.jar" \
org.jetbrains.jet.preloading.Preloader \
org.jetbrains.kotlin.preloading.Preloader \
"${KOTLIN_HOME}/lib/kotlin-compiler.jar" \
org.jetbrains.jet.cli.js.K2JSCompiler 4096 notime "$@"
+1 -1
View File
@@ -26,7 +26,7 @@ rem We use the value of the JAVA_OPTS environment variable if defined
set _JAVA_OPTS=-Xmx256M -Xms32M -noverify
"%_JAVACMD%" %_JAVA_OPTS% -cp "%_KOTLIN_HOME%\lib\kotlin-preloader.jar" ^
org.jetbrains.jet.preloading.Preloader "%_KOTLIN_HOME%\lib\kotlin-compiler.jar" ^
org.jetbrains.kotlin.preloading.Preloader "%_KOTLIN_HOME%\lib\kotlin-compiler.jar" ^
org.jetbrains.jet.cli.js.K2JSCompiler 4096 notime %*
exit /b %ERRORLEVEL%
+1 -1
View File
@@ -82,6 +82,6 @@ CPSELECT="-cp "
$JAVA_OPTS \
"${java_args[@]}" \
${CPSELECT}"${KOTLIN_HOME}/lib/kotlin-preloader.jar" \
org.jetbrains.jet.preloading.Preloader \
org.jetbrains.kotlin.preloading.Preloader \
"${KOTLIN_HOME}/lib/kotlin-compiler.jar" \
org.jetbrains.jet.cli.jvm.K2JVMCompiler 4096 notime "$@"
+1 -1
View File
@@ -26,7 +26,7 @@ rem We use the value of the JAVA_OPTS environment variable if defined
set _JAVA_OPTS=-Xmx256M -Xms32M -noverify
"%_JAVACMD%" %_JAVA_OPTS% -cp "%_KOTLIN_HOME%\lib\kotlin-preloader.jar" ^
org.jetbrains.jet.preloading.Preloader "%_KOTLIN_HOME%\lib\kotlin-compiler.jar" ^
org.jetbrains.kotlin.preloading.Preloader "%_KOTLIN_HOME%\lib\kotlin-compiler.jar" ^
org.jetbrains.jet.cli.jvm.K2JVMCompiler 4096 notime %*
exit /b %ERRORLEVEL%
+6 -6
View File
@@ -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 +0,0 @@
org.jetbrains.jet.preloading.ProfilingInstrumenterExample
@@ -0,0 +1 @@
org.jetbrains.kotlin.preloading.ProfilingInstrumenterExample
@@ -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.*;
@@ -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;
@@ -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;
@@ -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;
@@ -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 {
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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);
@@ -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;
@@ -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.*;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -19,9 +19,9 @@ package org.jetbrains.jet.compiler.runner;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.cli.common.messages.MessageCollector;
import org.jetbrains.jet.config.Services;
import org.jetbrains.jet.preloading.ClassCondition;
import org.jetbrains.jet.utils.KotlinPaths;
import org.jetbrains.jet.utils.PathUtil;
import org.jetbrains.kotlin.preloading.ClassCondition;
import static org.jetbrains.jet.cli.common.messages.CompilerMessageLocation.NO_LOCATION;
import static org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity.ERROR;
@@ -19,8 +19,8 @@ package org.jetbrains.jet.compiler.runner;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.cli.common.messages.MessageCollector;
import org.jetbrains.jet.preloading.ClassPreloadingUtils;
import org.jetbrains.jet.utils.KotlinPaths;
import org.jetbrains.kotlin.preloading.ClassPreloadingUtils;
import java.io.File;
import java.io.IOException;