Commit Graph

219 Commits

Author SHA1 Message Date
Jinseong Jeon 078cf02c8a FIR: Provide dispatch receiver for 'field' according to property type 2020-03-30 16:57:53 +03:00
Mikhail Glukhikh 810b607a65 [FIR2IR] Provide receivers also for property callable references 2020-03-30 16:23:10 +03:00
Juan Chen d8539fdde9 [FIR2IR] Add dispatch & extension receivers to callable references 2020-03-30 16:23:10 +03:00
Jinseong Jeon de0c9a5c73 FIR: use dispatch receiver of the enclosing function if any. 2020-03-25 08:27:21 +03:00
simon.ogorodnik f83c20065d [FIR-test] Unmute passing tests, mostly fir2ir 2020-03-24 18:58:19 +03:00
Mikhail Glukhikh 0f0e5e603d [FIR2IR] Use IR built-in types, their symbols & constructors directly 2020-03-18 17:09:36 +03:00
Dmitry Petrov ade18d144a KT-36810 Implement javaPrimitiveType intrinsic in JVM_IR 2020-03-17 22:56:45 +03:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh cfa626ad77 FIR2IR: introduce conversion scope, remove dispatch receiver for lambdas 2020-03-04 16:55:31 +03:00
Dmitry Petrov 03913ff029 KT-33119 Generate IINC for primitive types only 2020-02-28 23:20:02 +03:00
Steven Schäfer 4ac45eb38b JVM IR: Fix inline class constructors taking default values of inline class type. 2020-02-28 17:11:59 +01:00
Steven Schäfer b173284d1d Add tests for super calls in inline classes 2020-02-28 14:48:17 +01:00
Steven Schäfer 0fe8fec1d1 Mute FIR tests 2020-02-28 14:48:17 +01:00
Roman Artemev e57d34dd9e Make fix test:
- [JS IR] Unmute fixed tests
 - [IrText] Update testdata
 - [WASM] Temporary turn wasm test off
 - [FirText] Temporary turn fit text tests off
 - [JVM IR] Turn off klib jvm test
 - [IR] Add new test
2020-02-14 18:22:17 +03:00
Roman Artemev 5004bb3636 [Psi2Ir] Fix generation of hashcode for generic inline class 2020-02-14 18:22:16 +03:00
Mikhail Glukhikh 12c001f491 FIR: unmute two additional black-box tests 2020-02-11 23:14:51 +03:00
Steven Schäfer 07737f8fc6 JVM IR: Fix BridgeLowering 2020-02-07 18:44:50 +03:00
Steven Schäfer 5f6af58aeb JVM IR: (Un)mute tests and add more tests for bridge generation 2020-02-07 18:44:50 +03:00
Steven Schäfer 66cbe3b1a8 JVM IR: Remove IrReplacementFunction 2020-02-07 18:44:50 +03:00
Mikhail Zarechenskiy b7c43fc7db Refactoring: move test folder out of "inline classes" folder
It was added there by mistake
2020-01-17 19:36:08 +03:00
Mikhail Zarechenskiy 0ee977c42e FIC: Support base version of conversions in JVM backend
Proper support for JVM backend will be in the further commmits
2020-01-17 19:36:02 +03:00
Mikhail Zarechenskiy 55935cc98a FIC: introduce language feature, modifiers checks and basic tests 2020-01-17 19:36:00 +03:00
Ilya Gorbunov 0f6df5971b Mute tests failing in JS_IR backend due to KT-35944 2020-01-16 15:36:16 +03:00
Alexander Udalov 957b100cd1 JVM IR: do not generate hidden constructor for inline classes more than once
SyntheticAccessorLowering was initially implemented under the assumption
that any access to an invisible declaration will cause an accessor to be
generated _in the same file_. Moreover, it's declared in the group of
phases that are performed by file.

But this assumption is incorrect for constructors which need to be
hidden (those which take parameters of inline class types), since such
constructor is public and can be called from anywhere. In this case,
SyntheticAccessorLowering actually generated a new accessor for the
hidden constructor for each (!) source file where that constructor is
called, which led to ClassFormatError because of the class file having
multiple methods with the same signature. The internal `functionMap`
cache didn't help because it's not shared among phase instances for
different files (well, it helped to generate not more than one accessor
per usage-file).

In this change, we use the global cache, stored in JvmBackendContext,
for accessors to hidden constructors. Note that after this change, calls
to hidden constructors are always transformed to the corresponding
accessor in SyntheticAccessorLowering right away, but that accessor
might be orphaned for a while (not declared in any parent's
declarations). Only when SyntheticAccessorLowering encounters the
original constructor which needs to be hidden, it adds the accessor
beside it.

The test is sensitive to the file order, so both variants are added.
2020-01-10 13:49:05 +01:00
Juan Chen 573188bdc4 [FIR2IR]: fix translation of this references in instance methods
Currently FirThisReceiverExpression of instance methods are translated
to references of the class' thisReceiver,
not the method's dispatch receiver,
which causes problems with IrFrameMap::typeOf,
as the class' thisReceiver is not in the typeMap.

This commit translates non-qualified "this" references of
instance methods to references of the methods' dispatch receiver.
2020-01-10 10:43:07 +03:00
Mads Ager 4e4e57f60a JVM_IR: deal with inline class default values in AddContinuationLowering.
Whenever we want the default 0/null value for a type we need to
check if it is a non-nullable inline class type and produce
the right value for the underlying type.
2020-01-09 18:05:28 +01:00
Mikhail Glukhikh 15f373a864 FIR2IR: support object receiver case (this fixes 24 black box tests) 2019-12-27 13:46:05 +03:00
pyos 982a088f00 JVM_IR: do not copy defaults in functions with inline class parameters 2019-12-24 18:59:33 +03:00
Alexander Udalov f869be6a71 JVM IR: do not mangle synthetic methods with inline class parameters
For example, synthetic `$annotations` methods for properties were
previously mangled to `$annotations-...`, which breaks annotation
loader, and fails an assert in ClassCodegen.generateMethod.
2019-12-03 11:34:55 +01:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Alexander Udalov 0675b54e11 Minor, add regression test for KT-34766 2019-11-08 12:29:08 +01:00
Steven Schäfer 4878c7967a JVM: Handle inline class equality in when statement with declaration
#KT-34268 Fixed
2019-10-16 19:23:49 +02:00
pyos 06c00f4d9e Unmute some JVM_IR inlining tests 2019-10-08 17:19:41 +02:00
Steven Schäfer e25a09f2f9 JVM IR: Fix local delegated properties with inline class types 2019-10-07 17:12:30 +02:00
Steven Schäfer 217f681b6e JVM IR: Use WrappedClassDescriptor in class builder. 2019-10-02 08:29:22 +02:00
Steven Schäfer ce3ef4e4d0 Add more tests for inline class equality with nullable arguments 2019-09-18 18:52:58 +02:00
Steven Schäfer d8646e29b7 Add additional Result api test 2019-09-18 18:52:58 +02:00
Steven Schäfer b85b2d9af8 Add more tests for inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer cdc5e1347b JVM: Avoid boxing in inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer f53b28e8a3 JVM: Generate equals-impl0 method for inline classes 2019-09-18 18:52:58 +02:00
Steven Schäfer 2c7da67600 JVM IR: Avoid boxing in inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer b85a475358 JVM IR: Generate equals-impl0 method for inline classes 2019-09-18 18:52:58 +02:00
Steven Schäfer cdd3f82396 JVM IR: Use correct scope owner in JvmInlineClassLowering 2019-09-18 18:52:58 +02:00
Steven Schäfer 102a3d60e0 IR: Consistently copyAttributes in DeepCopyIrTreeWithSymbols
This was missing for IrFunctionReferences, which caused problems when
copying default parameters before CallableReferenceLowering in the
JVM_IR backend.
2019-09-02 19:55:36 +02:00
Mikhail Zarechenskiy 80acc56c10 Don't lost type parameters for members of inline classes in the bytecode
#KT-33157 Fixed
2019-08-06 17:53:08 +03:00
Ilya Gorbunov 2e445ebad6 Enable test that uses Array.fill in JS and Native 2019-08-01 19:02:39 +03:00
Steven Schäfer 078ccbf077 JVM_IR: Implement name mangling exceptions for Result class. 2019-07-01 15:49:12 +02:00
Steven Schäfer d458e4a7b2 JVM_IR: Enable inlining for external declarations with inline class parameters. 2019-07-01 15:49:12 +02:00
Mikhael Bogdanov 9b6fef005f Simplify LocalDeclarationsLowering, support declaration pop up via separate lower
1. Scheme of capturing local variables not touched
 2. Lowered local functions are transposed to the nearest class (including local) or file
 3. Local classes are also transpose to the nearest class (including local) or file
2019-06-27 08:07:01 +02:00
Steven Schäfer 917ef250cf Add and (un)mute inline class tests 2019-06-13 12:25:06 +02:00