Commit Graph

1337 Commits

Author SHA1 Message Date
Alexander Gorshenev c15fb6833d Profiling machinery. 2016-12-29 16:07:43 +04:00
Alexander Gorshenev 3f65eeaeab Changed byte array copying to a more efficient mechanism. 2016-12-29 16:07:43 +04:00
Nikolay Igotti 174cdc321c Properly keep track of references. (#169) 2016-12-29 14:11:17 +03:00
Svyatoslav Scherbina b25225ba5e Review feedback 2016-12-29 17:46:28 +07:00
Svyatoslav Scherbina 4f1004c8f5 backend: reorder basic blocks to improve bitcode readability.
* Insert created basic block after the current one in `codegen.basicBlock()`.
* Slightly reorder calls to `codegen.basicBlock()`.
2016-12-29 17:46:28 +07:00
Nikolay Igotti 7ba096b169 Group slots together. (#166) 2016-12-29 09:00:01 +03:00
Svyatoslav Scherbina 276e3bcd44 backend/tests:
* enable 'expression_as_statement'
* add unit{1..4}
2016-12-29 12:18:15 +07:00
Svyatoslav Scherbina 43b3902a0f backend: refactor evaluateExpression
* Do not encode `Unit`- and `Nothing`-typed values as `null`;
  make `evaluateExpression` return type not nullable.

* Evaluate only expressions, not statements.

* Reduce usage of recursive visiting in `CodeGeneratorVisitor`
  because it usually leads to errors.
2016-12-29 12:18:15 +07:00
Svyatoslav Scherbina dfa07836fd backend: add workaround for phi nodes with zero entries 2016-12-29 12:18:15 +07:00
Svyatoslav Scherbina 7797b0efdc backend: treat kotlin.Unit type specially only when used as return type
also remove some hacks related to Unit.
2016-12-29 12:18:15 +07:00
Svyatoslav Scherbina 9a3bcd4c19 backend: statically instantiate kotlin.Unit
and optimize IrGetObjectValue(Unit)
2016-12-29 12:18:15 +07:00
Svyatoslav Scherbina 462d2b5123 backend/StaticData: weaken existing global assertion
to handle the case when global is used before defined
(e.g. kotlin.Unit in stdlib).
2016-12-29 12:18:15 +07:00
Svyatoslav Scherbina 361bb7a101 runtime, backend: simplify static objects layout:
mark static objects with container_offset_negative_ == 0
2016-12-29 12:18:15 +07:00
Nikolay Igotti ddf47e9359 Add more init tests. 2016-12-28 15:26:44 +03:00
Svyatoslav Scherbina c0914825d9 backend/tests: add disabled test 'fields2'
Checks properties with custom accessors and backing fields.
2016-12-28 14:00:45 +07:00
Svyatoslav Scherbina 8b40b9645a backend/tests: add disabled tests memory_var{1..4} 2016-12-28 13:51:14 +07:00
Alexander Gorshenev 413f47fda5 Removed 'clang' invocations in favour of llvm tools and 'ld'.
Introduced LinkStage in the compiler.

Removed the link stage from 'konanc'.

Removed duplicate :stdlib and :start targets.

Simplified test run task a lot.
2016-12-28 02:13:07 +04:00
Nikolay Igotti e65b86ab21 Memory management design and implementation. (#148) 2016-12-27 15:01:18 +02:00
Alexander Gorshenev c9fbd37f90 Use lower case for phase names. 2016-12-27 16:11:45 +04:00
Vasily Levchenko 3fe59cc46c TEST: convertion unit tests into run tests 2016-12-27 13:56:03 +03:00
Svyatoslav Scherbina 7fd4b4fe34 backend: use IR builders in CallableReferenceLowering 2016-12-27 16:04:40 +07:00
Svyatoslav Scherbina 7b29f4854c backend: lower safe casts 2016-12-27 16:04:40 +07:00
Svyatoslav Scherbina 008b8ec031 backend: connect lowering with IR generators 2016-12-27 16:04:40 +07:00
Svyatoslav Scherbina 96611c1222 backend: add some trivial utils to IR builders 2016-12-27 16:04:40 +07:00
Svyatoslav Scherbina 9054a5eb5e backend: untie IR builders from psi2ir generators 2016-12-27 16:04:40 +07:00
Svyatoslav Scherbina fa95d4d2a8 backend: move psi2ir.builders.* to ir.builders 2016-12-27 16:04:40 +07:00
Svyatoslav Scherbina 7dcc8f86a5 backend: add files from psi2ir.builders
and some from psi2ir.generators
2016-12-27 16:04:40 +07:00
Nikolay Igotti f49c6133f3 Return objects to slot. (#161) 2016-12-26 18:31:50 +02:00
Alexander Gorshenev 2515d1fdaa Swtiched to "gold" linker on linux.
Provided more aggressive optimization flags on Linux.
2016-12-26 14:41:48 +04:00
Nikolay Igotti dbc1cb1919 Switch to unrelated ObjHeader and ArrayHeader. (#160) 2016-12-26 11:27:27 +02:00
Svyatoslav Scherbina 221540a579 kotlin-compiler update: 1.1-20161224.154011-334
and fix related compilation error
2016-12-26 12:23:51 +07:00
Alexander Gorshenev 8035a77e52 a little more on phases. 2016-12-23 16:47:06 +04:00
Svyatoslav Scherbina 62737efd54 backend: add tests:
* test for uninitialized vals
* test initializers3: global `var` of reference type
* expression_as_statement (disabled): using type operator as statement

Also enable test break1.
2016-12-23 11:40:31 +07:00
Nikolay Igotti 25db86df3e Rework variable management for memory management's sake. (#156) 2016-12-22 18:30:58 +03:00
Svyatoslav Scherbina 4acb0774cf backend: do not refer phases by name
also transform KonanPhase to enum
2016-12-22 18:01:48 +07:00
SvyatoslavScherbina b6561b13a4 Implement lowering of some builtin operators. (#154)
* EQEQ
* THROW_NPE

Add test for (un)boxing `==` operands.
2016-12-22 13:02:20 +07:00
Svyatoslav Scherbina 0632a30eca kotlin-compiler update: 1.1-20161219.154657-321 2016-12-22 12:49:45 +07:00
Nikolay Igotti 8ec62ba474 Change code structure by adding explicit epilogue. (#150) 2016-12-21 14:20:57 +03:00
Alexander Gorshenev 16079ce6af Moved
DescriptorUtils.kt -> descriptors/DescriptorUtils.kt
    IrUtils.kt -> ir/IrUtils.kt
2016-12-21 14:38:19 +04:00
Alexander Gorshenev 25fcd23e03 Forgottent commit to fix the broken build. 2016-12-20 19:55:31 +04:00
Alexander Gorshenev 82143d6c8a Eliminated Logger class.
Context now provides the log(message: String) method.
This method knows if the current phase is verbose or not.
2016-12-20 19:34:26 +04:00
Alexander Gorshenev e48c5a7215 Introduced
nativeMemUtils.getByteArray
and
    nativeMemUtils.putByteArray
for faster memory copy.
2016-12-20 19:32:27 +04:00
Alexander Gorshenev 823ef031eb After the code review. 2016-12-20 19:32:27 +04:00
Alexander Gorshenev a1786614ea Removed Javascript serializer from Konan.
Introduced our own serializer.
2016-12-20 19:32:27 +04:00
SvyatoslavScherbina 2950921bd1 backend/codegen: use unnamed values instead of passing tmp variable names (#149) 2016-12-20 17:29:48 +07:00
Konstantin Anisimov 801953ec56 RUNTIME: laucher uses runtime API for registering and running out initializers 2016-12-20 12:46:22 +03:00
Konstantin Anisimov 5f097350ac TEST: test for global variable initialization added 2016-12-20 12:46:22 +03:00
Konstantin Anisimov 86bb5477c5 CODEGEN: implementation of global fields initialization. 2016-12-20 12:46:22 +03:00
Konstantin Anisimov bca03288f6 CODEGEN: Possibility to create string literal from String implemented (refactoring) 2016-12-20 12:46:22 +03:00
Svyatoslav Scherbina 4706ec9ddd Review feedback, part 1 2016-12-20 15:33:38 +07:00