• Mathias Bynens's avatar
    [turbofan] Prefer memoized JSGraph constants · 5950c007
    Mathias Bynens authored
    For numbers, `JSGraph::Constant(Handle<Object> value)` first checks the
    type of `value`, and then calls `JSGraph::Constant` for its type, which
    in turn performs some further checks before returning a value.
    
    This patch saves a few `if` checks by making the following changes:
    
    - JSGraph::Constant(0) → JSGraph::ZeroConstant()
    - JSGraph::Constant(1) → JSGraph::OneConstant()
    
    Change-Id: I6946c280437b7f1fe80d7c45c6fd9b3571907e07
    Reviewed-on: https://chromium-review.googlesource.com/840982Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Commit-Queue: Mathias Bynens <mathias@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#50288}
    5950c007
js-create-lowering.cc 76.5 KB