Commit Graph

1834 Commits

Author SHA1 Message Date
Michael Bogdanov ff820bddc0 New source mapping 2016-04-20 17:07:06 +03:00
Dmitry Petrov e441f0509f KT-11943 Do not use intrinsic 'java' property if receiver type is not acceptable 2016-04-19 10:31:30 +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 511a7e0072 KT-11645 generate backing field for 'private const val' in part implementation class 2016-04-14 09:31:29 +03:00
Michael Bogdanov be999ca4cb Write proper start label for parameters of inline function default implementation 2016-04-12 15:31:49 +03:00
Michael Bogdanov c52c0e2c2d Write proper start label for inlined constructor parameters (start label was shifted by additional captured parameters injection) 2016-04-12 15:23:14 +03:00
Dmitry Petrov aca7050656 KT-11499 Normalize stacks on return from an inline function when the function is inlined at call site. 2016-04-08 14:52:55 +03:00
Michael Bogdanov a6044c81ff Write proper start label for loop parameter 2016-04-08 14:32:51 +03:00
Dmitry Petrov f1b061d662 Optimize coercion to Unit.
POP operations are backward-propagated.

Operation can't be transformed if its result is moved within stack
(by DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, or SWAP).

Unnecessary operations are replaced with NOPs (for debugger).
Unnecessary NOPs are removed.

KT-9922 Suboptimal generation for simple safe call with unused return value
KT-11116 Optimize methods returning Unit
2016-04-07 11:40:58 +03:00
Alexander Udalov c4a568efff Minor, add test cases for obsolete protected-related issues 2016-04-07 00:07:11 +03:00
Alexey Andreev 05887f45f7 KT-7819 Implement non-local returns 2016-04-06 16:16:55 +03:00
Alexey Andreev a6e1bd1d89 KT-7819 Borrow tests for non-local returns from JVM backend 2016-04-06 16:16:55 +03:00
Michael Bogdanov dec53c8d6c Fix for KT-11762: "VerifyError: Bad local variable type" caused by explicit loop variable type
#KT-11762 Fixed
2016-04-05 13:37:10 +03:00
Michael Bogdanov e0adfd453f Fix for KT-11677: Generic type signatures for local classes in inlined lambdas are not written properly
#KT-11677 Fixed
2016-04-04 12:07:47 +03:00
Michael Bogdanov f5166b7aef Support test directives in inline tests 2016-04-04 12:07:46 +03:00
Dmitry Petrov 1d87595dc9 binary compat validator: update testData for changes related to new facade generation 2016-04-01 10:13:22 +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
Denis Zharkov 1511a03027 Fix SAM adapters substitution
Approximate sourceFunction types if it's needed

 #KT-11696 Fixed
2016-03-31 14:52:12 +03:00
Mikhail Glukhikh 4c03aaabd4 Implicit nothing / intersection types are now checked also for member functions #KT-11666 Fixed 2016-03-31 11:59:17 +03:00
Mikhail Glukhikh b7e8f71367 Fix of getCorrespondingLoop for complex loop / try-finally trees #KT-8246 Fixed 2016-03-30 18:49:23 +03:00
Alexander Udalov 4a533168d9 Rework const val generation in multifile classes
Do not query MultifileClassCodegen#classBuilder early on: this causes the class
file for the facade to be prematurely dumped to the disk in some cases, when
that class file is not yet completely generated. Instead fork the logic in
PropertyCodegen#generateSyntheticMethodIfNeeded: save metadata in parts,
generate method in the facade
2016-03-29 17:53:32 +03:00
Ilya Gorbunov 768da05ba9 Update dump declaration mappings tests to reflect new constant generation in multifile facades. 2016-03-29 14:34:32 +03:00
Ilya Gorbunov 25abdf9fdb Tests for declaration mappings dumping from compiler 2016-03-29 13:49:36 +03:00
Alexander Udalov a8bebeb48d Load annotations of const properties from multifile classes
Rework backing field generation logic in PropertyCodegen to switch the
ClassBuilder instance for a multifile part to that of the corresponding facade
class. This became needed because multifile parts, and their metadata, are
generated _before_ the multifile facade class and otherwise we would never
record that there's a synthetic '$annotations' method for a const val and would
not write that to the protobuf message for the property.

See also bad83200

 #KT-10892 Fixed
2016-03-28 21:11:14 +03:00
Alexander Udalov 6924d883eb Support reflection calls to multifile class members
#KT-11447 Fixed
2016-03-28 21:11:14 +03:00
Michael Bogdanov 6547fa1d4c Replace hashes in bytecode listing tests with 'HASH' 2016-03-24 16:17:58 +01:00
Michael Bogdanov 6737bc12f1 Fix for KT-11519: Version 1.0.1 fails with NPE in com.sun.beans.TypeResolver.resolve() where v1.0.0 works fine
#KT-11519 Fixed
2016-03-24 15:18:31 +01:00
Michael Bogdanov 0fdba49315 Test for KT-11514: Platform Double is converted to Int when comparing to Int literal
#KT-11514 Fixed
2016-03-24 14:11:25 +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
Michael Bogdanov a851bb0fff Fix for KT-11584: Regression in 1.0.1: incorrect comparison of Long! with integer constant
#KT-11584 Fixed
2016-03-24 08:51:43 +01:00
Alexander Udalov 348125acb3 Fix visibility of protected classes in bytecode
Protected should be translated to public as in Java so that everything would
work at runtime. The real visibility is still saved to an InnerClasses
attribute

 #KT-8269 Fixed
 #KT-9246 Fixed
 #KT-10143 Fixed
2016-03-22 18:42:34 +03:00
Michael Bogdanov 00cb2705da Add a test verifying anonymous object transform is performed correctly with ClassBuilder. 2016-03-21 18:37:28 +03:00
Denis Zharkov e54b25a35a Fix StackOverflowError while mapping recursive intersection-type
#KT-10972 Fixed
2016-03-18 19:07:27 +03:00
Michael Bogdanov c3d450f050 Fix for KT-11479: 1.0.2 Snapshot: CompilationException: Back-end (JVM) Internal error: Couldn't inline method call
#KT-11479 Fixed
2016-03-18 15:43:18 +01:00
Michael Bogdanov b95e27fd87 Fix for KT-11478: "Couldn't inline method call" error
#KT-11478 Fixed
2016-03-18 11:07:47 +01:00
Denis Zharkov ce8add2802 Fix common supertype calculation
Use star-projections instead of 'out Any?' in corner cases

 #KT-11468 Fixed
2016-03-18 10:12:00 +03:00
Michael Bogdanov bec6126b06 Support when mapping transformation on inlining 2016-03-14 11:24:39 +03:00
Alexander Udalov 994dc46bcd Write nullability annotations on extension receiver parameters
#KT-5429 Fixed
2016-03-11 15:20:32 +03:00
Michael Bogdanov 1a5bf33190 Fix for KT-11034: Private set with @JvmStatic lateinit var doesn't compile
#KT-11034 Fixed
2016-03-10 10:17:27 +03:00
Alexander Udalov eef3631b8a Improve toString() for lambdas and function expressions
#KT-9952 Fixed
2016-03-09 10:49:26 +03:00
Alexander Udalov bab127ad33 Remove some legacy codegen tests, move some to generated 2016-03-09 10:25:38 +03:00
Alexander Udalov f8dfaf4599 Merge boxWithJava testData into box, delete BoxWithJava test 2016-03-09 10:25:38 +03:00
Alexander Udalov 16a0ddd2fb Merge boxMultiFile testData into box, delete BoxMultiFile test 2016-03-09 10:25:38 +03:00
Alexander Udalov 06a67e6602 Merge boxWithStdlib testData into box, delete BoxWithStdlib test 2016-03-09 10:25:38 +03:00
Alexander Udalov 22bfc9786a Add WITH_RUNTIME or WITH_REFLECT to boxWithStdlib testData 2016-03-09 10:25:38 +03:00
Alexander Udalov 2564a2f91f Do not include kotlin-reflect at runtime by default in codegen tests
Change some tests to either include reflection or to avoid using it
2016-03-09 10:25:38 +03:00
Alexander Udalov 20e36438e2 Move some tests from boxWithStdlib/ to box/
Move those tests which do not require neither stdlib nor reflect
2016-03-09 10:25:38 +03:00
Denis Zharkov 68f411395a Fix bridge generation for special builtin override
Use method itself signature as common bridge delegate

 #KT-11285 Fixed
2016-03-07 09:26:02 +03:00
Dmitry Petrov 3bbd8979e4 KT-9670: optimize Class <-> KClass wrapping/unwrapping as a special case of boxing/unboxing.
NB doesn't work for arrays of classes.
2016-03-04 10:14:21 +03:00
Alexander Udalov 04eea69a82 Fix Java 8 codegen box tests 2016-03-03 17:08:47 +03:00