Commit Graph

1227 Commits

Author SHA1 Message Date
Evgeny Gerashchenko 7660ae7f20 Simplified code. 2013-06-27 17:09:15 +04:00
Mikhael Bogdanov 8cd1880805 KT-3722: Write correct generic type information for generated fields
#KT-3722 Fixed
2013-06-27 15:59:48 +04:00
Evgeny Gerashchenko b77fbf37b6 Using more specific class. 2013-06-25 20:17:47 +04:00
Evgeny Gerashchenko 104f15adc4 Moved Java-related keys to JavaBindingContext. 2013-06-25 20:17:47 +04:00
Evgeny Gerashchenko 63c17bd0b2 Green code. 2013-06-25 20:17:43 +04:00
Evgeny Gerashchenko ee9fcff9ca Supported non-literal arguments for SAM adapters. 2013-06-25 20:17:42 +04:00
Evgeny Gerashchenko 2e2061d9b6 Clarified comment. 2013-06-25 20:17:41 +04:00
Evgeny Gerashchenko be02943675 Considering SAM interface FQ name in hash. 2013-06-25 20:17:41 +04:00
Evgeny Gerashchenko 7ef4c8cfa8 Generating SAM wrapper class per source file. 2013-06-25 20:17:41 +04:00
Evgeny Gerashchenko 0fbf203ff7 Extracted method. 2013-06-25 20:16:21 +04:00
Evgeny Gerashchenko 7d514bf081 Simplified code. 2013-06-25 20:16:21 +04:00
Evgeny Gerashchenko 8a9ec0f3ce Added comment. 2013-06-25 20:16:21 +04:00
Evgeny Gerashchenko ba2dae4db7 Removed obsolete comment. 2013-06-25 20:16:21 +04:00
Evgeny Gerashchenko 0f067f042f Using more specific class. 2013-06-25 20:16:21 +04:00
Evgeny Gerashchenko fe77c3edb9 Replaced signed decimal with hex. Eliminated querying canonical path. 2013-06-25 20:16:21 +04:00
Evgeny Gerashchenko e8d0022406 Typo. 2013-06-25 20:16:20 +04:00
Evgeny Gerashchenko 4980dacd33 Supported calls of SAM adapters for constructors. 2013-06-25 20:16:20 +04:00
Evgeny Gerashchenko 5e2c3fcb50 Loading SAM adapters for constructors. 2013-06-25 20:16:20 +04:00
Alexander Udalov fea85476b7 Cast int to byte/short/char in for loop generation
Similar to the previous commit, don't use iinc or iadd+istore where the value
can overflow the byte/short/char limits. This fixes Android tests
2013-06-25 18:48:28 +04:00
Alexander Udalov 356c32893b Don't use 'iinc' instruction on byte/short/char variables
Android run-time verifier complains when there's any possibility that a
byte/short/char local variable could contain a value not fitting into the
type's limits.
2013-06-25 18:48:28 +04:00
Alexander Udalov 9a6979aa6c Minor, rename method 2013-06-20 22:23:02 +04:00
Alexander Udalov 53cc582040 Minor, use incrementType in for-progression codegen
This doesn't fix anything, just makes it easier to figure out values of what
types are used where. Progression increment is of its own type, which may be
different from asmElementType in case of Byte, Char, Short progressions
2013-06-20 22:23:02 +04:00
Alexander Udalov d85ca47184 Generate optimized bytecode for 'for' in progression
Instead of checking for overflow at the end of each iteration, calculate the
actual final loop parameter value before the loop, save it to the local
variable and at the end of the iteration check if the loop parameter is exactly
equal to this final value.

ProgressionUtil.getProgressionFinalElement() credits go to @geevee
2013-06-20 20:19:54 +04:00
Alexander Udalov 8a14b62a23 KT-3574 Assertion error when using ?: in for range
#KT-3574 Fixed

Do not assert that resolvedCall is non-null, since getRangeAsBinaryCall can
return a BinaryCall that doesn't represent a range at all (as specified by the
comment in getRangeAsBinaryCall)
2013-06-20 16:03:00 +04:00
Alexander Udalov e22947281c Minor, cut down unnecessary 'load' in for-progression codegen 2013-06-20 16:03:00 +04:00
Alexander Udalov ee80e0b8ca Fix loops over progressions near to MAX_VALUE/MIN_VALUE
#KT-492 Fixed

For Byte, Char and Short ranges, promote the type of the loop parameter to int
to avoid overflows. For Int and Long ranges at the end of the loop over a
progression we now check if the new (incremented) value of the loop parameter
is greater than the old value iff increment > 0
2013-06-20 16:03:00 +04:00
Alexander Udalov 33d6347876 Fix loop over a range literal up to MAX_VALUE
#KT-492 In Progress

For Byte, Char and Short explicit casting from Int is removed -- loop parameter
is already stored in an Int anyway. For Int and Long comparison "i < end" at
the beginning of the loop is replaced to "i != end" at the end of the loop + a
special check for an empty loop
2013-06-20 16:02:59 +04:00
Mikhael Bogdanov 132d74200b Partial fix for KT-3698: properly write field initializer 2013-06-19 17:02:28 +04:00
Mikhael Bogdanov 79cf02ffb9 Fix for KT-3546: Exception when delegating to ArrayList
#KT-3546 Fixed
2013-06-18 13:23:54 +04:00
Mikhael Bogdanov aec6deae9f Rename fields on name clashing
#KT-3663 Fixed
 #KT-3664 Fixed
2013-06-17 15:20:42 +04:00
Mikhael Bogdanov 406f90badf CodegenContext replaced with MethodContext in ExpressionCodegen 2013-06-17 15:20:42 +04:00
Mikhael Bogdanov be72e096ef Realization of class object fields as static fields of outer class
#KT-2213 Fixed
2013-06-17 15:20:41 +04:00
Mikhael Bogdanov 47fe81471a Synthetic accessors for class object private members
#KT-3338 Fixed
2013-06-17 15:20:34 +04:00
Mikhael Bogdanov e96cf045dd KT-3652: Char is converted to Int when used inside string interpolation
#KT-3652 Fixed
2013-05-27 19:33:49 +04:00
Evgeny Gerashchenko 43b9a9d434 Renamed Name.getName() and FqName.getFqName() to asString() 2013-05-21 17:56:05 +04:00
Andrey Breslav a2b82095da Using the version of ASM that has debug information in it
No more need for extra ASM jars (analysis and util)
2013-05-21 13:56:34 +04:00
Natalia.Ukhorskaya a5f1a8b3f8 TypeCastException when casting null to T with nullable upper-bound
#KT-3637 Fixed
2013-05-21 13:21:52 +04:00
Alexey Sedunov 033e82666d Extract method for else branch check in when expression 2013-05-15 12:57:32 +04:00
Natalia.Ukhorskaya 32c5f5f59d EA-46019 - assert: PropertyCodegen.generatePropertyDelegateAccess: delegate type can be null when delegate expression is unresolved and back-end called from light class generation 2013-05-14 15:38:49 +04:00
Natalia.Ukhorskaya 9e584ded11 ClassFormatError because of initializing variable with Any type with primitive value
#KT-3524 Fixed
2013-05-14 15:38:42 +04:00
Mikhael Bogdanov 6da8ba3fec Default function generation refactoring 2013-05-08 16:13:53 +04:00
Mikhael Bogdanov 702dadccf4 CodegenContext replaced by more specific MethodContext in method generation, mapToCallableMethod call replaced by mapSignature for method header generation 2013-05-08 16:11:17 +04:00
Evgeny Gerashchenko 516a5b76e8 Fixed calling inherited SAM adapter. 2013-05-06 16:45:36 +04:00
Mikhael Bogdanov 22ddd05e09 KT-3576 Getters for float constants in objects always return 0.0 when constants are less than 1.0
#KT-3576 Fixed
2013-05-06 10:41:48 +04:00
Natalia.Ukhorskaya 6e2584d0de Generate bytecode for delegated properties 2013-04-30 21:47:22 +04:00
Mikhael Bogdanov e72b177adc KT-3561 Bad RuntimeInvisibleParameterAnnotations on attempt to annotate enum constructor hidden parametrs - name and ordinal 2013-04-30 18:46:07 +04:00
Mikhael Bogdanov b0b6728c7e KT-3118 NoSuchFieldError on private property without backing field &&
KT-3551 Wrong synthetic accessor implementation
2013-04-30 15:28:02 +04:00
Mikhael Bogdanov b1c2d9035a Removed JvmPropertyAccessorSignature.getJvmMethodSignature() method 2013-04-30 15:17:03 +04:00
Mikhael Bogdanov 83d8930c02 Primary constructor generation via FunctionCodegen Strategy, local variable table generation via JvmMethodSignature and FunctionDescriptor 2013-04-30 15:17:03 +04:00
Mikhael Bogdanov 5fe6e32882 Make JvmPropertyAccessorSignature extends JvmMethodSignature 2013-04-30 15:17:03 +04:00