Commit Graph

114 Commits

Author SHA1 Message Date
Aleksei.Cherepanov 8c3b1dc55a Improve performance of classloaders + small refactoring
During the initialization of the classloader, we preload some jar files, that are necessary for the compiler to work correctly. In this process of preloading classes, we unpack each jar file and look at the value of the Class-Path in its META_INF. So we will determine, which files are depends on by original jars. We will load the resulting jars in the next iteration of class preloading. Thus, we get nested classloaders. However, in practice, it turned out that the jar files needed for the second iteration were already loaded in the first iteration, so there is no point in loading them again. Moreover, if we do not find the class in the first loader, then we will not find it in the second either. However, the case, when there are some jars from Class-Path of original jars and they were not loaded by first iteration, does not change.
Aldo needed for KT-49786
2021-12-10 15:13:02 +03:00
Ilya Chernikov 31c56d7794 Set java.class.path property in runner and loader
#KT-24991 fixed
2019-08-28 17:59:12 +02:00
Ilya Chernikov d3f32c0d8a Set thread context classloader in preloader
#KT-33529 fixed
2019-08-28 17:59:11 +02:00
Vyacheslav Gerasimov db3b01d2d4 Build: Centralize compiler dist build logic in :kotlin-compiler project 2019-06-27 17:56:48 +03:00
Yaroslav Russkih 9ac52fad17 Use https everywhere - documentation and samples 2019-02-19 21:35:36 +01:00
Mikhael Bogdanov a122cba862 Switch Kotlin project to jvm-target 1.8
#KT-29405
2019-01-31 07:43:05 +01:00
Sergey Rostov f35185b261 Build: remove explicit dependencies to org.jetbrains.annotations 2019-01-28 13:43:08 +03:00
Sergey Rostov 883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Mikhael Bogdanov c19c979b7d Use last asm api for visitor construction 2018-12-20 12:55:09 +01:00
Nikolay Krasko 17421ed14d 191: asm-all has 7.0-beta version in Intellij 191
Pass project to fetch extra parameters for asm-all work
2018-10-19 19:16:21 +03:00
Alexander Udalov f868964e25 Fix most unchecked/deprecation javac warnings in compiler modules 2018-10-17 18:39:49 +02:00
Dmitry Savvinov 43467516ef Support argfiles in kotlin compiler
Using '-Xargfile=path/to/argfile' will substitute
that argument with the content of argfile.

See KT-24472
2018-05-28 11:23:32 +03:00
Alexey Tsvetkov 8a82c1618c Use Plugins DSL in Kotlin Gradle scripts
When plugins DSL is used, there is no need to
manually generate typesafe accessors for extensions and
conventions (by running `./gradlew kotlinDslAccessorsSnapshot`).
2018-03-26 16:09:29 +03:00
Yan Zhulanow 34d1611ed4 Add Pill support to compiler and IDE modules 2018-03-02 03:15:17 +03:00
Ilya Chernikov 4eb557724c Convert compiler projects to the new intellij deps 2018-01-30 17:06:13 +03:00
Ilya Chernikov a4f28cd94f Make all dependencies to idea sdk intransitive 2018-01-30 17:06:11 +03:00
Ilya Chernikov 74411d9b9c Convert all compiler modules to intellij plugin 2018-01-30 17:06:06 +03:00
Alexander Podkhalyuzin 3f8170d369 Clean idea files generated on the gradle import, add them to .gitignore 2017-09-19 23:58:27 +02:00
Ilya Chernikov 3e46c59187 Clean unused dependencies, minor refactorings 2017-09-19 21:37:27 +02:00
Ilya Chernikov 27968c8e13 Set proper jvmTarget for projects 2017-09-19 21:37:27 +02:00
Ilya Chernikov deda50dbbb Continue switching projects to improved dsl: sourceSets and test running 2017-09-19 21:37:26 +02:00
Ilya Chernikov 513ab08edd Refactor and clean preloader project 2017-09-19 21:37:16 +02:00
Ilya Chernikov 61dfb75e0e Implement Gradle Kotlin DSL build 2017-09-19 21:37:06 +02:00
Alexander Udalov 2b878f863c CLI: report error if kotlinc is invoked on Java 6 or 7
#KT-17297 Fixed
2017-06-06 14:17:28 +03:00
Alexander Udalov ea9194e1fb CLI: compile preloader against JDK 1.6
To be able to detect the Java runtime version at startup to report an
error if it's < 1.8
2017-06-06 14:17:27 +03:00
baratynskiy 71ba8e3ad0 Add tools.jar for command line compiler if -Xuse-javac is specified 2017-05-17 17:48:53 +03:00
Alexander Udalov 78e278ec4c Remove redundant type arguments for Java 8+ in compiler modules 2017-04-03 14:51:18 +03:00
Alexander Udalov d440f07111 Use Java 7+ diamond operator in compiler modules 2017-04-03 14:51:15 +03:00
Alexander Udalov 5ebee6ceca Use Java 8 lambdas instead of anonymous classes in compiler modules 2017-04-03 14:49:23 +03:00
Alexander Udalov 6aa0f7bb65 Use multi-catch when possible 2017-04-03 14:26:53 +03:00
Alexander Udalov 34f0576135 Invoke "remove unnecessary final" intention in compiler modules 2017-04-03 14:26:52 +03:00
Alexander Udalov 59a15092da Drop old preloader command-line interface, use new one instead 2015-08-27 08:19:51 +03:00
Alexander Udalov 63831387cf Only catch exceptions originating from incorrect use in preloader 2015-08-24 01:29:59 +03:00
Alexander Udalov aba6ab1299 Refactor command-line interface to kotlin-preloader.jar
Use reasonable defaults for the options: no time profiling, no instrumenters,
empty classpath, 4096 as the class number estimate. Replace 4096 in the
codebase with the constant field.

Keep the old interface intact until the build is bootstrapped and the new one
can be used in all compilation steps
2015-08-24 01:29:58 +03:00
Alexander Udalov a592b42357 Refactor Preloader: simplify mode parsing, unify output 2015-08-24 01:29:58 +03:00
Alexander Udalov c18ef6e2ac Increase buffer size in preloader from 8K to 512K
Doesn't seem to improve performance, but cuts down lots of IO file read counts
2015-06-03 15:14:24 +03:00
Alexander Udalov 485dce987c Fix byte array memory leak from MemoryBasedClassLoader
40 Mb of bytes of preloaded compiler classes during the compilation become 16
Mb after this change

This is a slightly reworked version of 58b033d (reverted in 3f05419). The
problem in that commit was that URLClassLoader did not work in the fashion
MemoryBasedClassLoader was designed to work (child first, parent last). So some
resource was found in an incorrect jar which was causing the compiler to break
2015-03-30 17:12:10 +03:00
Alexander Udalov 45da9555de Fix minor bug in MemoryBasedClassLoader#getResources()
Own resources and those from the parent class loader were not combined
2015-03-30 17:12:10 +03:00
Alexander Udalov 3f0541924f Revert "Fix byte array memory leak from MemoryBasedClassLoader"
This reverts commit 58b033d9fb.
2015-03-27 15:28:52 +03:00
Alexander Udalov 58b033d9fb Fix byte array memory leak from MemoryBasedClassLoader
40 Mb of bytes of preloaded compiler classes during the compilation become 16
Mb after this change
2015-03-26 21:42:05 +03:00
Yan Zhulanow f564734be2 Override loadClass with two arguments in MemoryBasedClassLoader 2015-03-13 15:46:43 +03:00
Alexander Udalov 8ca803775f Rename package jet -> kotlin in cli, cli-common
org.jetbrains.jet.cli -> org.jetbrains.kotlin.cli

Also fix some minor warnings
2015-01-08 23:32:07 +03:00
Alexander Udalov 1bf3ca2e26 Rename package jet -> kotlin in preloader and instrumentation
org.jetbrains.jet.preloading -> org.jetbrains.kotlin.preloading
2015-01-05 04:19:04 +03:00
Alexander Udalov 64c00efc92 Fix Instrumentation artifact dependencies and readme 2015-01-03 15:16:19 +03:00
Alexander Udalov 480f990c1d Preloader: HashMap constructor takes capacity, not expected size 2014-12-29 18:19:24 +03:00
Alexander Udalov 8306ccd8ec Preloader: extract nested classes to top-level 2014-12-29 18:19:24 +03:00
Alexander Udalov 9273b0dfec Preloader: support loading classpath dependencies from manifest
Move this logic from ide-compiler-runner. This fixes running 'kotlinc' CLI
compiler locally when the runtime is changed binary incompatibly
2014-12-29 18:19:23 +03:00
Alexander Udalov 91f110acd4 Preloader: support many resources by given name 2014-12-29 18:19:22 +03:00
Alexander Udalov 4358b3fbc3 Do not use private Sun API in preloader 2014-12-19 14:37:46 +03:00
Evgeny Gerashchenko fe27b2264a Passing condition to prefer parent class loader as a parameter to preloader. 2014-08-20 13:46:30 +04:00