Commit Graph

7 Commits

Author SHA1 Message Date
Ludwig Hollmann
39aa950660 Update file header comments for headers in lib. 2025-05-04 22:26:26 +02:00
Mike Ash
6ccfe7e213 [Runtime] Shrink RemanglerBuffer's SubstitutionEntry.
We stack-allocate 512 of these entries for a temporary cache, so the entry size matters a great deal. Shrink it from 3 words to 2 by storing treatAsIdentifier in the low bit of the node pointer.

rdar://149685318
2025-04-24 15:44:46 -04:00
Alastair Houghton
5ece45a61f [Remangler] Improve performance by caching hashes.
The deepHash() function gets called repeatedly as we descend the
node tree, which results in O(n^2) behaviour because we're traversing
entire node subtree from each node we try substitution in, in order
to calculate the hash.

Fix by adding a hash table for hashes, so that we can look up hashes
we've already computed.

This appears to yield a 26.8% saving in local tests.

rdar://125739630
2024-04-04 16:09:12 +01:00
Alastair Houghton
227b438963 [Demangling] Added DEMANGLER_ASSERT to replace assert() calls.
This returns an error code if we're in the runtime, rather than assert()ing.

rdar://79725187
2021-09-06 17:49:50 +01:00
Tony Allevato
5b1daa9055 Conditionally wrap (de)mangling symbols in an inline namespace.
Since libDemangling is included in the Swift standard library,
ODR violations can occur on platforms that allow statically
linking stdlib if Swift code is linked with other compiler
libraries that also transitively pull in libDemangling, and if
the stdlib version and compiler version do not match exactly
(even down to commit drift between releases). This lets the
runtime conditionally segregate its copies of the libDemangling
symbols from those in the compiler using an inline namespace
without affecting usage throughout source.
2020-06-19 11:20:56 -07:00
Erik Eckstein
c6abbfa29d Remangler: don't construct a std::string for hashing and comparing identifiers
This avoids memory allocations.
2019-03-13 11:49:58 -07:00
Erik Eckstein
abccbd8c8c runtime: make the old remangler allocation free.
Extract common code from the old and new remangler into a common base class.
This lets the old remangler benefit from the changes I did recently in the new remangler.
2019-03-13 11:49:58 -07:00