[JS IR] Namer improvements

- Compute and store local names locally when translating a body.
  It is a step towards separate JS generation and hopefully reduces memory usage.

- Use stable mangled names for member names. Needed for separate JS generation.

- Add `abstract class IrNamerBase` with just 3 abstract methods to simplify
  creating new IrNamer implementations.

- Fix O(N^2) of findFreshName when it is called wtih the same name suggestion a lot of times.

- Refactor NameTables initialisation: factor out some functions and use descriptive names.

- Use StringBuilder in sanitizeName
This commit is contained in:
Svyatoslav Kuzmich
2020-12-22 18:58:55 +03:00
parent c9cb7bc0fd
commit cdb488149f
11 changed files with 244 additions and 276 deletions
@@ -399,7 +399,6 @@ fun Char.isES5IdentifierPart(): Boolean {
Character.CONNECTOR_PUNCTUATION -> true
else -> false
} ||
// Nl which is missing in Character.isLetter, but present in UnicodeLetter in spec
this == '\u200C' || // Zero-width non-joiner
this == '\u200D' // Zero-width joiner
}