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
Anton Bannykh
a1649e9e4d
JS: fix import cleaner
...
The tag generated during the source file translation could differ from
the tag generated based on the import statement (e.g. "intrinsic:..."
during generation becomes "'Kotlin'...." later on).
This means that the same function imported from the start and imported
during inlining has different tags. Which makes duplicate import removal
trickier. The best solution would be to make sure the tag generation
algorithms are consistent.
Current solution: rewrite the tags in terms of the Inliner tag
generation algorithm right after the source file translation.
Also it seems that some `var` statements we treated as imports, even
though they were not. Supported this behavior for now.
TODO: Get rid of these workaround
2019-02-14 15:14:28 +03:00
Anton Bannykh
c1fbeeb7d9
JS: fix bugs
2019-02-14 15:14:28 +03:00
Anton Bannykh
a30c7fbee1
JS: Support imported wrapper serialization
2019-02-14 15:14:28 +03:00
Anton Bannykh
75668826d3
JS: simplification in process
2019-02-14 15:14:28 +03:00
Anton Bannykh
2cbdc7ecb0
JS: store whole JsImportedModule's in the module local alias
...
Module references were stored as plain JsName's. When inlining a function
from one fragment to another, those references should be re-interpreted
in terms of the destination fragment. Storing the whole module information
makes that much easier.
2019-02-14 15:14:28 +03:00
Anton Bannykh
a0ff581a2f
JS: refactoring
2019-02-14 15:14:28 +03:00
Anton Bannykh
6d26bf9622
JS: don't load binary AST unless required by the inliner
2019-02-14 15:14:28 +03:00
Anton Bannykh
c83b6d46cc
JS: split JsInliner
2019-02-14 15:14:28 +03:00
Anton Bannykh
c65383fa3f
JS: postpone JS AST merging
2019-02-14 15:14:28 +03:00
Anton Bannykh
ec276dbea4
JS: convert JsInliner to Kotlin
2019-02-14 15:14:28 +03:00
Anton Bannykh
039625bb7e
JS: convert K2JSTranslator to Kotlin
2019-02-14 15:14:28 +03:00
Anton Bannykh
1052ec898c
JS: review fixes (mostly tests)
2019-02-14 15:14:28 +03:00