Commit Graph

396 Commits

Author SHA1 Message Date
Alexander Udalov 852760b3b0 Report error on incompatible .kotlin_module files in classpath
Also remove obsolete test wrongAbiVersionNoErrors

 #KT-25973 Fixed
 #KT-26266 Open
2018-08-21 17:12:02 +02:00
Alexander Udalov 0f003802fe Introduce -Xcommon-sources and pass it correctly from build tool plugins
#KT-25196 In Progress
2018-08-21 12:49:10 +02:00
Mikhail Zarechenskiy b1985ee422 Enable SAM conversion for Kotlin functions by default in new inference
KT-25686
2018-08-10 17:24:18 +03:00
Alexander Udalov fe829add44 Minor, use TEMP_DIR/TESTDATA_DIR in CLI tests on xml build files
Otherwise the "outputDir" in these tests was treated as relative to the
project root, and starting from 63b4302cea, running these tests resulted
in the "whatever" directory being created in the project root
2018-08-07 13:38:30 +02:00
Alexander Udalov 19feacb96b Minor, expand TESTDATA_DIR with absolute path in CLI tests
To be able to use it correctly inside an xml build file where, if the
path is not absolute, it's treated as relative to the build file path
(which is TMP_DIR in several tests of the subsequent commit)
2018-08-07 13:38:30 +02:00
Alexander Udalov 4bd66d5aa8 Add compiler argument -Xfriend-paths for kotlinc-jvm
#KT-21910 Fixed
2018-07-27 18:51:42 +02:00
Alexander Udalov 3323fd5a11 Check "kotlin" package usage when compiling common code
#KT-25369 Fixed
2018-07-26 17:10:33 +02:00
Dmitry Petrov 6fb913a463 KT-22274 report error/warning on incorrect return target label 2018-07-25 12:08:20 +03:00
Dmitry Savvinov 6dacd1011f Do not report warning if -XXLanguage turns on bugfix
KT-25554 Fixed
2018-07-20 14:24:42 +03:00
Alexander Udalov 871b896a21 Add internal compiler argument to change metadata version
Will be used in tests to check how we behave on binaries produced by a
"future" compiler
2018-07-18 17:59:37 +02:00
Dmitry Savvinov 70144f8003 Make warning about usage of -XX-flags less scary 2018-07-16 18:49:21 +03:00
Denis Zharkov 89d99e3989 Refine diagnostics for nullability migration warnings
#KT-24911 Fixed
2018-07-13 17:51:21 +03:00
Ilmir Usmanov 6ba2baa9da Deserialize constructors and properties with version requirement 1.3
if they have suspend function type in their descriptors.
Also, review fixes.

 #KT-25256: Fixed
2018-07-11 14:20:46 +03:00
Georgy Bronnikov 8ce658ab54 Introduce -Xuse-ir flag for cli compiler 2018-07-10 10:05:06 +02:00
Ilya Chernikov b979f3dc52 Fix testdata 2018-07-10 08:43:52 +02:00
Ilya Chernikov ec58929e39 Allow multiple same jsr305 options in the command-line
do not report duplicate jsr305 entries if options are the same
2018-07-10 08:43:51 +02:00
Dmitry Savvinov 8eb7eab535 Make tests on -XXLanguage more tolerant to 1.2 -> 1.3 transition 2018-07-05 10:42:50 +03:00
Alexander Udalov 0c45f20515 Minor, fix several CLI argument descriptions 2018-06-27 13:25:30 +02:00
Dmitry Savvinov 8964b2c7a4 Minor: escape colon properly in interalArgWrongPrefix.args 2018-06-21 13:36:11 +03:00
Mikhail Zarechenskiy 605cdcd8d8 Allow to use inline classes in 1.3 with warning 2018-06-18 11:52:31 +03:00
Mikhael Bogdanov 419218b9cf Rename 'jvm-default-mode' to 'jvm-default'. Add description 2018-05-29 11:26:36 +02:00
Dmitry Savvinov da7b59984f Move importsDumper to compiler plugin 2018-05-28 13:02:48 +03:00
Dmitry Savvinov 16ee2df585 Fix tests for imports dumper
Remove local absolute paths from testdata, introduce new testrunner to
support relativization of imports dump.
2018-05-28 13:02:47 +03:00
Alexander Udalov 06d97cce51 Fix multiple issues when expanding argfiles
- treat a contiguous whitespace sequence as a single argument separator,
  not as several empty-string arguments separated by whitespaces
- fix infinite loop when reading unfinished quoted argument
- do not attempt to perform escape if the backslash is the last
  character in the file
2018-05-28 11:23:32 +03:00
Dmitry Savvinov 43467516ef Support argfiles in kotlin compiler
Using '-Xargfile=path/to/argfile' will substitute
that argument with the content of argfile.

See KT-24472
2018-05-28 11:23:32 +03:00
Ilmir Usmanov f568149863 Implement new assert semantics in back-end
Previously, assert was just a regular function and its argument used to
be computed on each call (even if assertions are disabled on JVM).
This change adds support for 3 new behaviours of assert:
* always-enable (independently from -ea on JVM)
* always-disable (independently from -ea JVM)
* runtime/jvm (compile the calls like javac generates assert-operator)
* legacy (leave current eager semantics) - this already existed

Default behaviour is legacy for now.

The behavior is changed based on -Xassertions flag.
 #KT-7540: Fixed
2018-05-21 20:43:37 +03:00
Dmitry Savvinov c33b7377da Add support of internal arguments for language feature settings
Arguments are passed in form '-XXLanguage:+LanguageFeatureName' for enabling
LanguageFeature.LanguageFeatureName, and '-XXLanguage:-LanguageFeatureName'
for disabling.

Note that they do override other settings, including 'language-version'
or extra ('-X') args.
2018-05-18 16:16:23 +03:00
Dmitry Savvinov e8181c0473 Introduce -Xprogressive 2018-05-18 16:16:23 +03:00
Dmitry Savvinov 70622ff668 Introduce -Xoutput-imports mode of JVM compiler
In this mode, instead of analyzing files and generating bytecode for
them, compiler just saves imports of each file in JSON map of form

'<path to file> -> [<import1>, <import2>, ...]'

It is needed for some external tools, notably for Google3 toolchain.
2018-05-15 15:36:14 +03:00
Dmitry Savvinov 97d455729b Add -Xdump-perf 2018-05-04 15:00:43 +03:00
Dmitry Savvinov 9996a1bc7e Rewrite performance statistics collection
This commit introduces notion of 'PerformanceManager' in CLI, suitable
for collecting performance metrics of the compiler. It:

- provides `notifyX{Started/Finished}` API, where 'X' is some
measurable event (previously there were just ad hoc manual time
measurements using System.nanoTime() and stuff)

- collects measurements, so that later they can be reported in an
appropriate way (previously measurements were reported immediately to
MessageCollector as plain strings)

- allows overriding to collect metrics, specific for just one target
platform compilation

Also, common logic of compiler performance statistics collection was
extracted from platform-compilers (K2JVMCompiler) to common classes
(CLICompiler), to allow other platform-compilers (e.g. K2JSCompiler)
re-use it.
2018-05-04 15:00:43 +03:00
Dmitry Savvinov c3745c9040 Drop -Xrepeat flag
This flag hadn't been maintained for a long time and isn't working
properly at the moment.
2018-05-04 15:00:43 +03:00
Alexander Udalov c57864e46c Require "-Xuse-experimental=kotlin.Experimental" on usages of Experimental
Since we're not yet sure of the design of Experimental/UseExperimental,
we're making them "experimental" themselves in some sense, in that the
user is required to provide the magic argument
"-Xuse-experimental=kotlin.Experimental" to be allowed to use either
Experimental or UseExperimental. This is more convenient than the
previous approach of "-language-version 1.3
-Xskip-metadata-version-check" because it's simpler and does not cause
pre-release binaries to be produced
2018-05-04 13:48:24 +02:00
Alexander Udalov 4f53a54115 Drop Experimental.Impact, simplify related code and tests
See https://github.com/Kotlin/KEEP/issues/95#issuecomment-383889404

Drop Experimental.changesMayBreak, Experimental.Impact, the concept of
signature/body usage, same module exemption. Make the majority of tests
single-module because there is now no difference in the checker between
usages from the same module or from another module
2018-05-04 13:48:24 +02:00
Ilya Chernikov a29411a211 Process script templates everywhere properly:
- add options to disable scripting plugin and standard script definition
- move standard definition adding logic into appropriate place
- fix logic of scripting plugin loading
- add standard script definition on the environment creation to
  ensure compatibility with all usages
- fix testdata
- some minor fixes
2018-05-03 22:15:09 +02:00
Anton Bannykh 703611a15c Revert "JS: remove -XtypedArraysEnabled flag (always true now)"
This reverts commit 4a5e9bb
2018-04-10 20:45:07 +03:00
Roman Artemev 3bc323807f Fix function lookup in modules with similar names [KT-23582] 2018-04-10 15:58:30 +03:00
Roman Artemev 4cdd121c21 Add test for issue KT-23582 2018-04-10 15:58:30 +03:00
Mikhael Bogdanov f1b8a8f913 Fix test data 2018-04-09 18:13:37 +02:00
Ilya Chernikov 78e45f00f5 Fix test data after merging new scripting 2018-04-06 08:53:32 +02:00
Ilya Chernikov cc2b244484 Add a compiler option to disable default scripting plugin 2018-04-06 08:53:31 +02:00
Mikhael Bogdanov 08ff1de248 Update test data 2018-04-03 19:38:37 +02:00
Nikolay Krasko 875e0a64e7 Add -Xuse-type-table to jvm compiler options 2018-03-22 11:54:01 +03:00
Mikaël Peltier d0ed0c4049 KT-14258 Optimize accesses to properties defined into companion
- Use direct access to property defined into companion object when
it is possible rather than always use an accessor to access the
property.
- Use direct access will speedup runtime performance.
- Avoid to generate useless accessors for companion properties.

Fix of https://youtrack.jetbrains.com/issue/KT-14258
2018-03-14 15:30:40 +01:00
Mikhael Bogdanov c1c8660e55 Don't try to transform sam wrappers in same module
#KT-22304 Fixed
2018-03-08 11:50:08 +01:00
Anton Bannykh 4a5e9bbc7f JS: remove -XtypedArraysEnabled flag (always true now) 2018-03-01 14:26:13 +03:00
Anton Bannykh ed80252ba8 JS: fix double compareTo behaviour for NaN and +-0 (KT-22723) 2018-02-28 15:01:58 +03:00
Dmitry Petrov 839ebba157 ProperNumberComparisons is disabled by default (until LDC decision) 2018-02-13 09:26:00 +03:00
Alexander Udalov ec6b49b8b8 Check experimental API markers for deprecation
#KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 77625831f7 Support -Xexperimental and -Xuse-experimental, validate their values
#KT-22759 In Progress
2018-02-08 17:07:22 +01:00