Commit Graph

82905 Commits

Author SHA1 Message Date
Ivan Kylchik ec16c40bf4 Save right entry point for expression 2021-06-07 15:34:34 +03:00
Ivan Kylchik 9d9ab498aa Remove typeArguments field in State interface 2021-06-07 15:34:33 +03:00
Ivan Kylchik a10d88924f Simplify getIrFunctionByIrCall method in KFunctionState
Removed check of invoke symbols equality. Without this check it is
possible to store init functions in KFunctionState
2021-06-07 15:34:32 +03:00
Ivan Kylchik 3d1d86e9cb Change call method of KProperty1Proxy to invoke corresponding accessors 2021-06-07 15:34:30 +03:00
Ivan Kylchik 64d5cea337 Implement getter and setter for KPropertyProxy 2021-06-07 15:34:29 +03:00
Ivan Kylchik f89b75e387 Implement interpretation of KParameter interface 2021-06-07 15:34:28 +03:00
Ivan Kylchik a4edddaa6e Extract all reflection state classes into separate files 2021-06-07 15:34:26 +03:00
Ivan Kylchik aa321f2333 Move ReflectionState.kt into separate package "reflection" 2021-06-07 15:34:25 +03:00
Ivan Kylchik 5a95e5b45f Implement interpretation for KType and KTypeParameter 2021-06-07 15:34:24 +03:00
Ivan Kylchik 88b5b5f702 Implement interpretation of KVisibility class
For now it is interpreted as Wrapper, but maybe further it will be
converted to Common
2021-06-07 15:34:23 +03:00
Ivan Kylchik 40bf4fafc9 Implement basic interpretation of IrClassReference 2021-06-07 15:34:22 +03:00
Ivan Kylchik 002804941f Replace Lambda state with KFunctionState 2021-06-07 15:34:21 +03:00
Ivan Kylchik 749200d518 Fix constructor call checker
Forget to check constructor for availability of compile time annotation
2021-06-07 15:34:19 +03:00
Ivan Kylchik 41ea1525d1 Implement basic interpretation for KProperty 2021-06-07 15:34:18 +03:00
Ivan Kylchik c3d0438405 Allow to interpret property reference 2021-06-07 15:34:16 +03:00
Ivan Kylchik ac858f760a Forbid vararg flattening in place there array was expected 2021-06-07 15:34:15 +03:00
Ivan Kylchik 8b2706aaee Change interpretConstructor method to be able to init object single time 2021-06-07 15:34:13 +03:00
Ivan Kylchik 903e883809 Add additional type arguments to stack from super types 2021-06-07 15:34:12 +03:00
Ivan Kylchik a9d686b9f9 Add outer object to stack when interpreting constructor of inner class 2021-06-07 15:34:11 +03:00
Ivan Kylchik b570d3f7fd Fix interpreter error related to recreating Unit object 2021-06-07 15:34:09 +03:00
Ivan Kylchik b98f680d65 Fix interpreter error related to incorrect work of get value for objects 2021-06-07 15:34:08 +03:00
Ivan Kylchik d931e2eead Implement simple proxy for non interface structures like kotlin.Pair 2021-06-07 15:34:07 +03:00
Ivan Kylchik 1e5096294e Implement proxy for custom interfaces 2021-06-07 15:34:06 +03:00
Ivan Kylchik 96a090f2ab Implement LambdaProxy class 2021-06-07 15:34:04 +03:00
Ivan Kylchik 1d0acedc48 Rewrite Complex class as interface
This change allow ExceptionState to be both: State and Throwable
2021-06-07 15:34:03 +03:00
Ivan Kylchik 6808151af7 Remove method getOriginal from Complex class
Common class no longer contains Common super classes,
all fields are now inside one single object.
2021-06-07 15:34:02 +03:00
Ivan Kylchik 4c75576414 Implement basic proxy for Common state
For now proxy works only for Any class methods and only for Common
state.
2021-06-07 15:34:01 +03:00
Ivan Kylchik 3c0c8d97cc Add possibility to interpret spread operator on unsigned arrays 2021-06-07 15:33:59 +03:00
Ivan Kylchik ca231ccc53 Rethrow InterpreterTimeOutError as UserException 2021-06-07 15:33:58 +03:00
Ivan Kylchik c23e8517b3 Fix type arguments saving for arrays 2021-06-07 15:33:57 +03:00
Ivan Kylchik 7ecf4b17b6 Change evaluation function for arrayOf
For now it will get only elements variable from stack instead of all
2021-06-07 15:33:56 +03:00
Ivan Kylchik 4010eb11bd Implement method to calculate EQEQ ir builtin function 2021-06-07 15:33:54 +03:00
Ivan Kylchik 9b1f11b22b Extend compile time checker to check constructors body 2021-06-07 15:33:53 +03:00
Ivan Kylchik cc0bbac354 Support isSubtypeOf check for functional type 2021-06-07 15:33:52 +03:00
Ivan Kylchik c1aa39065f Add handler for setters in getIrFunction method 2021-06-07 15:33:49 +03:00
Ivan Kylchik 6a483a8464 Add simple handler for StackOverflowError in ir interpreter 2021-06-07 15:33:48 +03:00
Ivan Kylchik f3d7dc5f22 Rewrite exceptions handler in ir interpreter
For now there are 2 types of exceptions:
1. UserExceptions - express user and jvm like exceptions
2. InterpreterError - thrown only if something is wrong with interpreter
2021-06-07 15:33:47 +03:00
Ivan Kylchik c3b0c9c6b2 Support multiple nested try blocks 2021-06-07 15:33:46 +03:00
Ivan Kylchik ad6ba0cf11 Support lateinit var interpretation 2021-06-07 15:33:45 +03:00
Ivan Kylchik b45df06680 Forbid to interpret non const top level properties 2021-06-07 15:33:43 +03:00
Ivan Kylchik 393ad9ae9b Fix compile time checker for get and set field expressions 2021-06-07 15:33:42 +03:00
Ivan Kylchik a084dabdde Return Unit value from block if statements count is equal to zero 2021-06-07 15:33:41 +03:00
Ivan Kylchik 13ab7eafca Move out compile time function checker logic to EvaluationMode.kt 2021-06-07 15:33:40 +03:00
Ivan Kylchik 84e6e1e305 Add WITH_ANNOTATIONS evaluation mode
This mode means that function can be executed if it has
CompileTimeCalculation annotation. FULL mode for now will mean deep
check without annotation help
2021-06-07 15:33:39 +03:00
Ivan Kylchik 1151c6177b Move IrCompileTimeChecker to separate checker package 2021-06-07 15:33:37 +03:00
Ivan Kylchik 47ed6789d2 Fix interpreting of java static members such as Boolean.TRUE 2021-06-07 15:33:36 +03:00
Denis.Zharkov 592256976e FIR: Fix inference of builder-inference function from expect type
Previously, such calls were being completed with FULL mode and incorrect
INFERENCE_NO_INFORMATION_FOR_PARAMETER has been reported
2021-06-07 15:25:57 +03:00
Denis.Zharkov 18e93b50d9 FIR: Fix loading read-only collection Java types with incorrect variance 2021-06-07 15:25:56 +03:00
Denis.Zharkov 5ade831665 FIR: Fix INFERENCE_NO_INFORMATION_FOR_PARAMETER on type alias with generic expansion
^KT-46996 Fixed
2021-06-07 15:25:55 +03:00
Denis.Zharkov d76db0e011 FIR: Mute backend tests relevant to new INFERENCE_NO_INFORMATION_FOR_PARAMETER
See KT-46967 and KT-46996
2021-06-07 15:25:53 +03:00