Commit Graph

1413 Commits

Author SHA1 Message Date
Steven Schäfer 8c06f7daae Fix IR declaration parents.
- Reparent declarations in FileClassLowering, InterfaceLowering,
  StaticDefaultFunctionsLowering, EnumClassLowering, and
  RenameFieldsLowering
- Set correspondingPropertySymbol in MoveCompanionObjectFieldsLowering
- Reparent field initializers in MoveCompanionObjectFieldsLowering and
  EnumClassLowering
- Ensure that parents are unique in PropertiesLowering
- Set declaration parent in SharedVariableManager
- Set field declaration parents in CallableReferenceLowering
- Set declaration parents in FunctionNVarargInvokeLowering
- Set declaration parents for external declaration fields
2019-04-23 12:51:27 +02:00
Svyatoslav Kuzmich b1d303b027 Reorganize stdlib-js sources specific to the current JS backend
Move kotlin-stdlib-js project and the sources specific to the current backend to 'stdlib/js-v1' directory,
but leave sources that can be shared with the new IR backend in the common 'stdlib/js' location
with exception for 'stdlib/js/src/generated', which is used exclusively for current backend.
This simplifies sourceset configuration when building stdlib with the new backend.
2019-04-22 20:30:57 +03:00
Alexander Gorshenev 3ae64061c1 Minimal tweaks in IR Validation code just to be able to turn it on in Native. 2019-04-22 19:42:33 +03:00
Svyatoslav Kuzmich 889b4d721d [JS IR BE] Use constructor parameter to determine underlying type for inline classes
Inline classes from lazy IR may not have files.
2019-04-22 13:18:01 +03:00
Svyatoslav Kuzmich 03ba0eae5a [JS IR BE] Minor: better internal error message in Namer 2019-04-22 13:18:00 +03:00
Svyatoslav Kuzmich 7c2ee41491 [JS IR BE] Fix boolean companion object 2019-04-22 13:18:00 +03:00
Abduqodiri Qurbonzoda 3f08753f87 Move string-related files to text directory 2019-04-19 03:51:20 +03:00
Mikhael Bogdanov dd005d3c02 Introduce IrLazyField 2019-04-18 19:56:19 +02:00
Georgy Bronnikov 328b8f9725 Redirect EnumConstructorCall to IrFunctionAccess in IrElementTransformerVoid 2019-04-18 14:50:55 +03:00
Dmitry Gridin 3bed360c98 Fix "Should be replaced with Kotlin function" warnings 2019-04-18 15:28:52 +07:00
pyos b23f2a4dbb JVM_IR: set ConstantValue on static final primitive fields 2019-04-18 09:16:32 +02:00
Mikhael Bogdanov b70ff30dc3 Don't generate bridge flag for defaults in JVM IR backend 2019-04-17 14:53:30 +02:00
pyos 115b1c6b6e JVM_IR: force materialization of non-transparent block results 2019-04-17 14:14:21 +02:00
pyos b1bba70e40 JVM_IR: elide static field initialization to default values 2019-04-17 14:14:21 +02:00
Mads Ager a65f50bb00 JVM_IR: Generate java 8 parameter names when -java-parameters is passed.
The type mapper does not map enum parameters and outer this parameters
to the right parameter signature kinds so around half the tests
are still failing. Since a new type mapper is being worked
on I will not investigate that further right now.
2019-04-16 09:32:57 +02:00
Mark Punzalan 9f4db04839 Change visibility of ForLoopsLowering from internal to public. 2019-04-16 09:31:40 +02:00
Svyatoslav Kuzmich 977d3ef840 [JS IR BE] New name generator 2019-04-13 14:19:36 +03:00
Svyatoslav Kuzmich a16ca5e66c [JS IR BE] Static members lowering pass 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich 5c5d65bdb9 [JS IR BE] Lower dataClass hashCode and toString 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich ce1ae417c2 [JS IR BE] Minor: don't use descriptors 2019-04-13 14:17:59 +03:00
Dmitriy Novozhilov ece3a0fe90 Minor: fix smartcast on var in IrUtils.kt 2019-04-12 17:36:59 +03:00
Roman Artemev 01878fe4b5 [JS IR BE] Remove unused lowering
* its functionality is merged into `FunctionInliner`
2019-04-12 15:23:28 +03:00
Roman Artemev ece33f00a2 [IR] SuspendFunctionLowering refactoring
* distinguish common part which generates successor of `CoroutineImpl`
   into separate common lowering
 * merge it with K/N
2019-04-12 15:23:28 +03:00
Roman Artemev bcc8f3e073 [IR] Move Ir utils from Kotlin/Native 2019-04-12 15:23:28 +03:00
Roman Artemev cf9cce8a9b [JS IR BE] Fix type arguments stuff in Secondary Constructor lowering 2019-04-12 15:23:28 +03:00
Roman Artemev e3699fbc31 [IR] CommonBackendContext and Symbols refactoring
* add [suspend]functionN factory factions
 * add `getContinuation` property
 * add `internalPackageName` property
 * fix lowerings
2019-04-12 15:23:28 +03:00
pyos 57dca2ada5 JVM_IR: generate exception specifications 2019-04-12 13:00:54 +02:00
Dmitry Petrov 8a95da4a95 Minor: reformat DeepCopyIrTreeWithDescriptors.kt 2019-04-12 12:13:21 +03:00
Dmitry Petrov bf2ab99b61 IR: IrSimpleTypeBuilder 2019-04-12 12:13:21 +03:00
Ting-Yuan Huang 0dd09ea7de JVM_IR: Lower IrGetEnumValue to this whenever possible.
The reference can be lowered to `this` if it is captured in the lexical
scope of the corresponding enum entry, and not used by the enum entry's
super constructor. Otherwise, it is lowered to
`GETFIELD SomeEnum.SomeEntry`.
2019-04-12 08:58:43 +02:00
Alexander Gorshenev ce6cda631d IrDelegatedProperty and IrDelegatedPropertyReference were missing from the serialization 2019-04-11 17:50:53 +03:00
Mark Punzalan 1b703448d3 Handle reversed() in ForLoopsLowering.
We get the info for the underlying progression and invert it. For
progressions whose last bound was open (e.g., `until` loop), the
reversed version will have an open first bound and so the induction
variable must be incremented first.

Also unified the way of extracting HeaderInfo out of changed calls
(e.g., `indices.reversed()`), and fixed declaration parents in
ForLoopsLowering.
2019-04-11 08:54:55 +02:00
pyos b24690b35b Remove a redundant field 2019-04-10 20:51:46 +02:00
pyos 73bd683af1 Store InstructionAdapter, not ExpressionCodegen, in PromisedValue 2019-04-10 20:51:46 +02:00
pyos 96e2eb6fa1 Move PromisedValue to a separate file 2019-04-10 20:51:46 +02:00
pyos e249c3c594 Return a stripped version of StackValue from ExpressionCodegen 2019-04-10 20:51:46 +02:00
pyos c5f6be4282 Remove import of StackValue.* to better see use sites 2019-04-10 20:51:46 +02:00
pyos a9bece9baa Allow intrinsics to be partial
Also, add an overridable invoke() method that skips the Callable step.
2019-04-10 20:51:46 +02:00
pyos 6e44b22340 Remove an unused non-IR IntrinsicMethod.toCallable 2019-04-10 20:51:46 +02:00
pyos 31eb542476 Return an immaterial value from Boolean.not 2019-04-10 20:51:46 +02:00
pyos 31c7183781 Return immaterial values from comparison intrinsics 2019-04-10 20:51:46 +02:00
pyos 9aff1cefb4 Make materialization of StackValues explicit 2019-04-10 20:51:46 +02:00
pyos 2356f72fd4 Make ExpressionCodegen a bit shorter in general 2019-04-10 20:51:46 +02:00
pyos 89cb31c387 Refactor try-catch covering computation 2019-04-10 20:51:46 +02:00
Mads Ager a8e2893494 JVM_IR: Output EnclosingMethod attribute.
This works in many cases, however, it is incomplete since there
are cases where classes are extracted to top-level and therefore
reparented. Therefore, we lose the information about the function
class are nested inside.
2019-04-10 20:50:03 +02:00
pyos 8ae9e7a106 JVM_IR: unwrap fake overrides when computing property signatures 2019-04-10 19:21:37 +02:00
Alexander Udalov 121f30d9cc Use IrType instead of KotlinType in SingleAbstractMethodLowering 2019-04-10 14:42:40 +03:00
Alexander Udalov 2f003ef545 Generate classes in MultifileClassCodegen exactly the same as in PackageCodegen
Two known issues with generateNonPartClassDeclarations that was here
before were the fact that we didn't sort sealed classes and its
subclasses which led to NoSuchMethodError (KT-27097), and the fact that
we didn't skip expect classes which led to incorrect duplicate JVM class
name diagnostic (KT-30843)

 #KT-27097 Fixed
 #KT-30843 Fixed
2019-04-10 14:39:16 +03:00
Georgy Bronnikov 43e87a1635 Merge pull request #2256 from pyos/flatten-phases
Flatten phase compositions
2019-04-10 10:43:14 +03:00
Steven Schäfer 26aeddf6d9 Remove broken KotlinType.toIrType function
The KotlinType.toIrType function sometimes produces unbound symbols
and was only used in IrIntrinsicFunction and SharedVariablesManager.

This change removes the broken function and changes SharedVariableManager
to use IrType consistently and IrIntrinsicFunction to use KotlinType
consistently.
2019-04-09 13:46:02 +02:00