Commit Graph

799 Commits

Author SHA1 Message Date
Alex Tkachman 59958ea0de fixining what IDEA formatter did 2012-08-30 15:00:49 +03:00
Andrey Breslav d38b028768 Code restructured to simplify the API 2012-08-30 15:56:48 +04:00
Andrey Breslav 42bf62f870 KT-2704 Remove support for enum-entry constructor generation in the front-end code
#KT-2704 Fixed
2012-08-30 15:28:41 +04:00
Alex Tkachman a45bae63ab @NotNull CodegenContext.ownerKind 2012-08-30 14:18:54 +03:00
Alex Tkachman 6a6f214b82 got rid of unneeded ReceiverContext 2012-08-30 14:04:34 +03:00
Alex Tkachman 8560039db7 unnecesary and confusing field receiverDescriptor removed 2012-08-30 13:54:16 +03:00
Alex Tkachman d407b9e917 protected constructor for GenerationStrategy 2012-08-30 13:38:29 +03:00
Alex Tkachman 0b22a3ab4b optimize imports and other minor cleanups 2012-08-30 13:31:12 +03:00
Alex Tkachman 1313ef64fd NamespaceCodegen extends GenerationStateAware 2012-08-30 13:08:43 +03:00
Alex Tkachman da064f95fd MapTypeMode renamed to JetTypeMapperMode and moved to state package 2012-08-30 13:08:43 +03:00
Alex Tkachman df094a4cd0 ClassBodyCodegen & PropertyCodegen extend GenerationStateAware 2012-08-30 13:08:42 +03:00
Alex Tkachman 7bd88f5031 FunctionCodegen extend GenerationStateAware 2012-08-30 13:08:41 +03:00
Alex Tkachman 02be7ec6f8 ClosureCodegen extends GenerationStateAware 2012-08-30 13:08:41 +03:00
Alex Tkachman 6cc85a6ce3 JetTypeMapper moved to state package 2012-08-30 13:08:41 +03:00
Alex Tkachman 20eb285f35 binding package introduced 2012-08-30 13:08:41 +03:00
Kirill Berezin b84f068c33 kt-1760 delegation to java iface:
- removed codegen's unnecessary lookup for a declaration
- skipped class' only supertype (if any) methods when delegating
2012-08-30 14:03:43 +04:00
Alex Tkachman 0852f3939f (BindingContext,BindingTrace,TypeMapper,GenerationState)Aware classes introduced and related changes in GenerationState construction/injection 2012-08-30 11:50:51 +03:00
Natalia.Ukhorskaya 92a782ce6c AnnotationDescriptor refactoring: contains map of ValueParameterDescriptor and CompileTimeConstant for valueArgument.
DescriptorUtils: add method to get a list of sorted value arguments from AnnotationDescriptor
2012-08-30 10:56:31 +04:00
Alex Tkachman b45f19c0e2 GenerationState refactored to be (almost) immutable and methodless (modulo little protection from reuse)
GenerationStrategy introduced to handle separately cases of regular compilation and building of JetLightClasses (this was only real overridable behavior of GenerationState in old code)
state subpackage introduced
2012-08-30 09:33:10 +03:00
Alex Tkachman 65c3b7dab0 subclasses of CodegenContext moved to upper level 2012-08-29 21:16:34 +03:00
Alex Tkachman 85dcfac2b8 some unmotivated uses of typeMapper.getBindingContext() replace with use of local field 2012-08-29 21:00:39 +03:00
Pavel V. Talanov b7b0dd0146 Rename private constants in CodegenUtil in order not be confused with asm real flags. 2012-08-29 20:26:52 +04:00
Pavel V. Talanov 32f9dcedff Merge with Alex's refactroings. 2012-08-29 17:12:07 +04:00
Pavel V. Talanov 5855c242f5 Add a TODO and a note describing why objects have public constructors in jvm-backend atm. 2012-08-29 16:01:19 +04:00
Pavel V. Talanov d831f164cc Enum classes have private constructor visibility from front-end point of view.
Protected visibility hardcoded in jvm backend.
2012-08-29 15:58:40 +04:00
Pavel V. Talanov 544be17c3d Refactor JetTypeMapper#getAccessFlags.
Rename to getVisibilityAccessFlag.
Separate logic for special cases and default mapping.
Use meaningful name instead of "magic" zero number.
Add TODO for future refactoring.
Various logic clarifications.
2012-08-29 15:58:35 +04:00
Pavel V. Talanov ae348a0547 Nested packages visibilities in jvm-backend. 2012-08-29 15:58:29 +04:00
Pavel V. Talanov e6e6f7e598 Object's constructor is private from frontend point of view.
Test data changed.
Js-backend test objectInObject turned off.
Public constructors for objects hard-coded in jvm-backend.
2012-08-29 15:58:27 +04:00
Alex Tkachman 67e7491d4c unused parameters removed 2012-08-29 14:32:06 +03:00
Alex Tkachman 8840a9bdd8 some static methods moved from JetTypeMapper to CodegenUtil & CodegenBinding 2012-08-29 14:30:44 +03:00
Alex Tkachman 50107b1429 AsmTypeConstants introduced 2012-08-29 14:17:23 +03:00
Pavel V. Talanov 00a12bd013 Constructors for enum entries and class objects have private visibility in frontend.
Introduce DescriptorUtils#getDefaultConstructorVisibility.
DescriptorResolver: remove exception wrapping.
Hardcode package-private visibility for enum entries in JetTypeMapper.

Refactoring:
DescriptorResolver: rename createPrimaryConstructorForObject -> createAndRecordPrimaryConstructorForObject, createPrimaryConstructorForObject now a separate method.
JavaDescriptorResolver: extract containingDeclaration variable.
JetTypeMapper: rename variable declaration -> containingDeclaration.
2012-08-29 14:42:12 +04:00
Alex Tkachman 5298851bbb @Nullable added 2012-08-29 13:01:46 +03:00
Alex Tkachman d878be2ac7 unused method removed 2012-08-29 13:00:06 +03:00
Alex Tkachman f0db65d798 optimizing imports 2012-08-29 10:45:34 +03:00
Alex Tkachman 5bf2831db7 className moved out of calculatedClosure/MutableClosure 2012-08-29 10:22:21 +03:00
Alex Tkachman 018a1f8c85 some cleanup of JetTypeMapper
- some methods not relevant directly to type mapping made static and moved to CodegenBinding or CodegenUtil
- naked bindingContext field shielded by getter
- injectors regenerated in order to have injection logic more natural
2012-08-28 21:27:43 +03:00
Alex Tkachman bb3bef41ce optimize imports 2012-08-28 14:34:17 +03:00
Alex Tkachman e8d84c4042 add static import of Opcodes.* 2012-08-28 14:32:05 +03:00
Alex Tkachman 5b8492fd9f add static import of Opcodes.* 2012-08-28 14:30:37 +03:00
Alex Tkachman f1f22a15b0 unused import 2012-08-28 14:25:03 +03:00
Alex Tkachman 164919edaa add static import of BindingContextUtils 2012-08-28 14:22:59 +03:00
Alex Tkachman b3b18d74f3 isNamedFun decommissioned and replace by isLocalFun 2012-08-28 14:16:23 +03:00
Alex Tkachman 36ae1079d6 three utility functions moved from CodegenUtil to CodegenBinding 2012-08-28 14:06:56 +03:00
Alex Tkachman 7452bb2957 CodegenAnnotator does not exist anymore
Injectors regenerated to reflect that
2012-08-28 11:54:52 +03:00
Alex Tkachman 5ee0f0871f CodegenAnnotator has state anymore. Most likely to be completely removed soon 2012-08-28 11:19:52 +03:00
Alex Tkachman fbfc9a9420 LinkedList replaced by Stack 2012-08-28 09:49:50 +03:00
Alex Tkachman a2813a13f0 unused import 2012-08-28 09:34:01 +03:00
Alex Tkachman 15c1d7bda7 most of data previously kept in CodegenAnnotator now lives in binding context (CodegenBinding utility class)
injectors regenerated in order to have BindingTrace around
2012-08-28 09:31:19 +03:00
Alexander Udalov 6af6f2827d get rid of JdkNames 2012-08-27 20:52:40 +04:00