Commit Graph

57011 Commits

Author SHA1 Message Date
Igor Yakovlev a9bc3c19d6 Fix invalid generated Move tests 2019-08-22 17:53:28 +03:00
Ilmir Usmanov f9506db20a Ignore sources which are not LOADs in refinedIntTypeAnalysis
#KT-33414 Fixed
2019-08-22 16:08:08 +03:00
Dmitriy Novozhilov 4697822b5a [FIR] Fix setting return type for when and try with non applicable candidates 2019-08-22 16:02:56 +03:00
Svyatoslav Kuzmich 6e6ffa12a6 [WASM] Initial infrastructure
- New module ":compiler:backend.wasm"
    - Initial compiler infra (driver, phaser, context)
    - Subset of Wasm AST
    - Skeleton of IR -> Wasm AST
    - Wasm AST -> WAT transformer

- Testing infra

- SpiderMonkey jsshell tool
2019-08-22 15:59:54 +03:00
Svyatoslav Kuzmich 812083ee05 [WASM] Initial runtime library
Add directory libraries/stdlib/wasm as a placeholder for WASM runtime library
Copy built-ins from core/builtins
Add ExcludeFromCodegen annotation for internal needs
2019-08-22 15:59:49 +03:00
Svyatoslav Kuzmich 1891fa1bf1 [JS IR BE] Commonize JS lowerings 2019-08-22 15:59:41 +03:00
Ivan Gavrilovic 7bc739359b Use JDK_8 when stopping Gradle daemons with version below 5.0
Gradle started supporting running on JDK11 only with Gradle 5.0.
This commit sets JAVA_HOME to JDK8 whenever stopping daemon with
version below 5.0
2019-08-22 15:47:45 +03:00
Ivan Gavrilovic d13e26d67e Add a check that processors from KAPT classpath are not run
This commit adds check that javaslang.match.PatternsProcessor,
which is in kotlin-compiler-embeddable jar, is not run when using
JDK9+.
2019-08-22 15:45:40 +03:00
Ivan Gavrilovic 27a9aa5e2b KT-33056: Fix how parent class loader for KAPT processors is found
When instantiating annotation processors, the class loader where they
are defined needs to have the correct parent class loader set up. In
order to find the parent class loader, we need to find the most specific
class loader that contains javac compiler classes (and does not contain
e.g. KAPT classes). This commit changes how that search is done, and it
simply returns the class loader in which the com.sun.tools.javac.util.Context
is defined, as the is the class we need on the annotation processor
classpath.
2019-08-22 15:45:40 +03:00
Ivan Gavrilovic f3acd8d10c KT-33028, KT-33050: Fix how kapt invokes javac on JDK 9+
This commit fixes KT-33028 by not setting empty boot classpath when
running on JDK9+. When compiling with -source 8 and below, this allows
classes from java.base module to be available in the boot classpath.

This commit also fixes KT-33050 by passing the source level of Java compile
task in the KAPT javac options. This is important as some annotation processors
are using ProcessingEnvironment.getSourceVersion() in order to decide what
code to generate.

Test: Kapt3IT test added for worker and non-worker invocations
2019-08-22 15:45:40 +03:00
Dmitriy Novozhilov 5846db4eab [FIR] Add symbol to FirFunction and all it's inheritors 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov e3e1f3c2aa [FIR] Fix transforming value parameters of anonymous functions 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov d841090866 [FIR] Don't analyze properties with implicit types twice
Test `cast.kt` now don't work absolutely correct and implicit type of
  value parameter in lambda is't replaced with error type, but it's
  minor bug
2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov f1e56c4b3e [FIR] Force resolving all declaration while resolving of body with implicit type 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov e374242adf [FIR] Fix propagating expected type for binary operator calls 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov ba7a137e74 [FIR] Add fir node for binary && and || 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 908b6ade1d [FIR] Fix incorrect do-while loop transforming order and IR generating 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 42f171a8d2 [IR] Minor. Extract irBuiltins from IrGeneratorContext to separate interface
It's necessary to using some util functions on IrGeneratorContext in IrToFir
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov b274c7567e [FIR] Minor. Add transformResult to FirWhenBranch 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov a022f85776 [FIR] Minor. Add @BaseTransformedType to FirWhenBranch 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov f877fe40b3 [FIR] Fix expected type in invoke completion 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 57a2665b00 [FIR] Update tests for previous commit 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov e48959350c [FIR] Infer type of when expressions and try expressions like it is function call 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 741ff958e8 [FIR] Add util function for extracting return arguments from block 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov fe3824d796 [FIR] Introduce FirResolvable
FirResolvable is an interface representates fir node wit calleeReference
It will be useful for infer `try` and `when` expressions as function call
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov beeba23cf0 [FIR] Minor. Wrap withScopeCleanup with try-finally 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov e944119f71 [FIR] Don't use implicit type as expected type of anonymous function 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 7861396246 [FIR] Add util function for creating functional cone type 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 637fb55a7b [FIR] Add implementation of intersection types to Fir type system 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 1708a34eb8 [FIR] Fix incorrect findCommonIntegerLiteralTypesSuperType dummy implementation 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov e6bf3b3263 [FIR] Render nullability in type renderer, not in fir renderer 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 3e44bc805f [FIR] Return error type from common super type if it present 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 6e2958880b [FIR] Add forgotten replacing arguments in abbreviated type expansion 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 317e3edba8 [FIR] Add default upper bound to type parameter in fir deserializer 2019-08-22 10:55:07 +03:00
Ilya Chernikov 2fe01f9086 Refactor publishing plugin to lazy tasks API 2019-08-21 20:20:09 +02:00
Ilya Chernikov 315a9d66a0 Refactor more tasks to lazy API 2019-08-21 20:20:08 +02:00
Ilya Chernikov 2ed8fa7624 Convert main task creating helper to lazy API, refactor accordingly 2019-08-21 20:20:08 +02:00
Ilya Chernikov 0f41dc814f Switch many common tasks defined in buildSrc to lazy creation
also refactor some locally defined tasks to the creation avoidance API
2019-08-21 20:20:08 +02:00
Ilya Chernikov f74c4fa538 Switch all common tasks in the root build script to lazy creation 2019-08-21 20:17:53 +02:00
Ilya Chernikov 5208318f34 Fix dependency resolution during gradle project configuration 2019-08-21 20:17:53 +02:00
Sergey Igushkin 50e758cbb7 Remove the @Inclubating annotation from UnstableApiUsage inspection
Also remove `@Suppress("UnstableApiUsage)"` where it was relevant
2019-08-21 19:42:34 +03:00
Sergey Igushkin ffd0b438da Don't create the Kapt generate stubs output dir in lazy initializer
Creating a directory in the property getter interferes with Gradle cache
 outputs snapshotting, resulting in build cache being disabled for the
 task with the following info message:

 Caching disabled for task ':app:kaptGenerateStubsKotlin': Gradle does
 not know how file 'build/tmp/kapt3/incrementalData/main' was created
 (output property 'destinationDir'). Task output caching requires exclusive
 access to output paths to guarantee correctness.

 As Gradle automatically creates any @OutputDirectory, we don't need
 to create it at the task initialization phase.
2019-08-21 19:42:34 +03:00
Sergey Igushkin cbb8bf2deb Extract members from Kotlin tasks, don't iterate over them (KT-31713)
Refactor: move some properties from the Kotlin tasks to the
new task data model, so they can be accessed without forcing the
tasks to instantiate.

Don't iterate over Kotlin tasks of all projects in the IC-related code;
instead, inspect the model.

Issue #KT-31713 Fixed
2019-08-21 19:42:34 +03:00
Mikhail Zarechenskiy 80fa591f10 Fix failing test because of slightly different diagnostics for LV=1.2
There are no `DEBUG_INFO_MISSING_UNRESOLVED` diagnostics for this test
 if one runs it under LV=1.2. These diagnostics are not crucial
 for the test (especially for version 1.2), so use it only with
 the latest stable version

 Plus, reuse test-data to check behavior in new inference
2019-08-21 18:41:13 +03:00
Alexander Udalov 5e3a11db8e JVM IR: remove property accessor name hack in InterfaceDelegationLowering
#KT-28434 Fixed
2019-08-21 15:14:04 +02:00
Alexander Udalov 14a6a06166 JVM IR: do not use GenerationState.typeMapper
The only remaining usages are in IrTypeMapper, MethodSignatureMapper and
in InterfaceDelegationLowering.generateDelegationToDefaultImpl
2019-08-21 15:14:03 +02:00
Alexander Udalov f64afbf152 JVM IR: reduce usages of IrTypeMapper.kotlinTypeMapper 2019-08-21 15:13:49 +02:00
Alexander Udalov 0c6ab69b52 JVM IR: do not use descriptors in IrTypeMapper.writeFormalTypeParameters 2019-08-21 15:13:49 +02:00
Alexander Udalov 598c6009f2 JVM IR: extract method signature mapping to MethodSignatureMapper 2019-08-21 15:13:47 +02:00
Alexander Udalov 6191fc10f0 JVM IR: introduce IrCallableMethod as a simpler replacement for CallableMethod 2019-08-21 15:10:57 +02:00