Alexander Udalov
907f53e539
Refactor ConstantValue implementations
...
Remove KotlinBuiltIns and take a ModuleDescriptor instance in getType
instead. This will allow to create constant values in contexts where
there's no module or built-ins accessible (such as, deserialization of
module annotations during indexing of .kotlin_module files in IDE).
Note that some values (KClassValue, EnumValue, AnnotationValue) still
take module-dependent objects (KotlinType, ClassDescriptor and
AnnotationDescriptor respectively). This is to be refactored later
2018-01-18 12:49:38 +01:00
Mikhael Bogdanov
b539adf105
Support simple capturing in IR inliner
2018-01-16 11:53:25 +01:00
Ilmir Usmanov
ed11528664
Ignore unreachable code on tail call optimization
...
#KT-21759: Fixed
2018-01-15 12:57:10 +03:00
Ilmir Usmanov
25998c1f9b
Reformat tail call optimization related code
2018-01-15 12:56:54 +03:00
Ilmir Usmanov
c023831a00
Ignore open modifier on top-level suspend function when generating light classes
...
#KT-21642: Fixed
2018-01-11 19:33:47 +03:00
Ilmir Usmanov
32a94c70e9
Use tail call optimization if ARETURN has multiple sources
...
#KT-21977: Fixed
2018-01-10 20:14:32 +03:00
Ilmir Usmanov
5dbab2f907
Disable tail call optimization, if the call is inside try block
...
#KT-21165: Fixed
2018-01-10 20:13:55 +03:00
Dmitry Petrov
5ffd6a737e
Closures in scripts have outer expression
...
#KT-22029 Fixed Target versions 1.2.30
2018-01-10 14:08:56 +03:00
Dmitry Petrov
d25ebadf53
Minor: formatting
2018-01-10 14:08:56 +03:00
Dmitry Jemerov
25ea53457e
Send source code in exceptions as attachments, not text (common cases)
...
#KT-17678 In Progress
2017-12-29 15:35:53 +01:00
Mikhael Bogdanov
ea5505f80c
Generate annotations in proper order in DefaultImpls
2017-12-22 10:02:04 +01:00
Mikhael Bogdanov
c9d0ab38cf
Generate proper java parameter names for DefaultImpls
...
#KT-21919 Fixed
2017-12-22 10:02:04 +01:00
Ilmir Usmanov
c8904b1c7c
Replace POP with ARETURN if it pops Unit and ARETURN shall return Unit
...
#KT-16880: Fixed
2017-12-21 18:08:39 +03:00
Mikhael Bogdanov
50608d0844
Don't delete nested default lambda classes during inline transformation
2017-12-21 12:52:29 +01:00
Mikhael Bogdanov
f4f7c83eeb
Copy nested objects of default lambda during inline
2017-12-21 12:52:28 +01:00
Mikhael Bogdanov
3513f1a86a
Properly process default lambda source mapping
...
#KT-21827 Fixed
2017-12-21 12:52:27 +01:00
Mikhael Bogdanov
665a697093
Support simple function inlining in ir
2017-12-20 10:48:43 +01:00
Mikhael Bogdanov
54dc828c8e
Rename ExpressionLambda to PsiExpressionLambda
2017-12-20 10:48:43 +01:00
Mikhael Bogdanov
0e2bd46124
Remove cycle check and resolvedCall from 'preformInline' method
2017-12-20 10:48:42 +01:00
Mikhael Bogdanov
3432014971
Add 'generateModule' method to CodegenFactory
2017-12-20 10:48:41 +01:00
Mikhael Bogdanov
819a3a95b3
Add support for contract feature in inliner
2017-12-19 16:11:39 +01:00
Dmitry Petrov
17b4d4a973
Differentiate accessors by FieldAccessorKind
...
Otherwise accessors for backing fields (as in '{ field }') clash with
accessors for properties (as in '{ prop }').
#KT-21258 Fixed Target versions 1.2.30
2017-12-18 16:15:52 +03:00
Denis Vnukov
52ccd67ec1
Remove duplicate parameter null checks in JvmStatic delegate methods.
...
Remove unnecessary non-null parameter checks inside static delegate methods
created for @JvmStatic companion object methods. Allows function generation
strategy decide if such checks need to be injected.
#KT-7188 Fixed
2017-12-14 13:48:50 +03:00
Dmitry Petrov
65b5cdbb8d
Maintain bounds evaluation order in intrinsics for 'reversed'
...
Makes sense for 'rangeTo', 'downTo', and 'until' with non-const bounds.
2017-12-14 10:41:51 +03:00
Dmitry Petrov
bf97b332cf
Support const-bounded for loop generation for reversed 'until'
2017-12-14 10:41:51 +03:00
Dmitry Petrov
54cceac99b
Intrinsics for 'reversed': until
2017-12-14 10:41:51 +03:00
Dmitry Petrov
5f7460a8c7
Support const-bound counter loop generation for 'downTo'
2017-12-14 10:41:51 +03:00
Dmitry Petrov
2f0df832c0
Minor: pull up helper methods for const-bounded for-in-range generation
2017-12-14 10:41:51 +03:00
Dmitry Petrov
a4c29b3587
Support Long and Char in const-bounded counter loop generation
...
If the loop end value is a compile-time constant (best we can do now),
and it is safe to iterate over a given range using "naive" for loop
(using '<=' or '>=' in loop condition),
generate such loops for Longs and Chars as well Ints (Bytes, Shorts).
2017-12-14 10:41:51 +03:00
Dmitry Petrov
df2b8d01d8
Extract common code in PrimitiveNumberRangeLiteralRangeValue
2017-12-14 10:41:51 +03:00
Dmitry Petrov
455a1c0f53
Intrinsics for 'reversed': downTo
...
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
64ba811b7f
Intrinsics for 'reversed': CharSequence.indices
...
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
7ba73c1635
Intrinsics for 'reversed': collection.indices
...
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
5bcbe25469
Intrinsics for 'reversed': array.indices
...
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
beff4a1b92
Intrinsics for 'reversed': support non-literal range expressions
...
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
1493805f8e
Take into account step sign in pre-condition for simple progression
...
So far, all non-end-inclusive progressions had step > 0.
With intrinsics for 'reversed' this will change.
2017-12-14 10:41:51 +03:00
Dmitry Petrov
821843e13f
Intrinsics for 'reversed': generate in-const-bound ranges as countable
...
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Dmitry Petrov
1775f294f4
Intrinsics for 'reversed': infrastructure & primitive range support
...
#KT-21323 In Progress
2017-12-14 10:41:51 +03:00
Mikhael Bogdanov
edefb45585
Copy sam wrappers during inline
...
#KT-21671 Fixed
2017-12-07 12:57:43 +01:00
Mikhael Bogdanov
4eb30b6626
Code clean
2017-12-07 12:57:42 +01:00
Denis Zharkov
ac56965a99
Do not force loading all kt-files inside LazyPackageDescriptor constructor
...
Effectively it leads to all stubs being built for any once used package
The idea is that they only were used for FILE_TO_PACKAGE_FRAGMENT
that is mostly read in backend and rarely in the IDE, so we can replace
its usages with searching through related package-fragments
2017-12-07 12:53:33 +03:00
Dmitry Petrov
04ab3e1519
Use ForInSimpleProgressionLoopGenerator for most of the loop intrinsics
2017-12-07 11:36:20 +03:00
Dmitry Petrov
6b6ae2f7d7
Minor: formatting
2017-12-07 11:36:20 +03:00
Dmitry Petrov
75315a4edb
Replace BoundedValue objects in 'indices' with SimpleBoundedValue
2017-12-07 11:36:20 +03:00
Mikhail Zarechenskiy
7f0cca52ca
[NI] Use definitely not-null types for smartcasts
2017-12-06 18:36:13 +03:00
Dmitry Petrov
e4ecc13e13
Generate for-in-array loops with proper semantics in 1.3+
...
In Kotlin 1.3+, assignment to the for-in-array loop range variable in
the loop body doesn't affect loop execution (as if it was a loop on an
array iterator, or some other container).
#KT-21354 In Progress
#KT-21321 In Progress
2017-12-05 15:45:20 +03:00
Dmitry Petrov
0db6e5c3f3
Fix SAM wrapper generation in secondary constructor calls
...
Should simply invoke 'checkSamCall' in corresponding visitor method to
check if call arguments should be wrapped.
2017-12-04 10:29:33 +03:00
Yan Zhulanow
2819fc718a
Parcelable: Migrate to canonical NEW-DUP-INVOKESPECIAL form (KT-20545)
2017-12-01 22:53:20 +09:00
Dmitry Petrov
d976eeabf7
Refactor GenerationState creation
2017-11-29 12:17:06 +03:00
Dmitry Petrov
5b8c0d4c3e
Optimize for-in-string loops
...
For-in-string loop can be generated using specialized 'length' and
'charAt' method calls, and with cached string length.
Note that update of the string variable in loop body doesn't affect
loop execution semantics.
#KT-21322 Fixed Target versions 1.2.20
2017-11-29 10:15:38 +03:00