Commit Graph

41969 Commits

Author SHA1 Message Date
Denis Zharkov 457b57ace2 Inline TypeCheckerContext::anySupertype
This method is a hot spot, since it's may be called
several times during one isSubtypeOf call and it contains
two lambdas, so it's worth inlining it
2017-10-10 18:27:00 +03:00
Denis Zharkov 2fa82edd85 Use smaller default deque size for BFS over supertypes
The default value (16) seems to be rather big
2017-10-10 18:27:00 +03:00
Denis Zharkov df88926ef8 Minor. Get rid of redundant var
The lazyness here is redundant since SmartList doesn't make a lot of
harm, but at the same time `var` here leads to another
kotlin/jvm/internal/Ref$ObjectRef instance
2017-10-10 18:27:00 +03:00
Denis Zharkov bca53e6c1c Optimize type checking for common cases
- Type equality for simple constructors (no arguments)
- Subtyping on final classes
2017-10-10 18:27:00 +03:00
Denis Zharkov e519095e9e Minor. Move local functions as a private to class 2017-10-10 18:27:00 +03:00
Denis Zharkov 79a7c01eac Fix obviously wrong !is check in type checker 2017-10-10 18:27:00 +03:00
Simon Ogorodnik 3ca47f5f4a Revert "Add note about automatic dev plugin updates to ReadMe"
This reverts commit c92408e
2017-10-10 18:25:27 +03:00
Simon Ogorodnik b7e78e6625 Revert "Add note about bootstrap plugin"
This reverts commit 722345d
2017-10-10 18:25:21 +03:00
Simon Ogorodnik 722345d14e Add note about bootstrap plugin 2017-10-10 18:07:51 +03:00
Simon Ogorodnik c92408eec9 Add note about automatic dev plugin updates to ReadMe 2017-10-10 18:07:51 +03:00
Mikhael Bogdanov a79c2bf999 Write script descriptor type to ASM_TYPE slice
#KT-20707 Fixed
2017-10-10 17:01:23 +02:00
Nikolay Krasko eb32f5478a Minor: use special extension 2017-10-10 16:29:22 +03:00
Nikolay Krasko 6664b7759b Configure kotlin.stdlib for gradle projects (KT-19207)
#KT-19207 Fixed
2017-10-10 16:29:22 +03:00
Nikolay Krasko 023067aaf2 Allow to use folders for gradle configuration tests 2017-10-10 16:29:22 +03:00
Nikolay Krasko cc0a9070b9 Add kotlin.stdlib to module-info when configure Maven project (KT-19207)
#KT-19207 In Progress
2017-10-10 16:29:22 +03:00
Nikolay Krasko c0e6cb8b92 Log module name when maven project wasn't found in manager 2017-10-10 16:29:21 +03:00
Nikolay Krasko f05e4c922b Minor: use another method 2017-10-10 16:29:21 +03:00
Nikolay Krasko 65798cdd81 Minor: optimize imports and clean up 2017-10-10 16:29:21 +03:00
Nikolay Krasko 9d122a275a Update module-info only for Java configurator (KT-19207)
#KT-19207 Fixed
2017-10-10 16:29:21 +03:00
Ilya Gorbunov fe9ef04cae Make a task to count dex methods in kotlin-stdlib and kotlin-reflect 2017-10-10 14:48:20 +03:00
Alexander Udalov 00c846a160 Write patch version for VersionRequirement correctly 2017-10-10 13:21:50 +02:00
Alexander Udalov 6f2e6db131 Check the RequireKotlin annotation value
Similarly to SinceKotlin
2017-10-10 13:21:50 +02:00
Alexander Udalov a96861c353 Support version kind for RequireKotlin
#KT-20584 Fixed
2017-10-10 13:21:49 +02:00
Alexander Udalov 4532f7556c Introduce internal RequireKotlin annotation 2017-10-10 13:19:18 +02:00
Alexander Udalov 8962911503 Rename SinceKotlinInfo -> VersionRequirement 2017-10-10 13:19:18 +02:00
Alexey Andreev 8f9fc100a3 Fix compilation of JS stdlib
1. Don't import intrinsics when compiling stdlib, use declarations
   from current module instead
2. Add constructor with one argument to SourceFilePathResolver,
   to fix bootstrapping issues.
3. Pass correct source roots to compiler when building
   stdlib, since now we pass module root by default,
   while stdlib source roots are outside of module root.
2017-10-10 14:11:15 +03:00
Alexey Sedunov ea8f3dcc65 Go to Implementation: Support suspend functions 2017-10-10 13:15:16 +03:00
Alexey Sedunov 21bf4d3f24 Rename: Suspend function support 2017-10-10 13:15:15 +03:00
Toshiaki Kameyama c5b7d0f0df Remove parentheses after deleting the last unused constructor parameter
So #KT-16636 Fixed
2017-10-10 11:55:27 +03:00
Mikhail Glukhikh 7ade2bb708 Move CreateActualFix to expectactual package 2017-10-10 10:45:12 +03:00
Mikhail Glukhikh 104826e0a9 Line markers: use descriptors in isExpect/ActualDeclaration 2017-10-10 10:45:10 +03:00
Mikhail Glukhikh 1bf0424b1c Set line marker on expect constructor '(' if no constructor keyword 2017-10-10 10:44:51 +03:00
Mikhail Glukhikh 4bfaa46c15 Add correct mapping of module descriptor to implementedDescriptor
Now implements dependency is taken into account here
Old commonModuleOrNull() was deleted
Test (JVM + 2xCommon) was added
2017-10-10 10:44:44 +03:00
Mikhail Glukhikh b5e2fa5f94 Add line marker test for type aliases #KT-20164 Fixed 2017-10-10 10:44:39 +03:00
Mikhail Glukhikh eec8be2c21 Add line marker test for primary constructors #KT-20254 Fixed 2017-10-10 10:44:38 +03:00
Mikhail Glukhikh 0ebe9d576a Add line marker test for sealed classes #KT-20043 Fixed 2017-10-10 10:44:36 +03:00
Mikhail Glukhikh 4e56fda439 Introduce isExpect/ActualDeclaration in KotlinLineMarkerProvider
Treat every member of expect declaration as expect declaration itself
So #KT-18455 Fixed
2017-10-10 10:44:35 +03:00
Mikhail Glukhikh ceab148b09 Expect/actual markers: handle secondary constructors correctly
So #KT-20309 Fixed
2017-10-10 10:44:33 +03:00
Dmitry Petrov 26136cd0fe Check constness of 'apiVersionIsAtLeast' arguments 2017-10-10 09:04:51 +03:00
Dmitry Petrov 23d8b4cefe Do not run CCE if there were no apiVersionIsAtLeast calls 2017-10-10 09:04:51 +03:00
Dmitry Petrov fd16035bbd API version calls preprocessing, 1st passing test 2017-10-10 09:04:51 +03:00
Dmitry Petrov 4e7c4c3976 Minor: inline single use of 'analyzeMethodNodeBeforeInline' 2017-10-10 09:04:51 +03:00
Dmitry Petrov a89f978597 Provide configurable constructor call normalization
Three modes:

- 'disable' (default): normalize constructor calls in coroutines only
  (required because uninitialized objects can't be stored in fields),
  don't insert additional code for forced class initialization;

- 'enable': normalize constructor calls,
  don't insert additional code for forced class initialization;

- 'preserve-class-initialization': normalize constructor calls,
  insert additional code for forced class initialization.
2017-10-10 08:49:19 +03:00
Dmitry Petrov e71090ae4c Spill stack for inline functions only if it's required
Stack should be spilled before inline function call and restored after
call only if one of the following conditions is met:
- inline function is a suspend function
- inline function has try-catch blocks
- inline function has loops (backward jumps)

Note that there're quite some "simple" inline functions in Kotlin stdlib
besides run/let/with/apply. For example, many string operations are
implemented as inline wrappers over Java method calls.
2017-10-10 08:49:19 +03:00
Mikhail Zarechenskiy 1845a87813 Provide no-arg constructors for common expected annotations in stdlib
This is needed because we treat `expect` classes as not having implicit default constructors (see more in KT-15522, f3344ec)
2017-10-09 18:50:38 +03:00
Mikhael Bogdanov bd9ac65eaf Update stdlib jre8 test jvm-target 2017-10-09 16:38:56 +02:00
Mikhael Bogdanov 3c81430bb9 Update cli module jvm-target
#KT-20671 Fixed
2017-10-09 16:38:56 +02:00
Kirill Rakhman 91c35a6c59 Support listOfNotNull in SimplifiableCallChainInspection #KT-20410 Fixed 2017-10-09 16:38:52 +03:00
Dmitry Petrov 82a9c35194 Fix self-reference to singleton in initializer
Singleton instance is "initialized" by delegating constructor call,
which is superclass constructor call in case of singletons (because
singletons can't have more than one constructor).

Singleton constructor is effectively split into two stages:
- before a super constructor call;
- after a super constructor call.

Before super constructor call, singleton instance can't be used directly
(see KT-20662), because neither 'this' nor static instance is
initialized yet. However, it can be used in closures, in which case a
static instance should be used (escaping uninitialized this is
prohibited by JVM). Actually using this static instance before it is
initialized (e.g., invoking a method that uses this singleton) will
cause a correct ExceptionInInitializerError.

After a super constructor call, static instance of a singleton may be
not initialized yet (in case of enum entries and interface companion
objects). However, we already have an initialized 'this', which we
should use for singleton references.

 #KT-20651 Fixed
2017-10-09 16:27:34 +03:00
Vyacheslav Gerasimov 62d0e4a51a Add name for GradleProjectImportProvider
#KT-20648 Fixed
2017-10-09 14:40:35 +03:00