Commit Graph

1354 Commits

Author SHA1 Message Date
Anton Bannykh 4de69fb4b5 [JS IR] store signatures for private symbols separately from public
Those signatures are used in JS IR IC
2021-12-03 12:58:24 +03:00
Anton Bannykh cb3538db92 Revert "[IR] support storing signatures for non-public symbols"
This reverts commit 33cd7e982c.
2021-12-03 12:58:24 +03:00
Anastasiya Shadrina 17f24319d0 [IR, Tests] Add context receivers count to IR dump 2021-12-02 20:24:46 +03:00
Anastasiya Shadrina 617af898b0 [FE, IR] Support deserialization 2021-12-02 20:24:37 +03:00
Anastasiya Shadrina d0794e6741 [IR] Make contextReceiverParametersCount abstract in IrFunction 2021-12-02 20:24:34 +03:00
Anastasiya Shadrina 097e286622 [IR] Minor: add a note about contextReceiverParametersCount prop 2021-12-02 20:24:27 +03:00
Anastasiya Shadrina a3cf1a11bf [BE] Add context receivers to inline class replacements 2021-12-02 20:24:24 +03:00
Anastasiya Shadrina c148a12e4b [IR] Fix functional type sample 2021-12-02 20:24:24 +03:00
Anastasiya Shadrina 155e7b211b [PSI2IR, IR] Support functional types and literals for IR 2021-12-02 20:24:17 +03:00
Anastasiya Shadrina a2403c470f [BE] Put context receivers before an extension receiver 2021-12-02 20:24:00 +03:00
Anastasiya Shadrina aaabf5e1ca [PSI2IR] Support context receivers on classes 2021-12-02 20:23:38 +03:00
Anastasiya Shadrina 307f318c9e [PSI2IR] Generate IR for functions and calls with context receivers 2021-12-02 20:23:27 +03:00
Anastasiya Shadrina f4ddf66ac4 [FE] Support context receivers on classes 2021-12-02 20:23:25 +03:00
Anastasiya Shadrina a39fbd3822 [FE] Add getContextReceivers to CallableDescriptor interface 2021-12-02 20:23:17 +03:00
Anton Bannykh 2259c6f75d [JS IR IC] assert cross-file tag are not null and fix tests 2021-11-29 21:09:35 +03:00
Anton Bannykh 33cd7e982c [IR] support storing signatures for non-public symbols 2021-11-29 21:09:34 +03:00
Mikhail Glukhikh 4a8f00bc7c FIR2IR: support reading of isNewPlaceForBodyGeneration in lazy class 2021-11-26 09:18:11 +03:00
Dmitry Petrov 2a263eca65 FIR2IR strip annotations from IrConst type 2021-11-23 06:34:03 +00:00
Kristoffer Andersen be1c0bb9c1 [EE-IR] Support mutations by evaluator fragments
- box captured variables using `Ref`s, the same mechanism that's used
  for shared variables in closures.
2021-11-21 01:34:42 +01:00
Roman Artemev e4585730d6 [IR] Add platform-agnostic builtin to throw linkage error 2021-11-19 01:16:33 +03:00
Anton Bannykh 56e1c4e38f [JS IR] IrFactory which saves signatures for declarations created in BE 2021-11-19 00:39:12 +03:00
Svyatoslav Scherbina e11ffc75e4 IR: remove default undefined offsets from createTemporaryVariableDeclaration
Scope.createTemporaryVariableDeclaration has default values for
startOffset and endOffset parameters, which are UNDEFINED_OFFSET.

This is error-prone. Caller should typically be able to pass proper
offsets. If not, let using undefined offsets at least be explicit.

Remove default values for startOffset and endOffset parameters in
Scope.createTemporaryVariableDeclaration
2021-11-16 11:59:56 +00:00
Svyatoslav Scherbina 2f5706597a IR: fix offsets in irTemporary
The variable generated by IrStatementBuilder.irTemporary doesn't inherit
startOffset and endOffset from the builder. In particular, as a result,
temporary variables generated for elvis operator left operand have
UNDEFINED_OFFSET.

Additionally, ProvisionalFunctionExpressionLowering copies the offsets
of a variable to lowered lambda in the variable initializer. With the
problem described above, this causes invalid debug information in
Kotlin/Native, see KT-49360.

Fix irTemporary by using builder's offsets for the variable.

^KT-49360 Fixed
2021-11-16 11:59:55 +00:00
Kristoffer Andersen 771b79d045 [EE-IR] Use reflection to avoid the need for accessors when compiling
evaluator fragments

- Refactor JvmIrCodegenFactory to allow for caller's choice of
  lowerings.

- Refactor of SyntheticAccessorLowering to expose the accessibility
  check used to determine the need for accessors.

- Replacement of field, method and constructor uses with corresponding
  java.lang.reflection API via additional lowering running _before_
  the existing IR pipeline.

- Emulating super calls in the context of class methods via new
  compiler intrinsic.

- psi2ir: Add support for `_field` suffix on properties in the
  evaluator for accessing underlying fields when applicable.

- Add `JvmGeneratorExtensions` point for determining whether a
  property accessor has a user-supplied body in order to predict how
  they are ultimately compiled for the JVM.
2021-11-14 21:50:13 +01:00
Alexander Udalov 27cfcb9b3d IR: fix thisReceiver parameter type for function classes
Incorrect builder was used at line 269, which led to non-sensible type
in `IrClass.thisReceiver` for function types, such as
`SuspendFunction1<SuspendFunction1, SuspendFunction1>` in the linked
issue.

Avoid creating types manually completely to simplify this code and fix
the bug.

 #KT-49168 Fixed
2021-11-10 21:58:41 +01:00
Mikhail Glukhikh 5b6e21690b FIR2IR: call fake overrides properly #KT-49288 Fixed 2021-11-09 21:04:35 +03:00
Ivan Kylchik 68c9156053 Add possibility to get line offsets from PsiIrFileEntry
This is needed for tests to be able to get offsets without explicit
file on disk.
2021-11-08 23:50:34 +03:00
Pavel Kunyavskiy 948dc4f374 Fix annotation class modality in stubs
^KT-49428
2021-11-03 07:22:28 +00:00
Pavel Kunyavskiy d127815626 Refactor DataClassMembersGenerator.kt for better work with LazyIr
^KT-49428
2021-11-03 07:22:28 +00:00
Mads Ager 6622846bc1 [JVM IR] Do not put destructuring params or underscores in LVT.
Putting them in the local variable table means that the debugger
needs to have special handling for parameters with specific names.
That forces us to generate mangled names for these.

Instead of also implementing the name mangling for FIR, this
change gets rid of the parameters from the LVT instead.
2021-11-02 15:13:14 +03:00
Georgy Bronnikov 534beb8553 IR: Test for toSkip(this) in T.resolveFakeOverride()
^KT-49371 Fixed
2021-10-29 12:13:57 +03:00
Roman Artemev d809e260cb [KLIB] Support DefinitelyNotNull type in KLIB
- add proto message
 - serialize/deserialize
2021-10-28 18:03:11 +03:00
Roman Artemev 29728efbf7 [PSI2IR] Support DefinitelyNotNull type translation in Psi2Ir 2021-10-28 18:03:11 +03:00
Roman Artemev 101afded69 [IR] Introduce IrDefinitelyNotNullType in IR
- support it in render
 - support in IR copy
 - KEEP-268
2021-10-28 18:03:09 +03:00
Sergej Jaskiewicz a367b91aa1 [IR] [Refactoring] Add toString and String::plus to IrBuiltins
Also use `OperatorNameConventions` constants instead of magic strings
2021-10-28 08:35:11 +00:00
Ivan Kochurkin 15d23f2a72 [FIR2IR] Fix applying of equals intrinsics 2021-10-25 21:21:39 +03:00
Dmitry Petrov eec16b83c6 Minor: reformat and fix warnings 2021-10-23 11:21:23 +03:00
Artem Kobzar 3dbf996ec6 fix(KT-49225): remove unnecessery boxing. 2021-10-21 06:38:42 +00:00
Anton Bannykh 546ce501cb [JS IR] run IC box tests 2021-10-15 20:14:51 +03:00
Dmitry Petrov af18b10da9 JVM_IR KT-49203 generate stubs for not found classes 2021-10-15 12:15:49 +03:00
Pavel Kunyavskiy e4a4cd3e16 [K/N] Transform constant varargs to ConstantValue 2021-10-14 11:22:25 +00:00
Pavel Kunyavskiy bf3c343ced Introduce new ir nodes for constant values 2021-10-14 11:22:21 +00:00
Svyatoslav Kuzmich 5affd9d2f9 Visit declaration reference when visiting member access 2021-10-12 23:01:00 +03:00
Svyatoslav Kuzmich a6afb7cb41 [JS IR][Wasm] Preload (Suspend)FunctionN needed in lowerings
This reverts commit 15d178d850d15675ee39cbd833d13f4c8aed83ff.
2021-10-12 08:42:01 +03:00
Svyatoslav Kuzmich 3bce0cc055 [Wasm] Support coroutines
- Reuse JS IR Suspend function lowering
  - Fix types
  - Disable reinterpretCast-based optimization for inline
    classes
- Add basic support to Wasm stdlib
- Explicitly transform suspend functions into regular functions
  with continuations
- Clean suspend function handling from JS IR codegen
2021-10-12 08:42:01 +03:00
Georgy Bronnikov a9ce25cf33 JVM_IR: only serialize inline functions themselves with -Xserialize-ir=inline 2021-10-11 11:53:30 +03:00
Dmitry Petrov 146f0f4904 JVM_IR KT-41214 emit PermittedSubclasses on JDK17+ 2021-10-09 17:07:35 +03:00
Svyatoslav Kuzmich 1ed2748334 [Wasm] Generate [K][Suspend]FunctionN on demand and support big arity 2021-10-08 07:24:41 +03:00
Roman Artemev e6de812788 [IR] Implement checker for friendship of modules in fake override builder
- pass corresponding information to FO builder
 - implement check
 - fix KT-47192 and KT-48673
2021-10-07 16:00:49 +03:00
Dmitry Petrov 3d64c91375 PSI2IR KT-49053 skip fake overrides with unresolved types in signature 2021-10-06 16:23:08 +03:00