Commit Graph

60181 Commits

Author SHA1 Message Date
Nikolay Krasko c5d4213a5c Mute CoroutineDumpTestGenerated, stable failure on windows 2019-12-25 14:05:05 +03:00
Nikolay Krasko 9d54d1ec40 Mute GradleFacetImportTest tests in 192 and 193 2019-12-25 14:05:05 +03:00
Nikolay Krasko 482cb07420 Mute GradleConfiguratorTest tests 2019-12-25 14:05:04 +03:00
Nikolay Krasko 8014a6509e Allow to mute JUnit 4 tests with parameters 2019-12-25 14:05:04 +03:00
Svyatoslav Kuzmich d74721716a [JS IR] Use short klib names instead of absolute paths 2019-12-25 13:44:57 +03:00
Svyatoslav Kuzmich 31c84e9ac4 [JS IR] Build stdlib using compiler from repo
Previously JS IR versions of stdlib and kotlin-test were build
by default using compiler previously built on a buildserver.

It had some issues:
 - This required us to advance bootstrap every time we made any
   incompatible IR changes. This happens often since IR ABI is
   not quite stable yet.

 - We never tested the exact combination of compiler and stdlib we publish

   We tested:
    - new compiler with new stdlib build by new compiler (in box tests)
    - old compiler with new stdlib build by old compiler (in stdlib tests)

   We published:
    - new compiler with new stdlib build by old compiler

After this change JS IR compiler tests, builds and publishes
single configuration:

    new compiler with new stdlib build by new compiler

JS IR stdlib and kotlin-test are now built using JavaExec of CLI instead
of Gradle plugin to avoid troubles of loading a freshly built plugin.

This also allows to have a granular dependencies: we don't rebuild klib
if we changed a lowering in a compiler backend, but we do rebuild it if
we changed IR serialization algorithm.
2019-12-25 13:44:57 +03:00
Pavel Punegov 70111f8db1 Ignore test in Native backend 2019-12-25 13:40:38 +03:00
victor.petukhov be8ae24713 Temporary mute some spec tests through apply changes after 45e881f03f 2019-12-25 12:44:54 +03:00
Sergey Igushkin 1129b2d3eb Support serializing a module's own descriptors without dependencies
The KlibMetadataSerializer used to serialize all package fragments that a module
could provide, including those coming from the module's dependencies. In order
to produce a klib from a module that is analyzed by the K2MetadataCompiler, the
serializer needs to take just the own package fragments of the module, excluding
those of the dependencies.
2019-12-25 12:09:08 +03:00
Sergey Igushkin ed6034e449 Support generating a klib from common code with K2MetadataCompiler 2019-12-25 12:09:08 +03:00
Sergey Igushkin 28e0089259 Allow not providing IR to serialize a klib with just the frontend metadata 2019-12-25 12:09:07 +03:00
Georgy Bronnikov cea0f08049 Regenerate compiler tests 2019-12-25 12:04:04 +03:00
Dmitriy Dolovov 45d894ee6e K/N: remove unused code 2019-12-25 11:42:29 +07:00
Dmitriy Dolovov 84e8b895be Minor: Fix compilation warnings 2019-12-25 11:42:21 +07:00
Dmitriy Dolovov 59e84e826b Fast check of Kotlin/Native KLIBs by virtual files 2019-12-25 11:42:14 +07:00
Dmitriy Dolovov 98e9642a1e Stop publishing old KLIB reader 2019-12-25 11:42:04 +07:00
Igor Yakovlev 4afbbda858 Minor fixes of move refactoring
Fix NPE for case when target path for package is not exists
Clarify case when target path for file move does not exists
Fix NPE when file selector shows with empty edit box of file name in Move dialog
2019-12-24 21:25:38 +03:00
Igor Yakovlev a2db1f8314 Fix move tests for bunch 192 2019-12-24 19:49:07 +03:00
Roman Artemev f2f7d144aa [JS] Fix failing test 2019-12-24 19:26:06 +03:00
Roman Artemev 6ba8fbd451 [IR BE] Refactored FoldConstantLowering
- Fix `toString` evaluation for unsigned types in FoldConstantLowering
 - make corner cases around float/double evaluation work for K/JS
 - remove usage of kotlin type
2019-12-24 19:26:06 +03:00
Roman Artemev e4f83b96a3 [JS BE] Reduce temporary variable number produced during lowering
- Do not create temporary variable for pure expressions
 - Clean up unused and unreachable r-value on top level of statement block
2019-12-24 19:26:06 +03:00
Roman Artemev fb3bd8a9ac [JS BE] Implement accessor inlining optimization (WIP)
- enable constant folding
2019-12-24 19:26:05 +03:00
Roman Artemev 9871f8c579 [JS BE] Fix DCE to let it remove constant properties 2019-12-24 19:26:05 +03:00
Roman Artemev 2c94f590ca [JS BE] Improve error message in JS BE 2019-12-24 19:26:05 +03:00
Roman Artemev 738db7e511 [IR BE] Make FoldConstantLowering common 2019-12-24 19:26:05 +03:00
Roman Artemev 540b3cfec3 [JS IR] Fix test to make them able to run with JS 2019-12-24 19:26:05 +03:00
Roman Artemev b5af28b28d [JS IR] Fix state machine builder to fit into switch optimizer requirements 2019-12-24 19:26:05 +03:00
Roman Artemev 50889e77a8 [JS IR] Support switch optimization for when-expression 2019-12-24 19:26:05 +03:00
Roman Artemev 23caf15457 [JS IR] Implement Switch optimizer for JS IR codegen 2019-12-24 19:26:05 +03:00
Igor Yakovlev 8dd467bde0 Fix build for bunch 191 2019-12-24 19:16:52 +03:00
pyos 982a088f00 JVM_IR: do not copy defaults in functions with inline class parameters 2019-12-24 18:59:33 +03:00
Igor Chevdar 9e17140daf [JS_IR] Turned on passing JS_IR tests 2019-12-24 15:54:45 +03:00
Igor Chevdar 7a5e8b4316 [IR] Inliner: supported tricky function references
This includes references to functions with varargs and default arguments
2019-12-24 15:54:45 +03:00
Dmitry Petrov cdf9ef63ba Remove nullability assertions from special bridge call arguments 2019-12-24 12:50:06 +03:00
Toshiaki Kameyama fabeca5955 Redundant curly braces in string template: do not report labeled 'this'
#KT-35475 Fixed
2019-12-24 14:46:46 +07:00
Mikhail Glukhikh 80d29cdad1 FIR resolve: soften processBlock limitation during inference completion
This allows us to enter some lambdas unentered before
2019-12-24 10:42:55 +03:00
Mikhail Glukhikh fd73f5af20 FIR: simplify problematic test 2019-12-24 10:42:49 +03:00
Toshiaki Kameyama 03ec76b570 Redundant visibility modifier: do not report for 'internal' inside 'private'
#KT-35639 Fixed
2019-12-24 14:41:10 +07:00
Toshiaki Kameyama 49e5f170d1 "Replace 'when' with 'if'" intention: do not suggest if 'when' subject is variable declaration
#KT-35528 Fixed
2019-12-24 14:37:53 +07:00
Toshiaki Kameyama 1cdcef3b08 "Split property declaration" intention: do not suggest in 'when' subject
#KT-35528 Fixed
2019-12-24 14:37:53 +07:00
Ivan Gavrilovic eab6864269 KT-35536: Fix enum constants in KAPT
Enum constants are Pair, so make sure to unpack them correctly.
2019-12-24 15:14:47 +09:00
Ivan Gavrilovic 62924ddcd4 KT-35472: Detect when content of annotation processor changes
Even if annotation processor classpath is the same, in case
individual entries change (e.g. bulding annotationo processor
from source), KATP should run non-incrementally.

Test: KaptIncrementalWithIsolatingApt.testUnchangedAnnotationProcessorClasspathButContentChanged
2019-12-24 15:14:47 +09:00
Stéphane Nicolas 7b227f3113 Remove Redundant Project
Just some syntax cleanup when visting the file.
Note: I was trying to understand why the output folders of kapt are creating so eagerly in a build, during configuration time indeed...(they should be created later, during execution).
2019-12-24 15:14:47 +09:00
Georgy Bronnikov d4b0151f51 JVM_IR: fix name of received field for suspend lambdas
$ at the start caused AnonymousObjectTransformer to skip the field.
2019-12-23 18:03:46 +01:00
Ilmir Usmanov 068d3f4beb JVM_IR: Use IrInlineReferenceLocator to find inline suspend lambdas and lambdas, which capture crossinline 2019-12-23 18:03:45 +01:00
Ilmir Usmanov 1ea89ce28e JVM_IR: Minor. Unmute tests 2019-12-23 18:03:44 +01:00
Ilmir Usmanov 5c92da3f35 JVM_IR: Do not generate parameter annotations for continuation constructors
The idea is the same as in case of anonymous objects: they are created only
from Kotlin code, so we are sure, that the parameters are valid.
Also, the inliner complains on their transformations.
2019-12-23 18:03:43 +01:00
Ilmir Usmanov 9292022f88 JVM_IR: Support inner lambdas which capture crossinline 2019-12-23 18:03:42 +01:00
Ilmir Usmanov daa76cbf1e JVM_IR: Support inner objects with multiple suspend functions
Do not clean `functionsToAdd`
2019-12-23 18:03:41 +01:00
Ilmir Usmanov a1448ebb37 JVM_IR: Support crossinline suspend lambdas
The main idea is the following: since we need to generate
(fake)continuations before inlining, we move IrClasses of suspend
lambdas and continuation classes of named functions into the functions.
Thus, it allows the codegen to generate them prior to inlining and
the inliner will happily transform them for us.
Because of that, lowerings which transform call-site function are likely
to change reference to lowered suspend lambdas or functions.
Hence, do not rely on references to lowered suspend lambdas or
functions, instead, rely on attributes.

Do not generate continuation for inline suspend lambdas.
Previously, inline suspend lambdas were treated like suspend functions,
thus we generated continuations for them. Now we just do not treat them
as suspend functions or lambdas during AddContinuationLowering.
We should add continuation parameter to them, however.

Do not generate secondary constructor for suspend lambdas, otherwise,
the inliner is unable to transform them (it requires only one
constructor to be present).

Generate continuation classes for suspend functions as first statement
inside the function.
This enables suspend functions in local object inside inline functions.
Since we already have attributes inside suspend named functions, we
just reuse them to generate continuation class names. This allows us
to close the gap between code generated by old back-end and the new
one.

If a suspend named function captures crossinline lambda, we should
generate a template for inliner: a copy of the function without
state-machine and a continuation constructor call. The call is needed
so the inliner transforms the continuation as well.

Refactor CoroutineTransformerMethodVisitor, so it no longer depends on
PSI.
2019-12-23 18:03:40 +01:00