Commit Graph

6416 Commits

Author SHA1 Message Date
Artem Kobzar 025a21761b fix: change logic of calculation fqName for export model. 2022-04-28 15:54:50 +00:00
Victor Petukhov fb76d819f0 [FE] Erase type parameters of super types during intersection type emptiness check as well 2022-04-27 19:50:27 +00:00
Victor Petukhov 0f1d212fc5 [FE] Fix tests 2022-04-27 19:50:27 +00:00
Artem Kobzar ccc2aae841 fix(KT-50270): inline properties accessor for child classes too. 2022-04-27 10:21:38 +00:00
Igor Laevsky 3de1235fda [WASM] Add command line option to enable/disable assertions 2022-04-26 20:41:52 +00:00
Zalim Bashorov 90c867ae1d [JS] Define Node.js version in one place and use a single version everywhere
Consequently, it fixes the inability to run some JS related tests on Apple devices with ARM.
2022-04-23 17:58:42 +02:00
Zalim Bashorov 2ed3349f7b [JS] Support downloading v8 for mac-arm64 2022-04-23 14:06:24 +02:00
Artem Kobzar 7327bc864e test(KT-31614): fixate behavior of serialization/deserialization of UTF characters. 2022-04-21 09:22:24 +00:00
Artem Kobzar 59bd2fbb91 test(KT-51066): fixate behavior of value classes in composition with suspend lambdas. 2022-04-20 15:49:09 +00:00
Artem Kobzar 333440dfc6 fix: function inlining without blocks for else statement. 2022-04-20 09:28:45 +00:00
Aleksei.Cherepanov 3d8f140d6b [JPS] Fix incremental build after changing Java enum used in Kotlin when
EnumWhenTracker implemented for tracking changed java enum class items, that used in kotlin when expression.

#KT-47824 Fixed
2022-04-19 18:39:41 +00:00
Artem Kobzar 315ff0beeb fix(KT-38262): add ability to create classes with methods that have reserved keyword as an identifier. 2022-04-19 13:20:13 +00:00
Artem Kobzar 9d0c7a55b1 chore: rename method and remove FIXME comment. 2022-04-19 13:14:22 +00:00
Artem Kobzar 93dcc48512 fix(KT-50157): prevent boxing for char comparison. 2022-04-19 13:14:22 +00:00
Vyacheslav Gerasimov d9e8f0c180 Build: Rework test workers calculation with respect to available memory
#KTI-787
2022-04-19 11:45:23 +00:00
Alexander Likhachev 899964ba30 [Build] Update gradle-node-plugin to 3.2.1
#KT-44611 In Progress
2022-04-19 00:39:21 +03:00
Anton Bannykh 281e381223 JS IR: materialize Unit in lambdas
^KT-52010 fixed
2022-04-16 09:59:51 +03:00
Anton Bannykh 90ee8662da rra/ilgonmic/kt-51973
[JS IR] Add non overridden property and method insode exported class

[JS IR] Add method into exported interface in test

[JS IR] Add interface properties cases to all file export test

[JS IR] Fix usage of isExported inside IrJsUtils


Co-authored-by: Anton Bannykh <Anton.Bannykh@jetbrains.com>

Merge-request: KT-MR-6087
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51973 fixed
2022-04-14 16:59:54 +00:00
Alexander Korepanov d908eb6e84 [JS IR] Fix callable references ignoring bound parameters
^KT-51102 Fixed
2022-04-14 13:48:19 +00:00
Artem Kobzar fc4c745cc4 chore: remove usage of globalscope declaration. 2022-04-11 20:33:20 +00:00
Artem Kobzar f142599243 feat: add limited support of comments inside js call. 2022-04-11 17:03:28 +00:00
Artem Kobzar 7d7490eaa7 chore: fixe rest of comments tests. 2022-04-11 14:25:49 +00:00
Artem Kobzar f5e7b9886c fix: directive and line test. 2022-04-11 14:25:48 +00:00
Artem Kobzar e68ee4053e fix: add semicolon to pattern for parsing directive arguments. 2022-04-11 14:25:48 +00:00
Artem Kobzar 4e8082ad3a fix: arguments pattern for assertion directives. 2022-04-11 14:25:48 +00:00
Artem Kobzar 86df391cab fix: function body comments. 2022-04-11 14:25:47 +00:00
Artem Kobzar 672561b847 chore: remove unused import. 2022-04-11 14:25:47 +00:00
Artem Kobzar 45e3c94a8b feat: add limited support of comments inside js call. 2022-04-11 14:25:46 +00:00
Artem Kobzar c724ca943d test: add labels and breaks count tests. 2022-04-11 10:37:21 +00:00
Artem Kobzar 12f337f63d chore: fix meterialize argument annotation. 2022-04-11 10:37:19 +00:00
Artem Kobzar d46db2a9f3 fix: block statements rendering. 2022-04-11 10:37:18 +00:00
Artem Kobzar 7ef14fc11b chore: use CompositeBlock instead of GlobalBlock. 2022-04-11 10:37:14 +00:00
Artem Kobzar c6136619d2 chore: remove unreadable blocks and use comments instead. 2022-04-11 10:37:13 +00:00
Ilmir Usmanov 1e3f84402d Safely check for suspend function parent
The issue here is that the function can be in unlowered file, and
thus its parent package fragment and not class.

 #KT-49317 Fixed
2022-04-08 23:31:49 +02:00
Sergej Jaskiewicz e1b0e27e62 [JS Legacy] Fix Unit materialization in overridden methods
^KT-51878 Fixed
2022-04-08 11:09:46 +00:00
Alexander Korepanov 2f3ad476be [JS IR] Ignore fake override calls in IC
Fake overrides don't have a signature and can't be assiciated with klib index,
therefore they can't be tracked with incremental cache invalidation logic.

Should be fixed after KT-51896.
2022-04-08 08:54:22 +00:00
Sergej Jaskiewicz d7d86a0e95 [JS IR] Lift lambdas that capture no context
If a lambda expression does not capture any local variables, convert
it to a global free function and replace the lambda creation with
a reference to that function.

Example: for the following Kotlin code

```kotlin
fun foo(f: () -> Unit) = f()

fun bar() = foo { console.log("hello") }
```

before this patch, we generated:

```js
function foo(f) {
  return f();
}
function bar() {
  return foo(bar$lambda());
}
function bar$lambda() {
  return function () {
    console.log('hello');
  };
}
```

after this patch, we generate:

```js
function foo(f) {
  return f();
}
function bar() {
  return foo(bar$lambda);
}
function bar$lambda() {
  console.log('hello');
}
```
2022-04-07 10:31:35 +00:00
Ilmir Usmanov 1488790cd3 Replace recursion with a loop
#KT-51530 Fixed
2022-04-07 01:08:22 +00:00
Igor Laevsky 81eae94821 [Wasm] Disable range checks for arrays. Add cli argument to enable them back. 2022-04-05 18:00:32 +00:00
Ilya Goncharov e2766e402c rra/ilgonmic/more-tests-for-internal-export
[JS IR] Add single file test

[JS IR] isExportedMember considers only public API

[JS IR] Add case with non default accessor

Merge-request: KT-MR-6008
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-50504 fixed
2022-04-05 15:45:41 +00:00
Ilya Goncharov 002d62de89 rra/ilgonmic/revert-signatures-changes
[JS IR] Fix line number test

[JS IR] Ignore isInstance repl test

[JS IR] Ignore isInstance repl test

[JS IR] Add test with unsafe variance

Revert "[JS IR] Optimize away upcasts"

This reverts commit 8149189585.

Get rid of duplicated signatures

Revert "[JS IR] Consider erasing type parameters in return type in js signatures"

This reverts commit 6adcbe081e.

Revert "rra/ilgonmic/exported-bridges-2 [JS IR] Use js name for signature"

This reverts commit 00289d35

[JS IR] Leave as is

[JS IR] Add test with overloading by generic

[JS IR] Add test from master

[JS IR] Add tests from master

Merge-request: KT-MR-5987
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51700 fixed
^KT-51523 fixed
^KT-51685 fixed
2022-04-05 15:35:12 +00:00
Alexander Udalov df86290083 Add another test for KT-49715 and fix JS IR behavior
#KT-49715
 #KT-51798 Fixed
2022-04-05 01:06:57 +02:00
Xin Wang 24105139ea Handle methods descriptor clash in data class
1. Extension functions declared in data classes are generated earlier by `generateMembersDeclaredInClassBody`
2. Extension functions fake override from parent class are generated earlier by `generateFakeOverrideMemberDeclarations`

So it is safe to filter out extension functions inside `generateAdditionalMembersForDataClass`

 #KT-49715
 #KT-51798
2022-04-05 01:06:57 +02:00
Alexander Korepanov 9952d43252 [JS IR] IC improvements
- Reuse a built fragment
  - Use cache for saving built JS code
2022-04-04 17:42:04 +00:00
Ilya Goncharov 611e70c254 rra/ilgonmic/js-fun-import
[JS IR] Test import.meta syntax

[JS IR] Add possibility to use import.meta

[JS IR] Check if import function-like returns Promise

[JS IR] Add test with import function syntax

[JS IR] Allow import function-like in js function

Merge-request: KT-MR-5948
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51125 fixed
2022-04-04 16:26:54 +00:00
Artem Kobzar c56f06f942 test: change function id in implicit cast test to prevent name clash. 2022-03-31 09:59:46 +00:00
Sergej Jaskiewicz f7933dc9f4 [JS IR] Verify that we don't generate Unit_getInstance() statements
See: KT-51127
2022-03-31 09:46:51 +00:00
Ilmir Usmanov 7579be6c68 Generate CHECKCAST after ACONST_NULL in coroutines
If we do not do this, the state-machine builder will not know the type
of the ACONST_NULL, defaulting to Object, leading to VerifyError.
Alternatively, we could use LVT to deduce the type, but getting types
from LVT is something I got rid of long time ago, and I have no desire
to return it back.

Generating CHECKCAST hints the state-machine builder the type of the
variable avoiding the issue of VerifyError. However, this CHECKCAST
replaces StrictBasicValue.NULL_VALUE with BasicValue in
OptimizationBasicInterpreter. To preserve optimization on not-spilling
known nulls, introduce BasicValues, which represent typed nulls and
create BasicInterpreter, which is aware of them. This way we have the
best of two worlds - we do not spill known nulls, and we know the type
of ACONST_NULL.

 #KT-51718 Fixed
2022-03-30 14:27:29 +00:00
Hung Nguyen f23e66a6e2 KT-45777: Replace EmptyICReporter with DoNothingICReporter
to be more consistent (every *Reporter has a DoNothing*Reporter).

^KT-45777 In Progress
2022-03-29 11:36:41 +00:00
Artem Kobzar ba37851490 fix: external declarations in implicit export. 2022-03-29 10:07:25 +00:00