Commit Graph

62549 Commits

Author SHA1 Message Date
Roman Artemev 98aa73ee6b [JS IR] Fix code clean-up optimizations
- Do not create an extra variable/field for in some lowerings
2020-03-03 19:19:41 +03:00
Roman Artemev 65011f96cc [JS IR] Clean up coroutine code 2020-03-03 19:19:39 +03:00
Roman Artemev c4efd5a09b [JS IR] Use JsThisRef node for dispatch/instance receivers 2020-03-03 19:19:38 +03:00
Roman Artemev 62c86f2813 [JS IR] Remove filthy hacks from namer 2020-03-03 19:19:37 +03:00
Roman Artemev 3c7cc07263 [JS IR] Clean up code 2020-03-03 19:19:36 +03:00
Roman Artemev 133f3d359f [JS IR] remove hacks from DCE 2020-03-03 19:19:34 +03:00
Roman Artemev adc022fde8 Fix some coroutine tests 2020-03-03 18:54:36 +03:00
Roman Artemev 4e002a41e6 [JS IR] Fix visibility & code clean up 2020-03-03 18:54:36 +03:00
Roman Artemev 8654dbdc6e [JS IR] Refactor property references
- implement separate lowering
 - fix issues with type checks
 - clean code up
2020-03-03 18:54:36 +03:00
Roman Artemev 5dcac16cf7 [JS IR] Update test data 2020-03-03 18:54:36 +03:00
Roman Artemev c2676ded31 [JS IR] Implement KProperty runtime utils 2020-03-03 18:54:36 +03:00
Roman Artemev 6e75b56388 [JS IR] Fix bridge modality 2020-03-03 18:54:36 +03:00
Roman Artemev 161bb72439 [JS IR] Update test data 2020-03-03 18:54:36 +03:00
Roman Artemev 97b97ddbd7 [JS IR] Fix phases
- update phase description
 - remove unused phases
2020-03-03 18:54:35 +03:00
Roman Artemev cf41172521 [JS IR] A bunch of fixes to make PIR mode work
- provide required mappings
 - fix fake overrides
 - fix local declaration lowering
 - fix DCE
2020-03-03 18:54:35 +03:00
Roman Artemev f8d155c6a3 [JS IR] Fix native invoke checker 2020-03-03 18:54:35 +03:00
Roman Artemev 9e1c52f8cb [JS IR] Fix this reference name generation 2020-03-03 18:54:35 +03:00
Roman Artemev 536e380331 [JS IR] Fix kotlin.test framework 2020-03-03 18:54:35 +03:00
Roman Artemev 293ddb5389 [JS IR] Fix inline classes for new callable reference scheme 2020-03-03 18:54:35 +03:00
Roman Artemev 0e67c6ac7d [JS IR] Update coroutine runtime 2020-03-03 18:54:35 +03:00
Roman Artemev b9eff4b246 [JS IR] Make coroutines work with new lambda scheme
- Do not create extra class for suspend lambda
2020-03-03 18:54:35 +03:00
Roman Artemev 3783205fb7 [JS IR] Lower suspend lambda as a regular lambda 2020-03-03 18:54:35 +03:00
Roman Artemev 26237f8bd5 [JS IR] Implement new function references scheme 2020-03-03 18:54:34 +03:00
Vyacheslav Gerasimov 2f087fe7a2 Build: Fix kotlin-stdlib-js-ir:tryRunFullCli task inputs 2020-03-03 18:46:05 +03:00
Dmitry Gridin b4898e4043 Put arguments/parameters on separate/one line should update trailing comma
#KT-36411 Fixed
2020-03-03 21:53:11 +07:00
Dmitry Gridin 173f90c89c AbstractIntentionTest: support code style and registry settings 2020-03-03 21:53:11 +07:00
Dmitry Gridin baf2dd6b9b KotlinLightCodeInsightFixtureTestCase: add configureCodeStyleAndRun 2020-03-03 21:53:11 +07:00
pyos f66b994946 JVM_IR: make suspend lambda invoke()/create() creation shorter
Also, fix finality of fields corresponding to unbound parameters. (They
are set in invoke/create, not in the constructor.)
2020-03-03 15:12:13 +01:00
pyos 6184171a11 JVM_IR: carry less state while transforming suspend funs into views 2020-03-03 15:12:13 +01:00
pyos 5896d8003e JVM_IR: unify generateStateMachineFor{Lambda,NamedFunction} 2020-03-03 15:12:13 +01:00
pyos 159d292ea7 JVM_IR: make continuation detection more consistent
* unify various checks for whether a suspend function needs a
    continuation;

  * mark the continuation parameter with an origin (this also allows
    correctly computing the offset of the local in codegen -- see the
    new test);

  * when wrapping `suspend fun main`, use a suspend reference instead of
    a synthetic non-suspend lambda (required to correctly implement the
    previous point, as previously the continuation parameter was passed
    to main() itself correctly only because of very lenient checks in
    AddContinuationLowering).
2020-03-03 15:12:13 +01:00
Vyacheslav Gerasimov c57f466494 Build: Use same com.eclipsesource.j2v8 artifact for compilation
We can't reuse caches from different platform when we compile against
different jar on each platform. Since they have same api we may use
platform specific jars only for runtime.
2020-03-03 16:47:55 +03:00
Vyacheslav Gerasimov a4030d3abf Build: Make JavaExec relative path system independent 2020-03-03 16:47:55 +03:00
Vyacheslav Gerasimov 08ac7da7a6 Build: Fix input declaration for :kotlin-stdlib-js-ir:fullRuntimeSources
Input order was random because of unordered set
2020-03-03 16:47:55 +03:00
Vyacheslav Gerasimov bb2cf38617 Build: Make :kotlin-stdlib-js-ir buildKLib tasks cacheable 2020-03-03 16:47:55 +03:00
Alexander Udalov d84a6fa742 JVM IR: always generate inline class constructor with name 'constructor-impl'
Previously it was 'constructor-' + hash in case inline class property is
of inline class type.

No new tests added because this change fixes the constructor name in
`bytecodeListing/inlineClasses/inlineClassWithInlineClassUnderlyingType.kt`,
which is now failing due to other reasons.

 #KT-37041 Fixed
 #KT-37186
2020-03-03 14:16:03 +01:00
Vyacheslav Gerasimov 688208aa56 Build: Disable caching of Test tasks with doNotCacheIf 2020-03-03 15:55:38 +03:00
Vyacheslav Gerasimov 75a3808230 Build: Use sourceMapBaseDirs in :kotlin-stdlib-js:compileKotlin2Js
instead of freeCompiler args to avoid snapshotting absolute paths
and fix caching
2020-03-03 14:33:57 +03:00
Vyacheslav Gerasimov 4b9c7a1ae1 Advance bootstrap to 1.4.0-dev-1818 2020-03-03 14:33:55 +03:00
Victor Petukhov d6ccdb3caa NI: fix extensionLambdasAndArrow test 2020-03-03 13:55:15 +03:00
Kristoffer Andersen 6e40117116 [JVM IR] Refactor PromisedValue...
... for an _even leaner_ codegen!

- move discard from extention method to abstract method. This will at
  length avoid some calls to materialize.

- use newly abstract method to specialize discard in cases where it
  would introduce _and_ coerce values only to be popped by discard.

- move coerce to member method, introduce materializeAt with a view to
  eliminate calls to coerce outside of PromisedValue. This will allow
  us to specilaize materialization at particular types in some
  instances, at length avoiding casts etc.

- no calls to coerce outside of PromisedValue.kt! Progress.

- inlined coerce into materializeAt, anticipating specializing
  materializeAt across implementations of PromisedValue

- made materializeAt abstract, copied implementation everywhere!

- made materialize an extention function! Ready to specialize materializeAt

- coerce is no more!

- simplified and specialized all inlinings of materializeAt.

- adjust docs to match refactoring
2020-03-03 11:41:55 +01:00
Pavel Kirpichenkov ad988dbf43 minor: update test data 2020-03-03 12:57:41 +03:00
Pavel Kirpichenkov 23ed6c4a1f [NI] Narrow nullability constraint check in incorporator
This commit is a hotfix rather then proper solution.
The source of the issue is that currently type variable fixation result
may change due to fixation order alteration for variables with the same priority.
For instance, having variables V1, V2, and proper types Type1, Type2, such that:
V1 <: Type1
V1 <: V2
Type2 <: V2
both variables will be fixed either to Type1, if V1 will be fixed first,
or to Type2 otherwise.

Since this limitation cannot be easily overcome, the taken approach is to remove
incedental constraint added after 2d5a0546 by restricting nullability constraint check
to `Nothing?` constraints only, thus postponing problematic variable fixation.
To clearify, additional constraint is correct and should cause no harm (in ideal world),
but currently its presence changes fixation order.
So without the restriction the previously used constraint from fixed outer variable
is no longer available by the time problematic variable type is being selected.

^KT-37043 Fixed
2020-03-03 12:57:25 +03:00
Dmitriy Novozhilov ec01893237 [FIR] Resolve return expressions in independent context 2020-03-03 09:57:45 +03:00
Dmitriy Novozhilov d4f57fb835 [FIR] Support comparision operator and reified parameter reference in html dump 2020-03-03 09:57:45 +03:00
Dmitriy Novozhilov 9eeee6aad7 [FIR-TEST] Move FirBlackBoxCodegenTestGenerated to :fir2ir module 2020-03-03 09:57:45 +03:00
Dmitriy Novozhilov 54e7c79257 [FIR] Safe implicit receiver stack in lambda atom for resolve of inner lambdas
#KT-36887 Fixed
2020-03-03 09:57:42 +03:00
Dmitriy Novozhilov c7f5a2cba2 [FIR] Make ImplicitReceiverStack persistent 2020-03-03 09:57:41 +03:00
Dmitriy Novozhilov a332a5f26d Add benchmark with case with a lot of implicit receivers 2020-03-03 09:57:41 +03:00
Dmitriy Novozhilov 7ee125e1ad [FIR] Add receiver for lambda in position of default argument
#KT-36905 Fixed
2020-03-03 09:57:41 +03:00