• Sathya Gunasekaran's avatar
    [turboprop] Unroll loop in the dynamic map checks operator · 9c67790b
    Sathya Gunasekaran authored
    The dynamic map checks operator loads the feedback vector and performs
    map checks against each map and handler entry in the feedback against
    the incoming map and handler.
    
    Instead of emitting code to iterate over this feedback vector at
    runtime, we unroll this loop at compile time.
    
    The generated code is similar to this pseudocode:
    
      length = feedback_slot.length
      if length >= 4: goto labels[3]
      if length == 3: goto labels[2]
      if length == 2: goto labels[1]
      if length == 1: goto labels[0]
    
      labels[3]:
        map = load(feedback_slot, 6)
        if incoming_map == map goto handler_check(7)
        goto labels[2]
      labels[2]:
        map = load(feedback_slot, 4)
        if incoming_map == map goto handler_check(5)
        goto labels[1]
      labels[1]:
        map = load(feedback_slot, 2)
        if incoming_map == map goto handler_check(3)
        goto labels[0]
      labels[0]:
        map = load(feedback_slot, 0)
        if incoming_map == map goto handler_check(1)
        bailout
    
      handler_check (index):
        handler = load(feedback_slot, index)
        if incoming_handler ==  handler goto done
        deoptimize
    
    Bug: v8:10582, v8:9684
    Change-Id: I64d64ff8eda664e4d476bf1b2612e26a344e98a6
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2339960
    Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
    Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#69797}
    9c67790b
Name
Last commit
Last update
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...