Commit Graph

65 Commits

Author SHA1 Message Date
Denis Zharkov
01ff975cc0 Minor. Update tests on coroutines 2016-12-16 13:27:11 +03:00
Stanislav Erokhin
b527a4d158 Global rename in test data for coroutines
(cherry picked from commit 132f97b)
2016-12-15 23:58:26 +03:00
Denis Zharkov
845e116aa9 Update bytecodeText and bytecodeListing tests on coroutines 2016-12-15 23:58:00 +03:00
Yan Zhulanow
e31a39386e Minor: Fix testDeprecatedJvmOverloads test (Kotlin runtime is not enabled by default now in bytecode listing tests) 2016-12-05 19:58:06 +03:00
Yan Zhulanow
328286ab14 Use box tests to check if the light analysis mode (without analyzing bodies when possible) produces the same result as the complete analysis. See also the next commit in which light analysis mode is applied. Note that no tests were changed. 2016-12-05 19:57:47 +03:00
Denis Zharkov
fcd9ee037e Support coroutines stack-unwinding in JVM backend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov
1f98accad2 Support new suspend convention in JVM backend partially
Stack-unwinding does not work yet

 #KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Dmitry Petrov
3dd0c9d1c7 Equality comparison for bound callable references takes into account bound receiver.
Fixed KT-14939: use expected receiver type when generating receiver code in get/set methods for bound property references.
Otherwise we have VerifyError for bound receiver 'null' of type 'Nothing?', which is mapped to 'java.lang.Void'.

TODO: proper equality comparison for property accessors ('x::prop.getter', 'x::prop.setter').
2016-11-25 14:49:24 +03:00
Dmitry Jemerov
a57748f4f4 @JvmOverloads-generated overloads of final methods are also final; test to verify that overloads of deprecated methods are deprecated 2016-11-18 11:05:03 +01:00
Denis Zharkov
bd5c08f598 Make fields for storing lambda parameters non-final
Because they get assigned within `invoke` call that contradicts with JVM spec
where it's told that they must not be assigned outside of constructors
2016-11-09 12:25:31 +03:00
Denis Zharkov
e54b466010 Make fields representing variables in coroutines non-volatile
#KT-14636 Fixed
2016-11-09 12:25:31 +03:00
Denis Zharkov
dfb9b323ff Avoid generation of redundant abstract special stubs
#KT-13698 Fixed
2016-10-07 11:59:15 +03:00
Denis Zharkov
6e838f0adc Avoid generation of redundant toArray stubs
#KT-13698 In Progress
2016-10-07 11:59:15 +03:00
Denis Zharkov
e05e0ec921 Optimize method count for collection stubs
Do not generate stubs if they're already present in superclasses

 #KT-13698 In Progress
2016-10-07 11:59:15 +03:00
Denis Zharkov
8ee568105c Do not generate collection stubs for Kotlin-specific signatures
#KT-14188 Fixed
2016-10-07 11:59:15 +03:00
Michael Bogdanov
ca41f01468 Generate interface property annotations in interface class (not in DefaultImpls) 2016-10-03 13:50:12 +03:00
Denis Zharkov
217f033552 Prevent generation of delegations to interfaces private methods
#KT-13381 Fixed
 #KT-13996 Fixed
2016-09-23 14:51:14 +03:00
Alexander Udalov
91e486d020 Fix KCallable#name intrinsic for bound references
Do not skip generation of the left-hand side because it may produce side
effects

 #KT-12995 Fixed
2016-07-26 13:48:20 +03:00
Denis Zharkov
84eb009c29 Refine stubs generation for special built-ins
Do not generate stub if declaration has the same signature

 #KT-12909 Fixed
2016-06-30 20:12:34 +03:00
Denis Zharkov
5c34b27ea9 Fix stub generation for special built-ins
Do not generate stubs if there is no special bridge in the current class
- there are already Kotlin super class in hierarchy
- special bridge has the same signature as method itself

 #KT-11915 Fixed
2016-06-30 20:12:34 +03:00
Denis Zharkov
2578fc3344 Do not generate mutable collection stub methods in interfaces
#KT-12359 Fixed
2016-06-24 16:37:19 +03:00
Denis Zharkov
1780f57265 Fix mutable collection stub methods generation for corner case
The problem is that
`override fun remove(element: E): CollectionWithRemove<E>`
seems to be illegal from Java's point of view, while it's OK for JVM

These declarations have the same signature (return type is isgnored)
- override fun remove(element: E): CollectionWithRemove<E>
- override fun remove(element: E): Boolean

When we meet such declaration we choose random declaration for fake override in synthetic class
that may lead to signature clash
2016-06-24 16:37:19 +03:00
Alexander Udalov
2200bfcc85 Simplify ImplementationBodyCodegen#generateToArray
- don't do anything for interfaces because there's no point in generating
  abstract methods which are already abstract in supertypes
- don't use getDeclaredFunctionByRawSignature, check function signature
  manually instead
- don't use isOrOverridesSynthesized because 'toArray' is never synthesized
2016-05-20 00:54:18 +03:00
Alexander Udalov
b208995d73 Render different class kinds differently in bytecode listing test 2016-05-20 00:36:56 +03:00
Kirill Rakhman
4a619db721 Add intrinsic for KCallable.name property Fixes #KT-11531 2016-04-28 23:03:00 +03:00
Dmitry Petrov
583733be8d KT-11645 properly handle private property getter name mangling in reflection 2016-04-14 09:31:29 +03:00
Dmitry Petrov
db58ebc4b2 KT-11410: Class hierarchy for parts/facade of multi-file class.
Preserve static initialization semantics for parts by introducing a special "clinit trigger" class.
Insert "static initialization trigger" call to every method of a part class, remove this call on inline.
Always mangle names for private functions in multifile class parts to avoid resolution clashes on inheritance.

NB in codegen tests initializers for all non-const vals are wrapped in 'run { ... }',
so that the initializer is not a constant expression, and some static initialization code should be generated.
2016-04-01 10:13:22 +03:00
Michael Bogdanov
6547fa1d4c Replace hashes in bytecode listing tests with 'HASH' 2016-03-24 16:17:58 +01:00
Michael Bogdanov
d0aac74e72 Fix for KT-11590: IllegalAccessError: SAM adapter generated with invalid accessibility for inline function
#KT-11590 Fixed
2016-03-24 14:11:25 +01:00
Alexander Udalov
994dc46bcd Write nullability annotations on extension receiver parameters
#KT-5429 Fixed
2016-03-11 15:20:32 +03:00
Denis Zharkov
12552d2fc1 Refine special bridges generation
#KT-10958 Fixed
2016-02-10 20:18:46 +03:00
Alexander Udalov
9f786c00a7 Fix test data after removing old annotation classes 2016-02-07 10:03:19 +05:30
Alexander Udalov
5de1cf3bb4 Do not write old metadata annotations to bytecode 2016-02-06 15:53:55 +05:30
Denis Zharkov
16f412f993 Generate multi-files facade even if it's empty
It still contains useful information about it's parts,
that may be used while building stubs for multi-file group
containing only InlineOnly functions
2016-02-05 15:02:24 +03:00
Denis Zharkov
889b136a68 Refine multi-file facades generation
Do not generate delegation from multi-file facade to inline-only functions
because they are effectively private in bytecode

 #KT-10858 Fixed
2016-02-05 15:02:24 +03:00
Mikhail Glukhikh
84100abd9e Annotations on object literals are now correctly resolved #KT-9320 Fixed 2016-02-01 16:24:57 +03:00
Denis Zharkov
ad24092fd1 Move InlineOnly to kotlin.internal package 2016-01-21 11:26:01 +03:00
Alexander Udalov
aef6d49b48 Drop isLocalClass, do not write KotlinLocalClass 2016-01-19 18:39:59 +03:00
Alexander Udalov
e37bd4eba6 Do not write and read KotlinInterfaceDefaultImpls
This was only used in InlineTestUtil.kt and had no effect in the condition
2016-01-19 18:39:59 +03:00
Alexander Udalov
59dab0a558 Combine all metadata annotations into one kotlin/Metadata 2016-01-19 18:39:59 +03:00
Mikhail Glukhikh
e4f7446bec JvmSynthetic forbidden for delegated properties (and searched for different use-site targets) 2016-01-19 11:38:53 +03:00
Mikhail Glukhikh
b78d481bb1 delegate use-site targeted annotations: parser, front-end, codegen with some tests #KT-10502 Fixed 2016-01-19 11:38:41 +03:00
Denis Zharkov
be2f857670 Introduce inline-only functions
They have private visibility in bytecode
2016-01-15 09:46:30 +03:00
Mikhail Glukhikh
3fb04aceb9 Check backing field availability for AnnotationTarget.FIELD #KT-10387 Fixed
Some duplicated checks deleted (UseSiteTargetChecker / JvmFieldApplicabilityChecker)
2015-12-17 15:06:58 +03:00
Natalia Ukhorskaya
67dd97b918 Mark bridge methods in lambdas classes as synthetic
#KT-10101 Fixed
2015-11-26 11:39:19 +03:00
Yan Zhulanow
3475b4796f Do not generate DefaultImpls if empty 2015-10-26 20:37:31 +03:00
Michael Bogdanov
c8c3e88c82 Make top-level property backing field private in bytecode 2015-10-19 19:09:30 +03:00
Dmitry Petrov
621d26aeeb Drop package facades: fix incremental compilation tests & proto comparison tests
(package facades are no longer generated)
2015-10-19 16:03:21 +03:00
Dmitry Petrov
3502c393fc Drop package facades: JVM BE tests passed. 2015-10-19 16:03:16 +03:00
Yan Zhulanow
9699708fb8 Do not put inapplicable annotations on getter 2015-10-16 22:19:33 +03:00