Commit Graph

95 Commits

Author SHA1 Message Date
Alexander Udalov 33bcee7d6d Fix iterators for one-element progressions
In case of start==end hasNext was always false, which resulted in iterators
over one-element progressions not iterating that element
2013-06-20 23:27:11 +04:00
Alexander Udalov aea8f3bcee Fix and test ProgressionUtil
Arithmetical modulo implementation was incorrect (-10 mod 1 == 0, but was 1)
2013-06-20 22:23:02 +04:00
Alexander Udalov 980e409768 Optimize integer progression iterators
With the help of ProgressionUtil hasNext and next* consist now of only several
bytecode instructions
2013-06-20 22:20:39 +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 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
Natalia.Ukhorskaya b9e5227b58 Change String argument of property delegate method to PropertyMetadata 2013-04-30 21:47:24 +04:00
Alexander Udalov 77ef20a51e Generate KFunction/KMemberFunction/KExtensionFunction
#KT-1183 In Progress
2013-04-22 17:59:30 +04:00
Alexander Udalov 76fa9642f0 toString() for FunctionN classes
It's implemented as if the types were reified: getting the real type parameters
of the corresponding FunctionN class
2013-04-22 17:59:29 +04:00
Alexander Udalov 6f6cb03549 Make FunctionN interfaces
FunctionN and ExtensionFunctionN are now interfaces, with the corresponding
implementations in FunctionImplN and ExtensionFunctionImplN

Update test data
2013-04-22 17:59:29 +04:00
Alexander Udalov 34470ec89a Regenerate FunctionN and ExtensionFunctionN classes
GenerateFunctions now also generates Java classes in runtime/src/jet/
directory, and they have the matching declarations to those in
compiler/src/jet/

Delete ExtensionFunctionN's protected constructor, as it wasn't needed

Delete toString(), a more useful version will be implemented soon
2013-04-22 17:59:29 +04:00
Evgeny Gerashchenko 93f8d572fc Renamed runtime Tuple0 class to Unit. 2013-03-22 16:38:24 +04:00
Evgeny Gerashchenko ec5331057a Removed unnecessary final on local variables. 2013-03-13 14:12:50 +04:00
Mikhael Bogdanov b3ec87f956 ClassObject instance field refactoring 2013-03-04 16:42:55 +04:00
Evgeny Gerashchenko 021496c07d Prohibited NaN steps. 2013-02-13 18:08:36 +04:00
Alexander Udalov 1021ec5ff4 Add Intrinsics.areEqual()
It's more safe, short and less error-prone (especially w.r.t. nullability of
generic types)
2013-02-06 17:54:26 +04:00
Andrey Breslav 79e27f2d90 Write vararg flag on value parameters 2013-01-31 22:05:56 +04:00
Andrey Breslav b42777a28c Remove unused parameters 2013-01-31 22:05:56 +04:00
Evgeny Gerashchenko 58f37f38f4 Renamed NumberSequence to Progression. 2013-01-29 22:55:10 +04:00
Evgeny Gerashchenko b7c4b9e263 Added primitive contains() to float and double ranges. 2013-01-29 22:55:09 +04:00
Evgeny Gerashchenko a24bf67688 Dropped unnecessary primitive iterable traits. 2013-01-29 22:55:08 +04:00
Evgeny Gerashchenko cec0389a8a Added equals, hashCode and toString to sequences. 2013-01-29 22:55:07 +04:00
Evgeny Gerashchenko a947633bec Inlined getter calls. 2013-01-29 22:55:07 +04:00
Evgeny Gerashchenko 0539be1b1c Rearranged methods in ranges. 2013-01-29 22:55:07 +04:00
Evgeny Gerashchenko 90e474ca75 Subclassed ranges from sequence. 2013-01-29 22:55:07 +04:00
Evgeny Gerashchenko 79d3440c92 Subclassed Float/DoubleRange from iterable (for uniformity). 2013-01-29 22:55:07 +04:00
Evgeny Gerashchenko 9fa3e47b65 Added start and end property to generic range. 2013-01-29 22:55:05 +04:00
Evgeny Gerashchenko 0e0c048074 New structure of range classes. 2013-01-29 22:55:05 +04:00
Evgeny Gerashchenko 8c4abd4d9c Simpler toString() in ranges. 2013-01-29 22:55:05 +04:00
Evgeny Gerashchenko 0ff3589bb9 Moved *Range.step() functions to stdlib. 2013-01-29 22:55:05 +04:00
Evgeny Gerashchenko 4736b8d6e7 Introduced sequence classes. 2013-01-29 22:55:04 +04:00
Evgeny Gerashchenko abe7ca21bf Moved primitive iterators to upper level. 2013-01-29 22:55:04 +04:00
Evgeny Gerashchenko 88a6cffb34 Simplified primitive iterators. 2013-01-29 22:55:04 +04:00
Evgeny Gerashchenko c8a194c0a8 Dropped *Range.isReversed 2013-01-29 22:55:04 +04:00
Evgeny Gerashchenko 797b961484 Rearranged methods to follow common structure. 2013-01-29 22:55:03 +04:00
Evgeny Gerashchenko 9cd67dfc5c Removed unnecessary iteratorStart property of ranges. 2013-01-29 22:55:03 +04:00
Evgeny Gerashchenko eb8107115d Moved IntRange.count to Ranges class. 2013-01-29 22:55:03 +04:00
Evgeny Gerashchenko af0997a147 Removed static count() in all but IntRange. 2013-01-29 22:55:03 +04:00
Evgeny Gerashchenko 52b7ee6447 Happy new year 2013! 2013-01-28 18:58:08 +04:00
Andrey Breslav 56acd57e73 KT-3267 Put binary format version into the generated class files
#KT-3267 Fixed
2013-01-23 20:12:47 +04:00
Natalia.Ukhorskaya 65f1efb921 Add JetPackageClass annotation 2013-01-15 19:45:07 +04:00
Evgeny Gerashchenko e03eaf6dde Removed @author javadocs from code. 2012-12-28 17:44:31 +04:00
Andrey Breslav f925bfccd0 Changing default nullability for type arguments to NotNull 2012-12-14 15:28:21 +04:00
Alexander Udalov 9eecf22e15 Booleans are no longer Comparable 2012-11-28 17:41:36 +04:00
Evgeny Gerashchenko 1a216c22f2 Minor. Renamed getC -> getChar 2012-11-20 17:20:00 +04:00
Evgeny Gerashchenko d37bdbc07d Saving and loading projection kind of array element type in bytecode. 2012-11-20 17:20:00 +04:00
Evgeny Gerashchenko 3fce07b83a Arranged generator classes into packages to make it possible to compile GenerateInjectors separately. 2012-11-12 20:40:23 +04:00
Evgeny Gerashchenko 666aecf716 Extracted generator of ranges into GenerateRanges class. 2012-11-12 19:54:23 +04:00
Natalia.Ukhorskaya 78d22e9f81 KT-2823 TypeCastException has no message
#KT-2823 Fixed
2012-10-11 15:41:49 +04:00
Alexander Udalov c9984c3d06 Generate not-null assertions on method parameters
Intrinsics.checkParameterIsNotNull() gets its caller's class and method names
from the stack trace to render them in an exception message.

Fix codegen tests because now it's now allowed to pass null to non-null
argument in tests
2012-10-08 19:13:20 +04:00
Alexander Udalov fcbc95bbb4 Generate not-null assertions after getting a field 2012-10-08 14:11:57 +04:00