Commit f3fc35e3 authored by Marius Wachtler's avatar Marius Wachtler

Micro-optimize symbol table sorting

parent 71cca6c0
......@@ -2363,11 +2363,12 @@ public:
if (ENABLE_FRAME_INTROSPECTION) {
// TODO: don't need to use a sorted symbol table if we're explicitly recording the names!
// nice for debugging though.
SortedSymbolTable sorted_symbol_table(symbol_table.begin(), symbol_table.end());
typedef std::pair<InternedString, CompilerVariable*> Entry;
std::vector<Entry> sorted_symbol_table(symbol_table.begin(), symbol_table.end());
std::sort(sorted_symbol_table.begin(), sorted_symbol_table.end(),
[](const Entry& lhs, const Entry& rhs) { return lhs.first < rhs.first; });
for (const auto& p : sorted_symbol_table) {
CompilerVariable* v = p.second;
v->serializeToFrame(stackmap_args);
pp->addFrameVar(p.first.str(), v->getType());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment