Commit Graph

66779 Commits

Author SHA1 Message Date
Ivan Kylchik cbc9c19faf Add methods for message and clause from Throwable in ir builtins map 2020-06-24 16:12:46 +03:00
Ivan Kylchik d9279bff73 Introduce ExceptionState class responsible for all kind of exceptions 2020-06-24 16:12:46 +03:00
Ivan Kylchik be3eb98fbd Introduce new Common state that represent common object
This is a replacement for Complex, that are now an abstract class.
2020-06-24 16:12:46 +03:00
Ivan Kylchik 4345294ac1 Add all methods from Any class in ir builtins map 2020-06-24 16:12:46 +03:00
Ivan Kylchik d03937cdb6 Pop return value after implicit coercion to unit 2020-06-24 16:12:46 +03:00
Ivan Kylchik 792ae8d272 Get rid of dynamic cast interpretation 2020-06-24 16:12:46 +03:00
Ivan Kylchik 3ccf542b38 Rework object and companion object interpretation
For now object value or fun can be interpreter only if they are
marked explicitly. Annotation for all object is restricted and if
whole class is marked with CompileTimeAnnotation this doesn't
mean that companion object is computable.
2020-06-24 16:12:46 +03:00
Ivan Kylchik 0ef34dcf53 Implement class cast interpretation 2020-06-24 16:12:45 +03:00
Ivan Kylchik a25896bf6a Implement string concatenation interpretation 2020-06-24 16:12:45 +03:00
Ivan Kylchik 0839e7afdc Describe default behaviour for Any class methods
We are talking about such methods as equals, hashCode and toString.
2020-06-24 16:12:45 +03:00
Ivan Kylchik a6cc7cdc23 Rewrite exception handler to catch null pointer exception in js ir
For now null check works as !! operator called in jvm.
So it throw KotlinNullPointerException, but js ir require
NullPointerException
2020-06-24 16:12:45 +03:00
Ivan Kylchik 5209f4a9c0 Add not null (!!) operator in ir builtins map 2020-06-24 16:12:45 +03:00
Ivan Kylchik bb119280be Interpret basic interpretation for try catch block 2020-06-24 16:12:45 +03:00
Ivan Kylchik b5778e6de5 Implement interpretation for lambdas and anonymous functions 2020-06-24 16:12:45 +03:00
Ivan Kylchik 4fdfdb9b4c Implement StringBuilder interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik 06ee4ac21f Implement List and MutableList interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik 9555497d5d Implement arrayOf symbols interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik 4dc1e587b4 Implement vararg interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik 45555d681d Add methods from arrays classes in ir builtins map 2020-06-24 16:12:44 +03:00
Ivan Kylchik 3ab7c263d0 Implement continue statement interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik c4cc858b84 Extract ir function interpretation in separate method
This modification will be used to get exception stack trace
2020-06-24 16:12:44 +03:00
Ivan Kylchik f99829ce5e Implement trim function interpretation in compile time 2020-06-24 16:12:43 +03:00
Ivan Kylchik 178b2a07ae Move all interpreter methods inside IrInterpreter class 2020-06-24 16:12:43 +03:00
Ivan Kylchik f8cb637712 Change IrInterpreter to modify tree structure into the flat one
This modification is necessary to implement right control flow
2020-06-24 16:12:43 +03:00
Ivan Kylchik 0a76da99cf Implement equalTo function for descriptors 2020-06-24 16:12:43 +03:00
Ivan Kylchik dd93deddd7 Add while loop support in interpreter 2020-06-24 16:12:43 +03:00
Ivan Kylchik c2a70b4e57 Add rangeTo entry in builtins map 2020-06-24 16:12:43 +03:00
Ivan Kylchik 34a59f5b85 Add abstract classes and interfaces support in interpreter 2020-06-24 16:12:42 +03:00
Ivan Kylchik b1dc403182 Add branches support in interpreter 2020-06-24 16:12:42 +03:00
Ivan Kylchik dcd8a4a4c7 Add variables support in interpreter 2020-06-24 16:12:42 +03:00
Ivan Kylchik aca7a49214 Add some sort of correct calculation with const modifier 2020-06-24 16:12:42 +03:00
Ivan Kylchik a20269bcdd Extract some methods to utils 2020-06-24 16:12:42 +03:00
Ivan Kylchik 11e808715b Rethink main goal of stack frame 2020-06-24 16:12:42 +03:00
Ivan Kylchik c3600ba114 Implement interpreter that can evaluate simple fun
For now working cases are: create simple object using primary
constructor, invoke its method, invoke superclass method,
load/save fields. Return values from compile time function can be
only primitives for now.
2020-06-24 16:12:42 +03:00
Ivan Kylchik a582d88cf4 Create simple stack model for interpreter 2020-06-24 16:12:41 +03:00
Ivan Kylchik f6373a647e Create simple interpreter that evaluate constant values 2020-06-24 16:12:41 +03:00
Ivan Kylchik a27a07ce81 Create generator for map with builtin operations 2020-06-24 16:12:41 +03:00
Dmitry Petrov e9570d6efd Minor: update testData 2020-06-24 16:04:38 +03:00
Toshiaki Kameyama 6b2c87020b Replace explicit parameter with 'it': do not suggest when lambda is directly under "when" or "if"
Relates to #KT-35320
2020-06-24 14:55:30 +02:00
Georgy Bronnikov daab07ea38 JVM_IR: use MetadataSource for local delegated properties 2020-06-24 14:41:01 +03:00
Alexey Trilis 593684ecb6 Fix testdata after changing API of kotlin.browser and kotlin.dom 2020-06-24 13:38:29 +03:00
Toshiaki Kameyama e6edab1c82 Quick doc: do not show nullability annotations
#KT-37132 Fixed
2020-06-24 10:45:57 +02:00
Toshiaki Kameyama e8aa14a283 Method sepatators: show separator between companion object and function
#KT-24352 Fixed
2020-06-24 10:05:27 +02:00
Ilya Chernikov 5942446274 [minor] clean up main-kts-dependencies 2020-06-23 21:56:04 +02:00
Ilya Chernikov 4c34e9dd03 Move main-kts cache test to out-of-process compilation
to avoid clashes with coroutine debugger when running
tests from IntelliJ
2020-06-23 21:56:04 +02:00
Ilya Chernikov 879e22f274 Fix coroutines core shading in main-kts 2020-06-23 21:56:04 +02:00
Gia Thuan Lam 83b52bb109 Enable Input Redirection for KotlinRunConfiguration
#KT-28854 Fixed

(cherry picked from commit 6e55010767b1c1a7c8d23d337bdbd5824dfa2906)
2020-06-23 21:04:09 +02:00
Ilya Goncharov 69e8abfe3c Fix test data for new project wizard in Project Templates 2020-06-23 21:07:35 +03:00
Dmitry Petrov 4e92c79bc4 JVM_IR: don't generate nullability annotations on synthetic declarations
Fixes KT-36993 and some other related issues.
2020-06-23 20:51:48 +03:00
Dmitry Petrov d477d9eb43 JVM_IR KT-37005: no delegates for @InlineOnly funs in multifile facades 2020-06-23 20:22:41 +03:00