[JS IR] Use topological order for loading klibs in JS IR IC

Generally, the library order doesn't matter.

 However, after lowering we need to post process
 lowered klibs in topological order:
  - commit incremental cache artifacts,
  - produce JS AST.

 The patch uses an ability of the Kotlin library resolver to load klibs
 in topological order and drops its reimplementation from IC infrastructure.

 There is one side effect:
   klibs which are not reachable from the main module, will produce their JS.
   This should be more correct than just ignoring them.
This commit is contained in:
Alexander Korepanov
2022-11-16 11:47:24 +01:00
committed by Space Team
parent ec6a7094e6
commit 8cde0a81bc
8 changed files with 93 additions and 101 deletions
@@ -5,4 +5,4 @@ STEP 0:
dirty js: lib1, lib2, main
STEP 1:
libs: lib1, lib2, main
dirty js: lib2
dirty js: lib1, lib2