Commit Graph

222 Commits

Author SHA1 Message Date
Stanislav Erokhin 0a4ad3f267 Refactoring. Rename FlexibleTypeCapabilities -> FlexibleTypeFactory. Also use factory.create instead of DelegatingFlexibleType.create. 2016-04-25 15:28:46 +03:00
Alexander Udalov 8ee278d02f Fix SourceElement for classes loaded in decompiler 2016-04-14 21:08:36 +03:00
Alexander Udalov 7620d66019 Minor, rename PackagePartSource -> BinarySource 2016-04-14 21:08:36 +03:00
Alexander Udalov 0ea3b4ade4 Fix multiple resource leaks by closing InputStream instances
The main fix is in BuiltInsPackageFragment, the rest is the improvement of
other usages of getResourceAsStream

 #KT-11433 Fixed
2016-03-30 21:41:43 +03:00
Alexander Udalov 8d64ed7f3f Do not produce error classes for not found annotations 2016-03-28 14:13:59 +03:00
Alexander Udalov f82ec6711d Remove SerializedResourcePaths and BuiltInsSerializedResourcePaths
Most of members now only make sense for JS, move the rest to
BuiltInSerializerProtocol
2016-02-26 11:29:10 +03:00
Alexander Udalov 996c5848c2 Simplify deserialization components for built-ins and JS 2016-02-26 11:29:10 +03:00
Alexander Udalov 4bd1d064bb Do not load built-ins in old format, drop class_name extension 2016-01-19 18:39:59 +03:00
Dmitry Jemerov d6a11b839b js: cleanup 'public', property access syntax 2016-01-07 18:15:19 +01:00
Ilya Gorbunov da4b1ae0fb Cleanup in js modules 2015-12-29 18:04:16 +03:00
Alexander Udalov b4addd0567 Move builtins-related logic from DeserializedPackageFragment to BuiltinsPackageFragment 2015-12-25 20:16:18 +03:00
Alexander Udalov 906d706961 Deserialize builtins from new message 2015-12-25 20:16:18 +03:00
Alexander Udalov 7592f31596 Serialize built-ins to separate file .kotlin_builtins 2015-12-25 20:16:18 +03:00
Alexander Udalov 07a23cab10 Minor, make SerializedResourcePaths an interface 2015-12-25 20:16:18 +03:00
Alexander Udalov 3e2eb8c1a0 Serialize/deserialize annotations on enum entries
#KT-10338 Fixed
2015-12-13 03:52:41 +03:00
Pavel V. Talanov c40d6af1e5 Decompile builtins (kotlin_class and kotlin_package files)
The main purpose of this is to be able to index builtin declarations and enable go to symbol/class functionality in ide
Also it makes sense to show builtin classes (Any, Int ...) as classes when browsing kotlin-runtime.jar

Refactor decompiler code to eliminate existing and potential duplication
Share the code between js (kjsm) decompilation and builtin decompilation heavily
2015-12-09 18:51:28 +03:00
Pavel V. Talanov 6164566cad Extract duplicate logic between javascript and builtins serialization/deserialization 2015-12-09 18:51:27 +03:00
Pavel V. Talanov dc34d4fc31 Decompiler, minor: fix some strange code 2015-12-09 18:51:22 +03:00
Yan Zhulanow 46ac3571d5 Fix "infix modifier required" errors in project 2015-11-27 15:51:11 +03:00
Michael Nedzelsky 2b4868c3ce js: do not generate files for empty string tables 2015-11-23 22:32:47 +03:00
Michael Nedzelsky c80c33efb6 add kjsm option for kotlin js command line compiler 2015-11-23 22:32:32 +03:00
Stanislav Erokhin 2c3f58eeb7 Renamed methods in MemberScope from getSmth to getContributedSmth 2015-11-05 14:34:00 +03:00
Stanislav Erokhin 6f9d9759ce Renamed KtScope to MemberScope 2015-11-05 14:34:00 +03:00
Zalim Bashorov 81a288b42c Add LookupTracker to DeserializationComponents 2015-11-02 18:18:28 +03:00
Alexander Udalov 5677ff60e7 Move/inline stuff from DescriptorUtils to other modules 2015-10-29 21:16:06 +03:00
Dmitry Jemerov d6a3870101 rename Kt to Kotlin in KtType, KtIcons 2015-10-20 16:23:31 +02:00
Dmitry Jemerov 49033e0002 rename Jet* classes to Kt* 2015-10-19 21:35:30 +02:00
Svetlana Isakova 25b40455ad Serialize/deserialize annotations on type parameters 2015-10-16 21:58:47 +03:00
Alexander Udalov f62128bdcd Fix protobuf extension API usages
"getExtension" returns default value when the requested extension is not
present, which is 0 for Int, which makes no sense for extensions like
methodImplClassName that are storing the number in the string table
2015-10-15 22:36:22 +03:00
Alexander Udalov e4efa27b76 Drop Callable and primary/secondary constructor proto messages 2015-10-11 17:10:26 +03:00
Alexander Udalov 9bf0502a31 Load new proto messages for functions and properties 2015-10-11 17:10:24 +03:00
Alexander Udalov 8c0a86617a Write JVM signatures to new protobuf messages 2015-10-03 00:59:33 +03:00
Alexander Udalov 4f21caecc4 Simplify AnnotationAndConstantLoader, use NameResolver from ProtoContainer 2015-10-03 00:59:32 +03:00
Alexander Udalov e4090d3f30 Cleanup descriptors.proto, regenerate
- move enums and messages nested in Callable to top level, since they're likely
  to be reused in other messages soon
- delete obsolete comments: some did not any value, some became obsolete with
  custom options ("id in StringTable" -> name_id_in_table)
2015-10-02 20:30:55 +03:00
Alexander Udalov 3b9d90429b Simplify local class name serialization, don't go through extension
Also fix it for the case of a class in a non-default package
2015-09-29 16:26:28 +03:00
Alexander Udalov 542bfab96f Don't write unnecessary information to ValueParameter proto
Flags can have a default value and the index can be trivially computed almost
all the time
2015-09-29 16:26:28 +03:00
Alexander Udalov da68c4d9ee Extract interface out of StringTable
Rework SerializerExtension interface: don't pass StringTable to each method
every time, create it in each extension's constructor instead and expose to
DescriptorSerializer with an interface method
2015-09-29 16:26:24 +03:00
Alexander Udalov 93b5065cf5 Get rid of SerializationUtil, move methods to DescriptorSerializer 2015-09-22 18:22:55 +03:00
Denis Zharkov 9c4564a5a6 Get rid of deprecated annotations and modifiers in project code 2015-09-18 09:34:27 +03:00
Alexander Udalov 949144e0c0 Report incomplete hierarchy error for deserialized types
#KT-5129 Fixed

Delete a JPS test that was specifically testing that we would not fail in this
situation; now there's a compilation error
2015-09-15 13:11:17 +03:00
Yan Zhulanow e7703df0b6 Use a single AnnotatedCallableKind enum item for property 2015-08-31 15:33:14 +03:00
Yan Zhulanow 1b9dab47ec Deserialize property and field annotations 2015-08-31 15:33:03 +03:00
Yan Zhulanow 08c678ef46 Deserialize receiver parameter annotations for extension functions 2015-08-31 15:32:55 +03:00
Dmitry Jemerov 3718a7dd44 code cleanup for JS modules 2015-07-20 18:32:05 +02:00
Pavel V. Talanov aae8ccfd57 Refactor: AnnotationSerializer does not depend on bultins 2015-07-17 19:21:24 +03:00
Pavel V. Talanov c313887641 Split CompileTimeConstant into two entities
1. ConstantValue
	* just holds some value and its type
	* implementations for concrete constants
2. CompileTimeConstant
	* is only produced by ConstantExpressionEvaluator
	* has additional flags (canBeUsedInAnnotation etc)
	* has two implementations TypedCompileTimeConstant containing a constant value
		and IntegerValueConstant which does not have exact type
	* can be converted to ConstantValue

Adjustt usages to use ConstantValue if flags are not needed
Add tests for some uncovered cases
2015-07-16 02:28:05 +03:00
Pavel V. Talanov 5dc5d77e60 Inject builtins in constants 2015-07-15 21:09:52 +03:00
Alexander Udalov c8439ae6fc Minor, rename val EXTENSION_REGISTRY -> extensionRegistry 2015-07-03 15:32:16 +03:00
Alexander Udalov 110d6fa7f1 Don't load irrelevant classes by accident, if resource happens to exist
Check with the containing class or package first, don't load the class if the
container doesn't know about it. This also makes the workaround for
case-insensitive file systems unnecessary
2015-07-03 15:31:48 +03:00
Pavel V. Talanov 37bcd455b5 Make ModuleDescriptor#getPackage() return not null lazy object with lazy scope
Refactor: no need to create package view in order to obtain its subpackages
LazyPackageViewDescriptorImpl to replace PackageViewDescriptorImpl
This allows to avoid computations when package views are requested but their contents not necessarily queried
For example: DescriptorResolver.resolvePackageHeader()
2015-06-23 15:19:06 +03:00