Generate code for looking up built-ins
Instead of storing built-ins in a std::unordered_map, we now generate
a series of switch statements using the hash value of the look-up
string. This works similarly to earlier implementation of looking up
unmangled built-ins.
Those built-ins that need to be initialized at run-time are stored as
member variables of TSymbolTable.
This increases compiler init performance significantly, as well as
increasing compiler perf test scores around 1-2%. Binary size is
larger than before though.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: If1dcd36f0d2b30c2ed315cdcf6e831ae9fe70c94
Reviewed-on: https://chromium-review.googlesource.com/960031
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/scripts/run_code_generation.py b/scripts/run_code_generation.py
index 982d401..034682a 100755
--- a/scripts/run_code_generation.py
+++ b/scripts/run_code_generation.py
@@ -165,6 +165,7 @@
'src/compiler/translator/BuiltIn_autogen.h',
'src/compiler/translator/ParseContext_autogen.h',
'src/compiler/translator/SymbolTable_autogen.cpp',
+ 'src/compiler/translator/SymbolTable_autogen.h',
'src/tests/compiler_tests/ImmutableString_test_autogen.cpp',
],
'script': 'src/compiler/translator/gen_builtin_symbols.py',