28 Commits

Author SHA1 Message Date
Ivan Kylchik 11fcfc2646 [IR] Drop usages of IrBuiltIns from interpreter's map generator 2023-06-01 13:01:24 +00:00
Ivan Kylchik fe538a6174 [IR] Rewrite generator for interpreter map
1. Reuse `DisabledIdSignatureDescriptor` to create `IrBuiltIns`
2. Provide FQ names for types to ensure method find correctness
2023-06-01 13:01:24 +00:00
Sergej Jaskiewicz a74df3b4b4 [IR] Store manglers used for signature computation in IrBackendInput
We will need them in signature dump tests later.
2023-05-04 14:58:06 +00:00
Ivan Kylchik e981b1f958 [Native] Support evaluation of const intrinsics for K2
#KT-56023
#KT-55469 Fixed
2023-03-24 15:55:03 +00:00
Alexander Udalov ae6d4d268d Use short copyright from COPYRIGHT_HEADER in generated files 2023-01-02 22:52:18 +01:00
Alexander Udalov 2d3f39d1f1 Minor, remove unneeded println in GenerateInterpreterMap 2023-01-02 22:50:06 +01:00
Ilya Gorbunov 800ff20fc7 Exclude rangeUntil operation from constant evaluation and interpretation #KT-52933 2022-08-24 22:22:54 +00:00
Ivan Kylchik f3252334b2 Move most of ir utils from backend.common to ir.tree 2022-05-18 21:20:03 +03:00
Ivan Kylchik 6a0802a1be Allow interpreting code extension property 2022-05-18 21:19:56 +03:00
Ivan Kylchik a1b45755f1 Evaluate range classes in interpreter if constructor's body is missing 2022-01-28 18:44:46 +00:00
Georgy Bronnikov 4d2bcf7e66 IR: compute file local signatures from descriptors 2022-01-27 01:02:16 +03:00
Ivan Kylchik b85a796492 Support interpretation for floorDiv and mod functions 2021-08-13 16:18:28 +03:00
Ilya Chernikov dee0487185 IR: Refactor IrBuiltIns to abstract it from descriptors 2021-07-16 02:24:18 +03:00
Roman Artemev 6cdac22a23 [IR] Introduce new IdSignatures
FileSignature, CompositeSignature, LocalSignature

They are needed to make possible reference any non-local declaration via
 signature, including private signature, type parameters and so on.

- Support those new signatures in proto and klibs
- Rename `isPublic` -> `isPubliclyVisible` due to changed semantic
- Fix FIR
- clean up code
2021-07-01 17:40:31 +03:00
Ivan Kylchik e5617ede7e Add Throwable class into interpreter builtins map
Methods of Throwable class doesn't have bodies using FIR, so they must
be handled as builtins
2021-06-07 15:35:07 +03:00
Ivan Kylchik 8234c9cec1 Add toString function with nullable receiver into builtins map
On JVM we don't have body for this function, so we must process it as
intrinsic or builtin
2021-06-07 15:35:06 +03:00
Ivan Kylchik 9a8e0f3fb3 Add new builtins methods for some interfaces into IrBuiltInsMapGenerated
This change allow us to skip looking for override when evaluate call
for some primitive.
2021-06-07 15:34:58 +03:00
Alexander Udalov e6254b51e1 Rewrite generator for IrBuiltInsMapGenerated
Similarly to 742fef9042 with OperationsMapGenerated, use optimized
`when` over strings instead of lambdas because lambdas lead to a lot of
bytecode.

The change in `IrConst.toPrimitive` is needed because for operations
like `Byte.plus(Int)` the IrConst instance would have the IR type for
kotlin.Byte, but the actual runtime value of type Int
(java.lang.Integer), which would lead to CCE from
`interpretBinaryFunction`. Previously it didn't fail because of
unchecked cast before calling the lambda, which allowed a value of
runtime type java.lang.Integer to sneak through to the lambda parameter
and be "unboxed" to the correct type via the `(... as Number).toByte()`
conversion which backend generates.

The main benefit of this change is that it reduces the size of the
proguarded compiler jar by ~0.69%.
2021-06-07 15:34:39 +03:00
Ivan Kylchik 96a090f2ab Implement LambdaProxy class 2021-06-07 15:34:04 +03:00
Ivan Kylchik 1d0acedc48 Rewrite Complex class as interface
This change allow ExceptionState to be both: State and Throwable
2021-06-07 15:34:03 +03:00
Ivan Kylchik 4c75576414 Implement basic proxy for Common state
For now proxy works only for Any class methods and only for Common
state.
2021-06-07 15:34:01 +03:00
Ilya Gorbunov e450a6494a Migrate deprecations in core, compiler, idea, tests
Replacing deprecated Char.toInt() with Char.code and
Number.toChar() with Number.toInt().toChar(), where Number is not Int.

KT-23451
2021-04-07 18:30:20 +03:00
Abduqodiri Qurbonzoda 968099fbec Advance deprecation level of FP to lesser than Int types to ERROR #KT-30360 2021-04-07 00:23:20 +03:00
Alexander Udalov addabae8d2 IR: move frontend-dependent code into implementations in psi2ir 2021-02-24 19:07:38 +01:00
Alexander Udalov d991a3e40f IR: simplify initialization cycle of TypeTranslator/ConstantValueGenerator 2021-02-24 19:07:38 +01:00
Alexander Udalov a21f273570 Fix compiler warnings in compiler code 2020-08-17 21:18:20 +02:00
Alexander Udalov db4cbe7103 IR: use IrFactory in SymbolTable 2020-07-28 12:05:23 +02:00
Ivan Kylchik 895c32e21c Create separate source set for interpreter map generator
A separate source set is needed so that the generator no longer depends
on the generated code
2020-06-25 10:45:19 +03:00