Commit Graph

1979 Commits

Author SHA1 Message Date
Alexander Udalov d5d4cff701 Minor, remove dependency of everything on "descriptor.loader.java"
Everything already depends on "frontend.java" which exports
"descriptor.loader.java"
2014-08-25 17:53:18 +04:00
Alexander Udalov 2ea9a2cfc9 Generate annotations on enum entry constants in bytecode
#KT-5665 Fixed
2014-08-25 17:50:08 +04:00
Denis Mekhanikov 1533c0e9f3 Support more than 32 default arguments
#KT-4675 Fixed
2014-08-20 20:47:34 +04:00
Pavel V. Talanov 331f24d01a Use VirtualFileFinder.SERVICE in InlineCodegenUtil 2014-08-15 15:22:17 +04:00
Alexander Udalov 99d4f97aef Fix access to top level delegated property from another property
#KT-5612 Fixed
2014-08-14 10:43:50 +04:00
Alexander Udalov 226bfe65f0 Don't make traits and annotations inherit from KObject
#KT-5609 Fixed
2014-08-13 17:19:56 +04:00
Alexander Udalov 9c00e1c94d Scripts: coerce result to the actual expression type
#KT-5622 Fixed
2014-08-13 17:19:53 +04:00
Alexander Udalov 6e46bea821 Minor, rename local variable 2014-08-13 17:19:52 +04:00
Alexander Udalov 4213ce318e REPL: don't fail on a callable reference
There should probably be a special kind of property, but at least it won't
throw an exception for now
2014-08-13 15:13:24 +04:00
Alexander Udalov 415fe7a5e6 Initial support for classes in scripts and REPL 2014-08-13 15:13:22 +04:00
Alexander Udalov 45a57011d8 Simplify and enable by default inline/optimize/assertions
Inline, optimize, call assertions, param assertions are turned on by default
now almost everywhere; invert their meaning
2014-08-13 11:10:37 +04:00
Michael Nedzelsky 12db8f1551 JS backend: support for explicit delegation
#KT-4479 Fixed
2014-08-09 10:24:02 +04:00
Alexey Sedunov 311166737f Associate synthetic component function descriptors with corresponding
constructor parameters
2014-08-08 18:59:45 +04:00
Evgeny Gerashchenko 99ecb82ce0 Simpler byte code generated for comparison with null and zero.
Analogous byte code is generated by Javac.
2014-08-05 16:29:03 +04:00
Denis Zharkov e0ced7cbcf Boxing values merge fix. #KT-5588 Fixed
When merging Boxed value and something else just return MIXED_VALUE
2014-08-05 13:54:42 +04:00
Svetlana Isakova 2ae87cae4a Function literal expression outside the parentheses wrapped into JetFunctionLiteralArgument
Extracted JetFunctionLiteralArgument.moveInsideParenthesesAndReplaceWith util function
2014-07-30 17:14:00 +04:00
Svetlana Isakova 3cc02c57fc Refactoring: moved methods to call util 2014-07-30 17:07:10 +04:00
Evgeny Gerashchenko 8a84446458 Merge pull request #502 from bintree/master
#KT-5513 Fixed
2014-07-29 15:13:44 +04:00
Alexander Udalov c24c799819 Fix NoSuchMethodError on private components of data classes
A follow-up to
https://github.com/JetBrains/kotlin/commit/d5681540ec47ee5c9a548ba56df8b4e20097549d
2014-07-26 01:31:11 +04:00
Alexander Udalov c69303fd1d Fix lots of deprecation warnings on ASM code
In the vast majority of cases it's known that we're calling a class method and
not an interface method
2014-07-26 01:05:03 +04:00
Alexander Udalov de0f751207 Replace object$ -> OBJECT$, instance$ -> INSTANCE$ in the project 2014-07-26 00:21:05 +04:00
Alexander Udalov fb958897a9 Introduce kotlin.Cloneable
- Cloneable is a trait with a single protected member 'clone', which is mapped
  to java.lang.Cloneable on JVM
- 'clone' is non-abstract to be able to call 'super.clone()' in the
  implementations. Also if you need your class to be Cloneable, most of the
  time inheriting from Cloneable and calling 'super.clone()' will work
- hack 'super.clone()' in JVM intrinsics and TImpl delegation generation
- make arrays Cloneable, handle 'clone()' calls in the intrinsic

 #KT-4890 Fixed
2014-07-25 21:19:39 +04:00
Zalim Bashorov c85ec97589 Minor: revert dc68d78 (Minor: revert changes in StackValue and fix tes data. another fixes) 2014-07-25 17:16:40 +04:00
Alexander Udalov 917938e57b Update copyrights 2014-07-23 21:24:39 +04:00
Denis Zharkov c01512eb41 Do not optimize large methods. #KT-5513 Fixed 2014-07-23 14:13:23 +04:00
Denis Zharkov 8d8c3d2b9e When2Switch: generate ifnonnull check for nullable values before *switch-opcode 2014-07-21 17:13:56 +04:00
Denis Zharkov 706bbd7b72 When2Switch: check if entry set is not empty 2014-07-21 17:13:56 +04:00
Denis Zharkov d4cb822ee8 When by String constants:
Generate TABLESWITCH/LOOKUPSWITCH bytecode operation for when operator by String constants
2014-07-21 17:13:56 +04:00
Denis Zharkov 5a1c995b5c When by enum:
Generate TABLESWITCH/LOOKUPSWITCH bytecode command in case of "when" by enum entries
2014-07-21 17:13:55 +04:00
Denis Zharkov b2aa249817 Refactoring of switches codegen parts 2014-07-21 17:13:41 +04:00
Denis Zharkov dbd1ab8c67 Minor formatting and unused code deleted 2014-07-21 17:13:41 +04:00
Alexander Udalov 230ceb6221 Resurrect assert for property default values in FULL mode
Respond to
https://github.com/JetBrains/kotlin/commit/4980a3357231c833ebdb7111d16e7be5bd342521#commitcomment-7078429

 #KT-5505 Fixed
2014-07-21 15:29:28 +04:00
Alexander Udalov 4980a33572 Fix unjustified assert in PropertyCodegen
#KT-5505 Fixed
2014-07-19 02:13:27 +04:00
Alexander Udalov d5681540ec Fix NoSuchMethodError for data classes with private parameters
Introduced in a07909bb52
2014-07-19 02:13:26 +04:00
Alexander Udalov cf8e83f4f8 Minor, delete obsolete check
'superCall' is now never a JetDelegatorByExpressionSpecifier, so the check is
useless
2014-07-19 02:13:25 +04:00
Alexander Udalov 93fdf3a254 Minor, extract FrameMap creation in FunctionCodegen 2014-07-18 16:26:48 +04:00
Alexander Udalov 33f7d6e3ef Get rid of a questionable TImpl hack in ImplementationBodyCodegen
Move getTraitImplThisParameterType closer to the only left usage in
JetTypeMapper
2014-07-18 16:26:47 +04:00
Alexander Udalov c25d72d240 Drop CodegenBinding#enclosingClassDescriptor() 2014-07-18 16:26:47 +04:00
Alexander Udalov 78bdcae65e Delete unreachable code in ImplementationBodyCodegen
Change superCall type to JetDelegatorToSuperCall
2014-07-18 16:26:47 +04:00
Alexander Udalov 1949e24ffa Get rid of ConstructorFrameMap, drop CodegenContext#prepareFrame()
Also refactor FunctionGenerationStrategy to take FrameMap as an instance
instead of creating it in a subclass
2014-07-18 16:26:46 +04:00
Alexander Udalov 65c21561a4 Fix super constructor calls of anonymous objects and local classes
If a class inherits from another class which captures something (outer class
instance, receiver parameter, local variables, etc.), the constructor of the
former class should contain all the parameters of the super constructor as its
own parameters, so that it could make a proper super call. All such parameters
are now replicated in the derived constructor with kind = SUPER_CALL_PARAM,
except an instance of the outer class (kind = OUTER), which can be taken from
the derived's own OUTER when it has one, to prevent multiple passing of the
same argument.

Previously it worked only when inheriting from inner classes via a special hack
(ConstructorFrameMap).

Also reuse recently introduced ArgumentGenerator to automatically take care of
default and vararg arguments of super constructor

 #KT-3581 Fixed
 #KT-5342 Fixed
 #KT-5343 Fixed
2014-07-18 16:26:46 +04:00
Alexander Udalov b85a672052 Minor, combine ENUM_NAME and ENUM_ORDINAL parameter kinds 2014-07-18 16:26:42 +04:00
Alexander Udalov 0caf0cffab Minor, extract method JetTypeMapper#writeParameter 2014-07-18 16:26:41 +04:00
Alexander Udalov b29f3dddeb Minor, rename parameter 2014-07-18 16:26:41 +04:00
Alexander Udalov 288bbcae36 Refactor ExpressionCodegen#invokeMethodWithArguments
- for inlining purposes, take ResolvedCall.getCall() instead of a separate
  parameter
- split into two methods, the other one will be used for a more granular code
  generation of a method call
2014-07-18 16:26:40 +04:00
Alexander Udalov 04b54e9cb7 Simplify ExpressionCodegen#generateConstructorCall
Don't go through StackValue.CallReceiver because it handles a variety of cases
when a callable descriptor has a receiver argument, an expected this object, or
both. Constructors can't have receiver arguments, so the resulting code is
greatly simplified
2014-07-18 16:26:40 +04:00
Alexander Udalov eb448627e1 Minor, delete unused method in JvmCodegenUtil 2014-07-17 19:18:06 +04:00
Alexander Udalov eaeb976903 Access private class property via field in Evaluate Expression 2014-07-17 19:18:05 +04:00
Alexander Udalov a07909bb52 Don't generate unnecessary accessors for private class properties 2014-07-17 19:18:05 +04:00
Alexander Udalov 4bdf7e3426 Use direct field access to trivial class properties
#KT-3845 Fixed
2014-07-17 19:18:05 +04:00