Commit Graph

39738 Commits

Author SHA1 Message Date
Denis Zharkov 3dc4f8a2ff Do not write generics for $suspendImpl synthetic method
#KT-18252 Fixed
2017-06-28 10:25:08 +03:00
Yan Zhulanow e7e0032cc8 Kapt3, minor, tests: Weaken regular expression for Metadata shrinking 2017-06-28 10:25:08 +03:00
Denis Zharkov d88d1d6189 Do not use non-existing class for suspend markers
As they remain in inline functions now proguard emits
a warning about them, even though inline suspend functions
are effectively inline-only and these markers can't be
executed at runtime

 #KT-18702 Fixed
2017-06-28 10:24:53 +03:00
Denis Zharkov cb95986c36 Report error on calls to obsolete inline suspend functions
They do not contain markers for suspend calls in them

See the changes introduced for fixing KT-16603
2017-06-28 10:24:27 +03:00
Zalim Bashorov 6441c9d913 Restore executable attributes for all files in kotlinc/bin after copying them 2017-06-27 21:57:59 +03:00
Zalim Bashorov 6cd678af06 Add the ability to provide custom tag when deploy to npm 2017-06-27 21:35:09 +03:00
Nikolay Krasko d8d862fa68 Do not compute class names for inline usages during stepping (KT-18411)
This was lost in "Debugger: Fix AbstractPositionManagerTest"(622430a29)

ExtraSteppingFilter: do not compute classNames for inline (f28f7eaa3b)

 #KT-18411 Fixed
2017-06-27 17:39:17 +03:00
Mikhail Glukhikh 7d7ef18e99 Fix type in README 2017-06-27 17:10:27 +03:00
Alexey Andreev f6964b18db Fix performance issue in JS inliner
See KT-18679
2017-06-27 15:10:21 +03:00
Alexander Udalov f96ef96078 Check JDK_16 and JDK_18 existence in build.xml 2017-06-27 14:54:53 +03:00
Alexander Udalov e42b151561 Support primitive array annotation arguments in ConstantValueFactory
This has no visible consequences at the moment, but will help once we
need to load such argument from some annotation in the compiler in the
future
2017-06-27 14:53:39 +03:00
Alexander Udalov b67542533b Drop unused FunctionDescriptor.Configuration.setSource 2017-06-27 14:53:39 +03:00
Alexander Udalov 288c2b5dc9 Minor, remove some obsolete usages of ResolutionContext#replaceScope 2017-06-27 14:53:39 +03:00
Alexander Udalov 59b932a815 Optimize away unneeded FqName computation in KotlinBuiltIns
Before computing the FqName, check the simple class name first. This
code was responsible for about 20% of FqNameUnsafe instances created
during compilation of "core" modules
2017-06-27 14:53:39 +03:00
Alexander Udalov 0352bdbca5 Optimize and improve AbstractClassTypeConstructor.equals
Instead of computing and comparing FQ names, compare simple names of
classes and theirs containers. This code was responsible for creation of
about 10% of FqNameUnsafe instances during compilation of "core"
modules.

Also make the check more strict: previously, a class "c" declared in
package "a.b" would be considered equal to a class "c" declared in class
"b" in package "a". Because JVM type descriptors of such classes are
different, this behavior was suspicious and might have lead to error at
runtime. Now, we require the number of containing classes of the given
two classes also to be the same
2017-06-27 14:53:39 +03:00
Dmitry Petrov d5e02f069a Fast version for POP backward propagation (without SourceInterpreter) 2017-06-27 14:28:42 +03:00
Dmitry Petrov f1183d98a9 Fix complexity formula for SourceInterpreter
It is actually N^2 * F (VERY pessimistic case),
N = number of instructions
F = frame size
because frames contain sets of instructions.
2017-06-27 14:28:42 +03:00
Dmitry Petrov a84c2a6f31 Improve string concatentation & string templates code generation
Reuse StringBuilder instances for nested subexpressions.
(NB StringBuilder instance for string template with a string
concatenation inside an expression entry, such as `"${"a" + "b"}"`,
will not be reused, although that doesn't seem to be a real-life issue).

 #KT-18558 Fixed Target versions 1.1.4
 #KT-13682 Fixed Target versions 1.1.4

Join adjacent strings literals, escaped strings, and constant values
(in a language version that supports const val inlining).
Use StringBuilder#append(char) for single-character constants
(e.g., " " in "$a $b").

 #KT-17280 Fixed Target versions 1.1.4
 #KT-15235 Fixed Target versions 1.1.4
2017-06-27 14:28:42 +03:00
Dmitry Petrov ae71833a12 Use original descriptors for functions when generating stubs
Descriptors for builtin class members on JVM are substituted.
2017-06-27 13:00:10 +03:00
Dmitry Petrov 5e5a1bd686 Use java.lang.Object as a fall-back reference type
If for some reason during preliminary analysis in redundant null check
elimination we failed to determine a local variable type statically,
treat it as java.lang.Object.
This will disable some further optimizations using precise type
information (such as INSTANCEOF check elimination), but will not fail
with an exception anyway.
2017-06-27 12:56:34 +03:00
vitaly.khudobakhshov d165ea9ea7 Add expression type string to the REPL API
PR-1131
2017-06-27 11:28:40 +02:00
Alexander Udalov 8783f7a94e Remove unneeded nullability annotations in CallableReference 2017-06-26 18:46:26 +03:00
Alexey Andreev 20842dcc44 Add module name as a prefix to declaration keys in JS translator
This is necessary due to different modules can have same
package declarations. When importing declarations from these
packages, we should distinguish from which module we are importing it.

See KT-18652
2017-06-26 18:16:00 +03:00
Alexey Andreev 3331be9cc8 Fix JS CLI test that fails in Windows 2017-06-26 18:15:30 +03:00
Alexey Andreev adc04196b1 Support JS source map source embedding configuration in IDEA 2017-06-26 18:15:29 +03:00
Alexey Andreev a0e1bde594 Allow to embed source files into JS source maps 2017-06-26 18:15:28 +03:00
Nikolay Krasko 73c37ecd25 Remove usage of HighlightingSession.getEditor()
It's going to be deleted in IDEA.
2017-06-26 17:39:39 +03:00
Alexander Udalov 0c8ca5f930 Extract some functions from test class into base class
To be used in other tests which will be subclasses of
AbstractKotlinCompilerIntegrationTest
2017-06-26 16:22:05 +03:00
Alexander Udalov 69efb81a12 Minor refactoring in JavaModuleInfo
Remove unused declarations
2017-06-26 16:22:05 +03:00
Alexander Udalov fd0658e0f4 Minor, inline unneeded JvmDependenciesIndexFactory 2017-06-26 16:22:05 +03:00
Alexander Udalov 0e2e3b3e65 Cleanup KotlinCoreEnvironment and usages
Remove unused API, weaken declaration visibility, reformat
2017-06-26 16:22:05 +03:00
Alexander Udalov 999e4cda1d Compute module mappings eagerly in JvmPackagePartProvider, refactor
Previously we traversed all notLoadedRoots on each request for package
parts with the given package FQ name. Since notLoadedRoots might contain
a lot of roots (which never transition into "loadedModules" because e.g.
they are not Kotlin libraries, but just Java libraries or SDK roots with
the META-INF directory), this was potentially hurting performance. It
seems it's more optimal to compute everything eagerly once
JvmPackagePartProvider is constructed.

Another problem with the previous version of JvmPackagePartProvider was
that it did not support "updateable classpath" which is used by REPL and
kapt2, it only used the initial roots provided in the
CompilerConfiguration. In REPL specifically, we would thus fail to
resolve top-level callables from libraries which were dynamically added
to the execution classpath (via some kind of a @DependsOn annotation).
In the new code, JvmPackagePartProvider no longer depends on
CompilerConfiguration to avoid this sort of confusion, but rather relies
on the object that constructed it (KotlinCoreEnvironment in this case)
to provide the correct roots. This is also beneficial because the
computation of actual VirtualFile-based roots from the ones in the
CompilerConfiguration might get trickier with modular Java 9 roots
2017-06-26 16:22:05 +03:00
Alexander Udalov a5a78b8f91 Minor refactoring in ClasspathRootsResolver.convertClasspathRoots
Package prefix only makes sense for JavaSourceRoot content roots
2017-06-26 16:22:05 +03:00
Alexander Udalov 2424431e16 Extract ClasspathRootsResolver out of KotlinCoreEnvironment 2017-06-26 16:22:04 +03:00
Alexander Udalov 6d48b1c3fb Minor, extract MessageUtil.virtualFileToPath 2017-06-26 16:22:04 +03:00
Alexander Udalov 8af923c5ff Refactor MockLibraryUtil and related tests
- separate compileLibraryToJar into two public functions, for JVM and JS
- allow to pass any extra options instead of just -Xallow-kotlin-package
- add a bunch of default arguments for the most common cases
2017-06-26 16:22:04 +03:00
Alexander Udalov 68df1d73e7 J2K MockLibraryUtil: prettify 2017-06-26 16:22:04 +03:00
Alexander Udalov 46a6dc6550 J2K MockLibraryUtil: convert 2017-06-26 16:22:04 +03:00
Alexander Udalov 884e85653f J2K MockLibraryUtil: rename .java -> .kt 2017-06-26 16:22:04 +03:00
Denis Zharkov c8a2de0243 Allow custom expected result for fast class reading tests 2017-06-24 17:26:02 +03:00
Denis Zharkov bc564af2fc Regenerate mockJDK using openJDK 7 2017-06-24 17:26:01 +03:00
Dmitry Jemerov 3158c71c29 Check that we have correct sources for mockjdk 2017-06-24 17:08:11 +03:00
Nikolay Krasko 87889904ee Allow only one invoke to be a target for smart step into (KT-18632)
It's difficult to distinguish such calls reliably in debug session

 #KT-18632 Fixed
2017-06-23 21:33:26 +03:00
Mikhail Glukhikh 247c0497b1 Visibility can be private: weaken level to INFO 2017-06-23 18:15:21 +03:00
Mikhail Glukhikh c99db11ace Visibility can be private: do not perform too expensive search
Also, additional test for usage via accessor was added
So #KT-18617 Fixed
2017-06-23 18:15:20 +03:00
Zalim Bashorov 3358f0ab69 KJS: use korlinc-js runner written in js to make possible to run it on any OS
Restore executable attributes on kotlinc* bash scripts after copying them.
2017-06-23 15:14:35 +03:00
Nikolay Krasko 502ac80b89 Do not skip invoke call on parameters during smart step into (KT-18577)
#KT-18577 Fixed
2017-06-23 13:47:33 +03:00
Nikolay Krasko e5ce91dc5b Show receiver for invoke calls in smart step into popup 2017-06-23 13:47:33 +03:00
Alexey Sedunov 9681f5ca42 Generate equals/hashCode(): Enable for classes without properties
Also:
- forbid for enum classes
- use javaClass.hashCode() instead of 0 if class has no properties

 #KT-18418 Fixed
2017-06-22 19:50:55 +03:00
Alexey Sedunov 895407f5e3 Rename: Do not silently rename all parameters in function hierarchy
#KT-18325 Fixed
2017-06-22 19:50:54 +03:00