Description[turbofan] Add FixedArray peephole optimizations to CodeStubAssembler
Previously, CodeStubAssembler macros performing FixedArray element accesses had
to compute offsets to elements explicitly with a fair amount of duplicated
code. Furthermore, any peephole optimizations that could produce better code--
like recognizing constant indices or combining array index computation with Smi
untagging--were also duplicated.
This change factors the code to compute FixedArray index offsets into a common
routine in the CodeStubAssembler that applies standard peephole optimizations to
all accesses. In order to do this, it also introduces limited introspection into
the up-until-now opaque Node* type exported from code-assembler.h, allowing
Nodes to be queried whether they are constant and extracting their constant
value in that case.
Committed: https://crrev.com/cbdb373804585d18351e9b5c25a1cad33a4058c7
Cr-Commit-Position: refs/heads/master@{#36370}
Patch Set 1 #Patch Set 2 : Tweaks #Patch Set 3 : Fix test #
Total comments: 8
Patch Set 4 : Review feedback #
Total comments: 4
Patch Set 5 : Even simpler #Patch Set 6 : Add test case #Patch Set 7 : Final review feedback #
Messages
Total messages: 14 (6 generated)
|