Commit Graph

23 Commits

Author SHA1 Message Date
pyos
ef5e02da84 JVM_IR: handle Nothing and Unit more consistently.
* In blocks, discard the result of any statement that has a return
   type other than void. This was previously done by wrapping each
   statement into an "implicit Unit conversion" that was actually
   compiled down to a stack pop instead. If an expression happened to
   already have type Unit, however, such a conversion was not inserted,
   resulting in a stray reference on the stack. These conversions are
   now redundant and should probably be removed.

 * In assignments and non-exhaustive conditionals, materialize a Unit
   on the stack to avoid depth mismatches that trip up the bytecode
   validator. Because such expressions are generally used at block level
   (and, indeed, the frontend will reject a non-exhaustive conditional
   used as an expression), combined with the above change this results
   in no additional GETSTATIC opcodes, as they are immediately removed
   by the peephole optimizer.
2019-03-26 13:32:02 +01:00
Ting-Yuan Huang
79fcaae991 Implement constant folding in the IR backend for JVM
The newly added pass folds the set of constant functions of the
current backend, plus IrBuiltIns.
2019-03-20 21:02:55 +01:00
Roman Artemev
91ea377622 [JS IR BE] Fix translation for float literals 2018-10-25 15:48:42 +03:00
Dmitry Petrov
813e4c966a Update testData for constant initializers in IR 2018-10-02 17:08:55 +03:00
Georgy Bronnikov
ade640eadb JVM_IR. Support compile time constants 2018-10-01 12:25:55 +03:00
Georgy Bronnikov
487f500f85 Revert "JVM_IR. Support compile time constants"
This reverts commit 055215c54f.
2018-09-25 05:24:48 +03:00
Georgy Bronnikov
055215c54f JVM_IR. Support compile time constants 2018-09-25 01:38:51 +03:00
Alexander Udalov
4f803d03cf Minor, fix test data 2018-08-31 19:54:08 +02:00
Pavel Punegov
2ff6047845 Update ignore tag for Native backend 2018-08-28 13:48:43 +03:00
Mikhael Bogdanov
357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Anton Bannykh
07b3b66fd9 JS IR: unmute tests 2018-07-10 13:34:19 +03:00
Mikhael Bogdanov
e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Roman Artemev
6ac4fd2e5f [JS IR BE] Update test data 2018-06-14 19:54:30 +03:00
Anton Bannykh
96355e2732 JS IR: mute codegen box tests automatically 2018-06-09 19:15:38 +03:00
Mikhail Zarechenskiy
73b3efd628 Remove LANGUAGE_VERSION directive from blackBox codegen tests 2017-10-24 11:44:02 +03:00
Dmitry Petrov
a84c2a6f31 Improve string concatentation & string templates code generation
Reuse StringBuilder instances for nested subexpressions.
(NB StringBuilder instance for string template with a string
concatenation inside an expression entry, such as `"${"a" + "b"}"`,
will not be reused, although that doesn't seem to be a real-life issue).

 #KT-18558 Fixed Target versions 1.1.4
 #KT-13682 Fixed Target versions 1.1.4

Join adjacent strings literals, escaped strings, and constant values
(in a language version that supports const val inlining).
Use StringBuilder#append(char) for single-character constants
(e.g., " " in "$a $b").

 #KT-17280 Fixed Target versions 1.1.4
 #KT-15235 Fixed Target versions 1.1.4
2017-06-27 14:28:42 +03:00
Alexey Andreev
069711c3d5 JS: fix translation of float constants. See KT-8413 2016-12-30 16:22:07 +03:00
Zalim Bashorov
596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Michael Bogdanov
926e3fd350 Test for obsolete KT-9560
#KT-9560 Obsolete
2015-10-20 19:19:43 +03:00
Michael Bogdanov
3452fc8d02 Don't initialize const properties in constructor
#KT-9532 Fixed
2015-10-17 15:31:57 +03:00
Natalia Ukhorskaya
e5a3518248 Parse longs with 'L' suffix. Report error if 'l' used. 2013-12-05 15:23:40 +04:00
Natalia Ukhorskaya
b6ce6c5e5a Parse floats with 'F' or 'f' suffix 2013-12-05 15:22:01 +04:00
Svetlana Isakova
a49dcc0dd4 analyze when entry in independent context 2013-09-03 17:05:21 +04:00