Commit Graph

51915 Commits

Author SHA1 Message Date
Dmitry Petrov 83b2fed5be psi2ir: minor: drop unused import 2019-02-14 16:03:11 +03:00
Dmitry Petrov 6889e470d1 psi2ir: minor: move array access generation code 2019-02-14 16:03:11 +03:00
Dmitry Petrov 50269d3a5c psi2ir: minor: simplify code for dynamic array element assignment 2019-02-14 16:03:11 +03:00
Dmitry Petrov cf29dce4c2 pri2ir: dynamic unary & binary expressions
NB1 Not every dynamic unary or binary expression is translated to
dynamic operator expressions literally. For example, assignments and
increments can have safe calls in LHS, which require some extra logic.

NB2 There are some open design questions left regarding how dynamic
expressions should actually be translated.
2019-02-14 16:03:11 +03:00
Dmitry Petrov 82701de87b psi2ir: minor: drop some unused params/imports 2019-02-14 16:03:11 +03:00
Dmitry Petrov fbbe4f6e92 psi2ir: dynamic array element get/set 2019-02-14 16:03:11 +03:00
Dmitry Petrov 9a2bd5f4e6 psi2ir: dynamic member simple assignment/augmented assignment/++/-- 2019-02-14 16:03:11 +03:00
Dmitry Petrov fc76d0970b psi2ir: Implicit casts with 'dynamic' 2019-02-14 16:03:11 +03:00
Dmitry Petrov 3c8f52b436 psi2ir: simple dynamic member calls 2019-02-14 16:03:11 +03:00
Dmitry Petrov ddb1ea2047 psi2ir: dynamic member access ('d.x', 'd?.x') 2019-02-14 16:03:11 +03:00
Dmitry Petrov 6e7ccfbfff Introduce IrDynamicExpression and children
Dynamic expressions are represented as either operator expressions -
e.g., `d1 + d2`, `d[e]`, `d(e1, e2, e3)`, `d += e` -
where "operator" is a one of the known operators,
or as member reference expressions - e.g., `d.memberName` - where
member name is some arbitrary name (unresolved at compile-time and
represented as String).
2019-02-14 16:03:11 +03:00
Anton Bannykh f8dc6763bd JS: minor review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh 4e298ae5cb JS: Inlined local declarations should be positioned after imports 2019-02-14 15:14:28 +03:00
Anton Bannykh 0bfd332580 JS: improve a test (review fix) 2019-02-14 15:14:28 +03:00
Anton Bannykh 9ad1d8d054 JS: improve inline suspend function declaration splitter 2019-02-14 15:14:28 +03:00
Anton Bannykh 4b39e2df12 JS: (review fix) Header -> InlineData 2019-02-14 15:14:28 +03:00
Anton Bannykh 0fa87e3baa JS: advance IC version 2019-02-14 15:14:28 +03:00
Anton Bannykh 5c1664ebf8 JS: collect label definitions, not some of their usages 2019-02-14 15:14:28 +03:00
Anton Bannykh b7bea3242e JS: fix fragment info loading
The very first fragment didn't got processed, thus inline cycle
reporter was not failing tests
2019-02-14 15:14:28 +03:00
Anton Bannykh 370194796e JS: fix synthethic name bindings for the inlined local declarations
TODO add synthetic order-based namebindings for inlined local
declarations AFTER all post-processings. This would be a more robust
approach imho
2019-02-14 15:14:28 +03:00
Anton Bannykh 32de99fe32 JS: review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh 8f68c47225 JS: support inline function definitions without wrappers
Apparently function literals are translated without hiding the local declarations
in the wrapFunction call.

Which makes sense. Apart from the fact that it would also make
sense to do the same for private inline functions and function
literals inside other inline functions.
2019-02-14 15:14:28 +03:00
Anton Bannykh 6e74c4ce71 JS: switch off the validator until class translation is fixed 2019-02-14 15:14:28 +03:00
Anton Bannykh 0daa6675bd JS: comments, review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh 1c67e4cf21 JS: simplify and fix the AST visitor code. 2019-02-14 15:14:28 +03:00
Anton Bannykh 11265f1424 JS: review fixes (renamings, etc.) 2019-02-14 15:14:28 +03:00
Anton Bannykh 990ee849e2 JS: test local declaration deduplication with name clash; fix the test 2019-02-14 15:14:28 +03:00
Anton Bannykh 60aa6e4971 JS: a cross-module local declaration fake override test;
Also describe an alternative, more robust approach in a TODO comment
2019-02-14 15:14:28 +03:00
Anton Bannykh b4b406af99 JS: explain what validateJsAst does; enable validation in non-incremental tests 2019-02-14 15:14:28 +03:00
Anton Bannykh a35fc4fa3c JS: use string table for module names and inline function tags 2019-02-14 15:14:28 +03:00
Anton Bannykh d7499363bc JS: review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh 44dedf3a64 JS: minor refactoring 2019-02-14 15:14:28 +03:00
Anton Bannykh 396ec20788 JS: add constructor binding and inlining test 2019-02-14 15:14:28 +03:00
Anton Bannykh 92401f0561 JS: fix primary constructor name tag generation 2019-02-14 15:14:28 +03:00
Anton Bannykh 36fd4d24fb JS: move label renaming to new fragment post-processing
Also remove metadata renaming from the global passes
2019-02-14 15:14:28 +03:00
Anton Bannykh 6921d4d128 JS: minor 2019-02-14 15:14:28 +03:00
Anton Bannykh 2022a9c887 JS: fix inheriting fake overrides in inlined object literals 2019-02-14 15:14:28 +03:00
Anton Bannykh 9716abcc12 JS: inline private properties 2019-02-14 15:14:28 +03:00
Anton Bannykh 50aeeee462 JS: fix the test 2019-02-14 15:14:28 +03:00
Anton Bannykh 21cbc7b018 JS: add incremental test for local declarations change 2019-02-14 15:14:28 +03:00
Anton Bannykh 299a45ccbf JS: validate AST when serializing to IC cache 2019-02-14 15:14:28 +03:00
Anton Bannykh e4b081e1bf JS: fix inline cycle reporting 2019-02-14 15:14:28 +03:00
Anton Bannykh b5b770c804 JS: line number fix 2019-02-14 15:14:28 +03:00
Anton Bannykh 47a219eeff JS: refactorings & cleanup 2019-02-14 15:14:28 +03:00
Anton Bannykh e76f80cbc6 JS: prevent duplicate imports inside inline function definition 2019-02-14 15:14:28 +03:00
Anton Bannykh 13844bd08e JS: FunctionReader cleanup 2019-02-14 15:14:28 +03:00
Anton Bannykh 6d5ef2d324 JS: fix long constants importing 2019-02-14 15:14:28 +03:00
Anton Bannykh cd0fd569b4 JS: visit tests and main in import remover; update line numbers 2019-02-14 15:14:28 +03:00
Anton Bannykh 52b705e7ae JS: Fix local aliases
Local aliases can be copied as-is to a different fragment now. Before this change we would have had to extract the local alias tag (if any) from the source fragment and add to the destination fragment name bindings.
2019-02-14 15:14:28 +03:00
Anton Bannykh 3a258ad08a JS: fix module references in case of @JsModule annotation 2019-02-14 15:14:28 +03:00