• danno's avatar
    [turbofan] Add FixedArray peephole optimizations to CodeStubAssembler · cbdb3738
    danno authored
    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.
    
    Review-Url: https://codereview.chromium.org/1989363004
    Cr-Commit-Position: refs/heads/master@{#36370}
    cbdb3738
code-assembler.cc 25.8 KB