Commit Graph

2063 Commits

Author SHA1 Message Date
Nikolay Krasko 155a760ee9 Revert "Revert [JS IR] commits that failed build"
This reverts commit 740f851a
2019-11-07 16:24:13 +03:00
Leonid Startsev 3b100e57f2 Change NO_EXPLICIT_VISIBILITY_IN_API_MODE diagnostic range to 'declaration modifiers + name'.
Motivation: missing visibility modifier is an error in visibility modifiers list, so we should highlight this list.
Including a name in the range is convenient for using alt+enter (you don't have to move cursor from name to fun/class/val keyword)

 Also change NO_EXPLICIT_RETURN_TYPE_IN_API_MODE diagnostic range to 'declaration name' to match corresponding IDE inspection.

Fix stylistic problems and typos after review
2019-11-06 19:54:00 +03:00
Leonid Startsev ebb7e434c8 Explicit Api mode: Renamings after design discussions
Change CLI flag to -Xexplicit-api=strict|warning. 'Disable' state and 'mode' suffix are left out as implementation details.

Change intention title to 'make X public explicitly'

Do not report 'no explicit visibility' on property accessors

Set DECLARATION_SIGNATURE as a range for report

Rename internal diagnostic from _MIGRATION to _WARNING
2019-11-06 19:53:59 +03:00
Leonid Startsev 7058492b55 Explicit Api mode: prototype with check for missing explicit visibility
Add cli flag with 3-state switch
2019-11-06 19:53:58 +03:00
Dmitriy Novozhilov 7f58162abc Add -Xuse-mixed-named-arguments compiler flag
That flags enables MixedNamedArgumentsInTheirOwnPosition feature
  (see #KT-7745) without experimental warning
2019-11-05 15:22:23 +03:00
Nikolay Krasko 740f851a10 Revert [JS IR] commits that failed build
Revert "[JS IR] Build hybrid versions of stdlib and kotlin.test"
This reverts commit b9f88350dd.

Revert "[JS IR] Add gradle plugin integration tests"
This reverts commit d872b27663.

Revert "Update bootstrap"
This reverts commit bc47594c7a.

Revert "[JS IR] Support generating both IR and pre-IR libraries"
This reverts commit 1b8df45bfe.
2019-11-05 13:58:39 +03:00
Svyatoslav Kuzmich 1b8df45bfe [JS IR] Support generating both IR and pre-IR libraries
Remove all previous -Xir options

Add:
 -Xir-produce-klib-dir
 -Xir-produce-klib-file
 -Xir-produce-js
 -Xir-only
2019-11-01 19:42:05 +03:00
Alexander Udalov df4ab4ed81 Add JVM bytecode target version 13
#KT-34119 Fixed
2019-10-29 12:54:24 +01:00
Pavel Semyonov c6f54b6412 Improve descriptions of compiler options 2019-10-25 19:26:19 +02:00
Kevin Bierhoff 5c9cbf7e77 allow relative friend paths matching relative classpaths 2019-10-24 14:56:46 +02:00
Stanislav Erokhin 352a4dc836 Added extension points to the second compiler.xml
This is a workaround for KT-34528.
Extension points from 26728711
2019-10-23 18:14:35 +03:00
Jim Sproch 383239aff6 Make useIR available from Gradle KotlinJvmOptions 2019-10-21 13:20:54 +03:00
Georgy Bronnikov 7f32f43a48 Pass isIR flag from KotlinToJVMBytecodeCompiler to GenerationState 2019-10-17 16:44:20 +03:00
Stanislav Erokhin 84aff5f630 Add some changes to introduced extension points 2019-10-17 04:41:29 +03:00
Jim 267287118b Frontend plugins to upstream
Change-Id: Id9203c92d0a711e4f21565bd225a465bd41db476
2019-10-17 04:41:27 +03:00
Alexander Udalov d0b241b681 Minor, fix typo in -include-runtime argument help
#KT-34240 Fixed
2019-10-16 15:00:03 +02:00
Ilya Gorbunov 941980c154 Cleanup FE analysis flag allowKotlinPackage
It was used to allow custom contracts when compiling stdlib
with the Kotlin 1.2 compiler. Since 1.3 compiler is used now, this
flag is no longer necessary.
2019-10-15 19:08:57 +03:00
Nikolay Krasko 79cb10a755 Patch initializing EmptySubstitutor service and fix null references
There's a cycle in service initialization and PsiSubstitutor 'clinit'
2019-10-14 16:55:25 +03:00
Ilya Chernikov 2568804eaa Instruct platform code to use NIO2 always
since we're not always use jna (means that we can get warnings about missing jna libs)
and according to the IDEA team, NIO2 works well enough to rely on it
2019-10-11 17:43:49 +02:00
Ilya Chernikov 2219b950f1 Implement resolve top-level functions and props from classloader
#KT-33892 fixed
2019-10-10 17:43:29 +02:00
Vitaliy.Tikhonov f59e393e37 [CLI] add support running scripts in js compiler, extract common code with jvm part 2019-10-10 12:52:06 +03:00
Leonid Startsev 395d595b22 Supply JVM and JS platforms when compile from CLI
To be able to check descriptor's platform in frontend during plugin processing.

This is needed for serialization plugin because some synthesized descriptors (annotation interface implementation) must be JVM-only (or the Native compilation fails).
2019-10-09 14:18:54 +03:00
Alexander Gorshenev c2c88a9ee6 Use MessageCollector.NONE as a dummy logger collector for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev 71eb413350 Attached library resolver to messge collector 2019-10-08 16:56:29 +03:00
Alexander Gorshenev 47fba2ee4b A couple of fixes for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev b7a0546634 The friend module identification has regressed recently 2019-10-08 16:56:29 +03:00
Mikhail Glukhikh 4cd8b78779 FIR: eliminate most usages of FirSession.service() and getService() 2019-10-08 16:19:54 +03:00
Yan Zhulanow 472ec72eb9 Refactor debugger tests
1. Move tests to their own module
2. Avoid sharing the 'tinyApp' project between tests
3. Clean up option directive handling
2019-10-08 19:13:56 +09:00
Mikhail Glukhikh 298a30d245 Minor: run javac-mode compileJava after destroying of generation state
Not very important but seems more logical
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh bbd8fb8b23 JavacWrapper: add support for JvmPackageName annotation
This fixes previously added testWithStdLib/streams.kt test
2019-10-03 11:16:24 +03:00
Alexander Gorshenev c227c13799 Commonizing klib metadata between native and js 2019-10-01 17:38:57 +03:00
Anton Bannykh ead8379c50 JS: add -Xmetadata-only flag for JS common code modules (KT-33142 fixed) 2019-09-27 19:12:03 +03:00
Ilya Chernikov 1e80c03d41 Fix Extensions/Components API usage in core environment for 193+
for it the com.intellij.core.JavaCoreApplicationEnvironment has to be
copied to the compiler (named now KotlinCoreApplicationEnvironment)
and modified accordingly
2019-09-27 11:51:25 +02:00
Ilya Chernikov 517e5e8954 Fix loading scripting plugin from the current classloader
previous code was completely wrong - wrong package and wrong procedure
#KT-34011 fixed
2019-09-26 11:46:55 +02:00
Vyacheslav Gerasimov c1e1dbd83e Build: Fix usages of "java.home" for tools.jar dependency
#KT-33984
2019-09-25 17:54:18 +03:00
Vladimir Dolzhenko 750a677366 Register manually IDEKotlinBinaryClassCache for AbstractLoadJavaClsStubTest.kt 2019-09-25 14:49:17 +02:00
Dmitry Savvinov bfacc1a3c5 Introduce AbstractResolverForProject
Previously, ResolverForProjectImpl had multiple callbacks in
constructor. Some of those callbacks were used only to overcome module
visibility and provide an ability to inject IDE-specific logic into
compiler (ResolverForProject is in the 'compiler'-module)

This commit introduces abstract class which implements
environment-independent logic (previously, this logic had been stored in
ResolverForProjectImpl) with several abstract met hods (previously,
callbacks). Then, we provide few concrete implementations of
AbstractResolverForProject with clear semantics:

- IdeaResolverForProject: resolver used in IDE, where we have indices,
  oracles, multiple modules, etc.
- ResolverForSingleModuleProject: resolver for project with only one
  module, commonly used for CLI compiler/tests
- one anonymous implementation for MultimoduleTests

This refactoring achieves several things:
- now it is easier to see what kinds of ResolverForProject you might see
  in some particular environment (previously, one had to inspect all
  call-sites of constructor)
- we can easily add IDE-specific logic in IdeaResolverForProject without
  adding noisy callbacks (which most probably wouldn't have any other
  non-trivial implementations)
2019-09-24 17:05:05 +03:00
Alexander Udalov 6ef434a711 JVM IR: add -Xir-check-local-names to check names for consistency
Since KotlinTypeMapper is no longer used in the JVM IR backend, we need
not run CodegenBinding.initTrace and check that names of local entities
are exactly equal to local names computed by that algorithm.

However, it's still useful as an opt-in flag, to discover issues where
unwanted elements take part in the naming (such as temporary IR
variables, see for example cb2e68fece). So we introduce a new command
line argument -Xir-check-local-names which, when the IR backend is used
(via -Xuse-ir), launches the name computation algorithm from the old
backend and then compares that the names are exactly equal to the names
computed by the IR backend in InventNamesForLocalClasses.
2019-09-18 17:55:42 +02:00
Vyacheslav Gerasimov 6327f657a5 193: Add bunches for 193 platform 2019-09-17 21:16:13 +03:00
Svyatoslav Kuzmich 9594e9b3b1 [JS IR BE] Initial export generation 2019-08-30 13:15:37 +03:00
Nikolay Krasko 4d0fc1dc22 Remove 182 support
#KT-33536 Fixed
2019-08-30 12:13:44 +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 08720a3dc6 Set thread context classloader in the kotlin runner
#KT-26624 fixed
2019-08-28 17:59:11 +02:00
Dmitry Savvinov 0065236bde Move default implementation of TargetPlatform.platformName to leaf classes
Otherwise, we have a static initialization loop, leading to null-leaks

Removing default interface method indeed disconnects the loop, as per JVM
Specification, "5.5 Initialization".

See KT-33245 for detailed explanations

^KT-33245 Fixed
2019-08-12 13:06:51 +03:00
Alexander Udalov 9456763576 Minor, fix debug info when inferring API version 2019-08-09 15:47:09 +02:00
Mikhail Zarechenskiy 04e57f712e [NI] Introduce feature for passing function references with defaults
Relates to KT-8834, we continue reducing differences between old and new
 inference. Note that as for `SamConversionPerArgument`, this feature
 is enabled in the compiler and not in the IDE to avoid breaking code
 for those users that already enabled new inference in the compiler
2019-08-07 15:58:36 +03:00
Dmitry Savvinov 2b4d70fcf0 [Resolve] Rewrite how built-ins are created
Under COMPOSITE mode we don't have a globally known way to create
built-ins, instead, we have to create them on per-module basis.

So, in this commit we:

1. Use builtInsProvider: (ModuleInfo) -> KotlinBuiltIns instead of
precomputed builtIns instance, in order to be able to calculate
builtIns on per-module basis

2. Introduce new entity, called BuiltInsCache, which, roughly
speaking, is a map of form ModuleInfo -> KotlinBuiltIns, to prevent
creation of multiple builtInsInstances
NB. Actually, it's of form BuiltInsCacheKey -> KotlinBuiltIns, because
we shouldn't create new builtIns for each module. Also, currently,
each platform has its own BuiltInsCacheKey implementation, because
parameters by which built-ins are created, are a bit different across
different platforms. Ideally, we should eliminate those differences
and they use one concrete implementation as a key.
2019-07-30 12:41:40 +03:00
Dmitry Savvinov b48218e722 [Resolve] Make ResolversForModule less static
As consequence, remove IdePlatformKindTooling.resolverForModule, because
it became more than just field, and it duplicates similar API in
IdePlatformKindResolution anyways
2019-07-30 12:41:40 +03:00
Ilya Chernikov 0072f8c265 Improve JSR-223 engine diagnostics
also abstract invoke wrapper creation
2019-07-26 08:55:14 +02:00
Victor Petukhov e25b315319 Introduce -Xpolymorphic-signature compiler flag as more priority than -XXLanguage:+PolymorphicSignature 2019-07-26 09:01:25 +03:00