Commit Graph

6068 Commits

Author SHA1 Message Date
Alexander Udalov 4e7542b07d Filter out non-builtin package fragments from module when needed
In subsequent commits, a JVM module will be able to have up to two package
fragments for a given package FQ name. For example, for package "kotlin" in
kotlin-runtime.jar there will be a LazyJavaPackageFragment with binary
(Kotlin+Java) dependencies, and a BuiltInsPackageFragment for built-ins
metadata (which is loaded from kotlin/kotlin.kotlin_builtins)
2016-10-25 15:42:33 +03:00
Alexander Udalov ccd480236a Add mock JDK and mock runtime to light class tests 2016-10-25 15:42:33 +03:00
Alexander Udalov 035d6156a7 Drop Cloneable in JS, synthesize it at compile-time on JVM
Use the same approach that is used for creating function type classes
(Function{0,1,...}) + add Cloneable to supertypes of Array and primitive arrays

 #KT-5537 Fixed
2016-10-25 15:42:33 +03:00
Alexander Udalov c0147860bd Allow multiple ClassDescriptorFactory instances in deserialization 2016-10-25 15:42:32 +03:00
Mikhail Glukhikh e7e56ab85c KT-8442 related: destructuring declarations aren't taken into account during light classes generation, fixes EA-81204 2016-10-25 13:13:11 +03:00
Denis Zharkov b7e8071a7d Do not use BasicInterpreter for bytecode analysis
The problem with BasicInterpreter is the following:
it creates BasicValue objects that should be replaced in favor of StrictBasicicValue

See commit message in 25c6ac1 for clarification

 #KT-14447 Fixed
2016-10-25 10:14:52 +03:00
Denis Zharkov d279ded714 Add license and links to rewritten ASM classes 2016-10-25 10:14:52 +03:00
Denis Zharkov 3a197e8d7e Fix NPE caused by nullability checks optimizations
Mostly this commit replaces instances of original BasicValue from ASM
with ones of StrictBasicValue having strict equals implementation

Optimization issue was related to non-symmetric 'equals':
- NotNullBasicValue("java/lang/Object").equals(BasicValue("java/lang/Object")) == false
- BasicValue("java/lang/Object").equals(NotNullBasicValue("java/lang/Object")) == true

 #KT-14242 Fixed
2016-10-25 10:14:52 +03:00
Denis Zharkov 09dc207052 Add SingleUnderscoreForParameterName language feature 2016-10-24 18:00:02 +03:00
Denis Zharkov 1f0293eb42 Check modifiers applicability on destructured lambda parameters
#KT-14502 Fixed
2016-10-24 18:00:02 +03:00
Alexander Udalov 76523cc175 Split JvmDependenciesIndex to several files, move to 'index' package 2016-10-24 15:30:38 +03:00
Denis Zharkov 51f4244980 Report UNUSED_DESTRUCTURED_PARAMETER_ENTRY
on destructured lambda parameters

 #KT-14347 Fixed
2016-10-24 10:19:25 +03:00
Denis Zharkov a9fcee098d Support single-underscore named variables in JVM backend
There are mainly two kind of changes:
- skipping 'componentX' calls for destructuring entries named _
- fixing local variable table for them
 - skip entries for destructuring entries named _
 - use $noName_<i> format for lambda parameters named _

 #KT-3824 Fixed
 #KT-2783 Fixed
2016-10-24 10:19:25 +03:00
Denis Zharkov dbca310d8c Support single-underscore variable names partially
Currently only parameters of lambdas/function expressions
and destructuring entries are allowed

 #KT-3824 In Progress
 #KT-2783 In Progress
2016-10-24 10:19:25 +03:00
Ilya Gorbunov 82364ad3e5 Filter out typealiases invisible due to API_VERSION < their SinceKotlin version, when determining excluded imports. 2016-10-21 18:19:03 +03:00
Alexander Udalov 4c52ce37d2 Drop TargetPlatform in utilities for module creation 2016-10-21 17:10:40 +03:00
Alexander Udalov 9ec781e859 Get rid of ModuleDescriptor#defaultImports, use DefaultImportProvider 2016-10-21 17:04:59 +03:00
Mikhail Glukhikh bfaa9cf56f UnreachableCode.getUnreachableTextRanges always returns at least one range #KT-14158 Fixed 2016-10-21 10:31:50 +03:00
Dmitry Petrov 4fc135709e Inner classes lowering: remap old constructor parameters. 2016-10-21 10:05:41 +03:00
Dmitry Petrov 2986e7b508 Check for repeated annotations in type alias expansion. 2016-10-21 09:56:10 +03:00
Dmitry Petrov 5531762ab1 Check for repeated annotations in type alias declaration. 2016-10-21 09:56:10 +03:00
Mikhail Glukhikh a19d178867 Initialization analysis : more accurate handling of non-local variables while merging data #KT-14304 Fixed 2016-10-20 19:52:44 +03:00
Zalim Bashorov bdecb661e3 KJS: fix wrongAbiVersion test after abi version was increased. Make it less fragile with the hack for JS tests. 2016-10-20 13:47:50 +03:00
Alexey Andreev f22a507e39 JS: add test to prove that #KT-5051 is no more reproducible 2016-10-20 12:16:30 +03:00
Dmitry Petrov c41ec1ddfb KT-14400: Properly handle TypeAliasConstructorDescriptor in KotlinTypeMapper.mapToCallableMethod(...)
Implement getDefaultType() in TypeAliasDescriptor subclasses.
2016-10-20 09:56:03 +03:00
Dmitry Petrov 7dce1f438f Inner classes lowering. 2016-10-19 19:13:40 +03:00
Denis Zharkov 4793f71da2 Properly generate indices for destructured parameters in inline case
#KT-14399 Fixed
2016-10-19 16:05:50 +03:00
Michael Bogdanov d48ef2efc7 Fix for KT-14012: Back-end (JVM) Internal error every first compilation after the source code change
#KT-14012 Fixed
2016-10-18 10:46:51 +03:00
Dmitry Petrov b5d81d8e31 Preparations to push to master branch.
Introduce tests-ir-jvm module (for IR-based JVM BE tests).
2016-10-18 09:15:19 +03:00
Michael Bogdanov 20c4f47253 Properly lower ImplicitClassReceiver 2016-10-18 09:10:19 +03:00
Dmitry Petrov 703110c0e2 Update after rebase on master. 2016-10-18 09:10:18 +03:00
Dmitry Petrov fb5298237a Shared variables lowering. 2016-10-18 09:10:16 +03:00
Dmitry Petrov fedfd3de16 Suggest names for captured receivers. 2016-10-18 09:10:15 +03:00
Michael Bogdanov b72d7557d1 KClassJavaProperty support 2016-10-18 09:10:13 +03:00
Dmitry Petrov 5ee2f87c4a Closure conversion: simple tests work. 2016-10-18 09:10:12 +03:00
Dmitry Petrov a51efaacc9 Introduce IrGetValue as a replacement for IrThisReference / IrGetExtensionReceiver / IrGetVariable. 2016-10-18 09:09:59 +03:00
Dmitry Petrov 608d6a37d2 Some enum-related fixes
(NB: testEnumClass3 doesn't work yet, effective modality required for enum class)
2016-10-18 09:09:57 +03:00
Dmitry Petrov f423369327 Objects (singletons) lowering. 2016-10-18 09:09:56 +03:00
Dmitry Petrov fc754e533d Enum classes lowering. 2016-10-18 09:09:55 +03:00
Michael Bogdanov f30027b4de Generate ir-accessors for interface properties 2016-10-18 09:09:53 +03:00
Dmitry Petrov 7950235df3 Lowering for constructors & initializers. 2016-10-18 09:09:52 +03:00
Mikhail Glukhikh 5a04c72e75 Break / continue implementation, test with break / continue, related changes in loop & loop tests 2016-10-18 09:09:49 +03:00
Mikhail Glukhikh e03e13af43 Do..while loop implementation and first test 2016-10-18 09:09:49 +03:00
Mikhail Glukhikh bcf2b410ba While loop implementation && first loop test 2016-10-18 09:09:48 +03:00
Mikhail Glukhikh 979f2231a1 IR to CFG: when implementation in function generator, some when tests 2016-10-18 09:09:48 +03:00
Mikhail Glukhikh eaf10a4675 IR to CFG test generator, sequential function tests 2016-10-18 09:09:47 +03:00
Dmitry Petrov 45c999788a Deep copy for IR elements.
NB: we can transform descriptors during copying.
2016-10-18 09:09:44 +03:00
Michael Bogdanov 7ad69bbea1 Add IR black box tests 2016-10-18 09:09:35 +03:00
Dmitry Petrov 663eb21990 Coerce loop body to Unit. 2016-10-18 09:09:31 +03:00
Dmitry Petrov 1c2a676cd6 Make coercion to Unit explicit in IR. 2016-10-18 09:09:30 +03:00